login
Legendre symbol (-1,p) where p is the n-th prime.
0

%I #17 Apr 21 2016 08:38:52

%S -1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,-1,1,-1,-1,1,-1,-1,1,1,1,-1,-1,

%T 1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,1,-1,1,-1,1,

%U -1,1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,1,-1

%N Legendre symbol (-1,p) where p is the n-th prime.

%C Same as A070750 (where additionally a(1)=0 is included). - _Joerg Arndt_, Apr 21 2016

%F a(n) = A070750(n). - _Joerg Arndt_, Apr 21 2016

%t p = Table[Prime[i], {i, 2, 101}]; Table[JacobiSymbol[p[[j]] - 1, p[[j]]], {j, 1, 100}]

%t a[n_] := (-1)^((Prime[n]-1)/2); Table[a[n], {n, 2, 101}] (* _Jean-François Alcover_, Apr 20 2016 *)

%o (PARI) a(n)=kronecker(-1,prime(n)) \\ _Charles R Greathouse IV_, Jun 13 2013

%o (PARI) a(n)=if(prime(n)%4==1,1,-1) \\ _Charles R Greathouse IV_, Jun 13 2013

%Y Cf. A070750, A039702.

%K sign,easy

%O 2,1

%A _Joseph L. Pe_, Nov 28 2002

%E Replaced "(p-1,p)" by "(-1,p)" in name, _Joerg Arndt_, Apr 21 2016