Home

Published

- 1 min read

find Carmichael number sage

img of find Carmichael number sage

The solution for this is noted below

find Carmichael number sage

Solution

   for n in range(2,7000):
    if not is_prime(n):
        carmichael = True
        for a in range(1,n):
            if Mod(a,n)^n != Mod(a,n):
                carmichael = False
                break
        if carmichael:
            print n

Try other methods by searching on the site. That is if this doesn’t work