login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A070750 0 if n-th prime is even, 1 if n-th prime is == 1 mod 4, and -1 if n-th prime is == 3 mod 4. 20

%I

%S 0,-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

%N 0 if n-th prime is even, 1 if n-th prime is == 1 mod 4, and -1 if n-th prime is == 3 mod 4.

%C Also, sin(prime(n)*Pi/2), where prime(n) = A000040(n), Pi=3.1415... (original definition).

%C Also imaginary part of primes mapped as defined in A076340, A076341: a(n) = A076341(A000040(n)), real part = A076342.

%C Legendre symbol (-1/prime(n)) for n > 1. - _T. D. Noe_, Nov 05 2003

%C For n>1, let p = prime(n) and m = (p-1)/2. Then c(m) - a(n) = 0 mod p, where c(m) = (2*m)!/(m!)^2 = A000984(m) is the central binomial coefficient [Proof: By definition, c(m)*(m!)^2 - (p-1)! = 0 and therefore c(m)*(m!)^2*(-1)^(m+1) - (p-1)!*(-1)^(m+1) = 0. Now apply Wilson's theorem, (p-1)! = 1 mod p, and its corollary, (m!)^2 = (-1)^(m+1) mod p, and finally use the formula by T. D. Noe listed below to replace (-1)^m by a(n).]. Similarly, C_m - 2*a(n) = 0 mod p, with C_m = A000108(m) being the m-th Catalan number [Proof: By definition, C_m*(p+1)*(m!)^2 - 2*(p-1)! = 0. The result follows proceeding as in the first proof.]. - _Stanislav Sykora_, Aug 11 2014

%H Reinhard Zumkeller, <a href="/A070750/b070750.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LegendreSymbol.html">Legendre Symbol</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Wilson%27s_theorem">Wilson's theorem</a>

%F a(n) = 2 - prime(n) mod 4.

%F a(n) = (-1)^((prime(n)-1)/2) for n > 1. - _T. D. Noe_, Nov 05 2003

%e p = 4*k+1 (see A002144): a(p) = sin((4*k+1)*Pi/2) = sin(2*k*Pi+Pi/2) = sin(Pi/2) = 1.

%e p = 4*k+3 (see A002145): a(p) = sin((4*k+3)*Pi/2) = sin(2*k*Pi+3*Pi/2) = sin(3*Pi/2) = -1.

%t a[n_] := JacobiSymbol[-1, Prime[n]]; a[1] = 0; Table[a[n], {n, 1, 72}] (* _Jean-Fran├žois Alcover_, Oct 05 2012, after _T. D. Noe_ *)

%o (PARI) apply(n->2-n%4,primes(100)) \\ _Charles R Greathouse IV_, Aug 21 2011

%o (Haskell)

%o a070750 = (2 -) . (`mod` 4) . a000040 -- _Reinhard Zumkeller_, Feb 28 2012

%Y Cf. A000040, A070748, A070749, A002144, A002145, A000108, A000984, A134323, A257834, A076340, A076341.

%K sign,nice,easy

%O 1,1

%A _Reinhard Zumkeller_, May 04 2002

%E Changed wording of definition - _N. J. A. Sloane_, Jun 21 2015.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 20 22:45 EDT 2019. Contains 326155 sequences. (Running on oeis4.)