%I #5 Jun 29 2008 03:00:00
%S 0,1,-1,1,-1,0,0,1,0,-1,1,0,0,1,0,1,0,0,1,0,0,0,1,0,1,-1
%N a(n) = the sign of r(n), where r(n) is the integer in [ -2n,2n] which is congruent to (2n)! modulo 4n+1
%C If 4n+1 is composite, then a(n)=0, except when n=2. If 4n+1 is a prime number, then (2n)! is a square root of -1 modulo 4n+1 and a(n)=1 or a(n)=-1. Is there a simple way to predict whether a(n)=1 or a(n)=-1 ? The Maple program could be simplified by setting sign(0)=0, but I do not know how to do that.
%D Hardy, G. H. and Wright, E. M., An introduction to the theory of number (Fourth Edition, 1960), section 7.7: the residue of ((p-1)/2)!
%e a(2) = -1 because 4! = 24 = -3 modulo 9 and a(5) = 0 because 10! = 0 modulo 21.
%p for n from 0 to 100 do (sign(2*mods((2*n)!,4*n+1)+1) + sign(2*mods((2*n)!,4*n+1)-1))/2 end do;
%K sign
%O 0,1
%A Christophe Leuridan (Christophe.Leuridan(AT)ujf-grenoble.fr), Apr 01 2003
|