2008-04-04から1日間の記事一覧

<a href="http://projecteuler.net/index.php?section=problems&id=188">Problem 188</a>

タワー表記かよ. 実はあっさり解ける問題. (define (find a b n) (define (order a n) (let loop ((i 1) (c a)) (if (= c 1) i (loop (+ i 1) (remainder (* c a) n))))) (if (= b 1) (remainder a n) (let1 o (order a n) (expt-mod a (find a (- b 1) o) n…