login
The OEIS is supported by the many generous donors 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). 19
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, -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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Also, sin(prime(n)*Pi/2), where prime(n) = A000040(n), Pi=3.1415... (original definition).
Also imaginary part of primes mapped as defined in A076340, A076341: a(n) = A076341(A000040(n)), real part = A076342.
Legendre symbol (-1/prime(n)) for n > 1. - T. D. Noe, Nov 05 2003
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 with 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
LINKS
Eric Weisstein's World of Mathematics, Legendre Symbol.
Wikipedia, Wilson's theorem.
FORMULA
a(n) = 2 - prime(n) mod 4 = 2 - A039702(n).
a(n) = (-1)^((prime(n)-1)/2) for n > 1. - T. D. Noe, Nov 05 2003
From Amiram Eldar, Dec 24 2022: (Start)
Product_{n>=1} (1 - a(n)/prime(n)) = 4/Pi (A088538).
Product_{n>=1} (1 + a(n)/prime(n)) = 2/Pi (A060294). (End)
EXAMPLE
p = 4*k+1 (see A002144): a(p) = sin((4*k+1)*Pi/2) = sin(2*k*Pi + Pi/2) = sin(Pi/2) = 1.
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.
MATHEMATICA
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 *)
Table[Which[EvenQ[p], 0, Mod[p, 4]==1, 1, True, -1], {p, Prime[Range[80]]}] (* Harvey P. Dale, Mar 16 2020 *)
PROG
(PARI) apply(n->2-n%4, primes(100)) \\ Charles R Greathouse IV, Aug 21 2011
(Haskell)
a070750 = (2 -) . (`mod` 4) . a000040 -- Reinhard Zumkeller, Feb 28 2012
CROSSREFS
Sequence in context: A011596 A011597 A070747 * A011598 A324672 A330035
KEYWORD
sign,nice,easy
AUTHOR
Reinhard Zumkeller, May 04 2002
EXTENSIONS
Wording of definition changed by N. J. A. Sloane, Jun 21 2015
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 3 13:19 EDT 2024. Contains 373982 sequences. (Running on oeis4.)