For a little while I've been poking around in some basic number theory using the Sage computer mathematics system (and a tiny bit of PARI/GP, which is another package that comes bundled inside of Sage).
I was initially inspired by a
blog post of John Cook's about the Perrin numbers, a sequence sort of like the Fibonacci numbers that can be used
(
Read more... )
Comments 9
Reply
def search(order, coeff_limit, print_min, max):
"""Search coefficient space to the specified order for sufficiently large first pseudoprimes."""
def search_coeffs(coeffs, print_min, max):
M = recur(coeffs)
p = first_pseudoprime(M, max)
if p == None :
print coeffs,": OUT OF RANGE"
elif p >= print_min :
print coeffs,": ",p, factor(p)
def loop_coeffs(coeffs, order, coeff_limit, print_min, max):
if (order <= 0) :
search_coeffs(coeffs, print_min, max)
else :
for c in xrange(-coeff_limit, coeff_limit+1):
coeffs.append(c)
loop_coeffs(coeffs, order-1, coeff_limit, print_min, max)
coeffs.pop()
coeffs = []
loop_coeffs(coeffs, order, coeff_limit, print_min, max)
Reply
Reply
Reply
I was just making funky-looking graphs of some of the cases where it doesn't:
https://plus.google.com/u/0/100452847199780289157/posts/LD5EbVE814H
https://plus.google.com/u/0/100452847199780289157/posts/b99dxTV4j1o
Reply
Reply
Thanks much!
Reply
Reply
Leave a comment