Carmichael numbers

Demonstrate that the Carmichael numbers (the smallest few are 561, 1105, 1729, 2465, 2821 and 6601) really do fool the Fermat test. That is, write a procedure carmichael-test that takes an integer n and tests whether a^n is congruent to a modulo n for every a < n, and try your procedure on the given Carmichael numbers.


There are no comments yet.

Authentication required

You must log in to post a comment.

Login
(check-equal? (carmichael-test 4) #f)
(check-equal? (carmichael-test 3) #t)
(check-equal? (carmichael-test 561) #t)
(check-equal? (carmichael-test 1105) #t)
(check-equal? (carmichael-test 1729) #t)
(check-equal? (carmichael-test 2465) #t)
(check-equal? (carmichael-test 2821) #t)
(check-equal? (carmichael-test 6601) #t)