Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find Carmichael number sage

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 
Source by www.math.ucdavis.edu #
 
PREVIOUS NEXT
Tagged: #find #Carmichael #number #sage
ADD COMMENT
Topic
Name
9+8 =