View Single Post
Old 2005-08-18, 14:35   #2
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

24768 Posts
Default sqrt(2) mod F_n in UBASIC

I translated the sqrt(2) program to UBASIC

Code:
 10   input N0
 20   N=2^(2^N0)+1
 30   Ii=modpow(2,2^(N0-1),N)
 40   Ii2=modpow(2,2^(N0-2),N)
 50   Sq2=(Ii2*2*modinv((1+Ii),N))@N
 60   print Sq2,Sq2^2@N
This is interesting, but it would be far more interesting to find another sqrt(2) that is not the negative of this one (mod Fn). This would allow to factor Fn and you will appear in math books :-) .
alpertron is offline   Reply With Quote