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!)
A212159 a(n) = (-1)^((prime(n) + 1)/2). 2
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, 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
2
COMMENTS
a(n) = +1 iff prime(n) == 3 (mod 4), a(n) = -1 iff prime(n) == 1 (mod 4), n>=2.
If -1 is replaced by 0 this is the characteristic sequence of the primes of the form 4*k+3, k=0,1,2,... See A002145 and A100672(n), n>=2.
a(n) = (((prime(n)-1)/2)!)^2 mod prime(n), n>=2. For the proof see a comment on A212158 regarding a corollary to Wilson's theorem. See, e.g., the link with a blog by W. Holsztyński.
a(n) is congruent to 1^2*3^2*5^2*...*(prime(n)-2)^2 (mod prime(n)). For example, a(4)=1 because 7 is the 4th prime number and 1^2*3^2*5^2==1 (mod 7). - Geoffrey Critzer, Apr 03 2015
REFERENCES
K. H. Rosen, Elementary Number Theory, Addison-Wesley, 2011, page 223.
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 156.
LINKS
FORMULA
a(n) = (-1)^((prime(n)+1)/2) = (-1)^A006254(n-1), n>=2.
a(n) = (A212158(n))^2 (mod prime(n)), n>=2. See a comment above.
EXAMPLE
a(2) = +1 because (3+1)/2 is even.
a(2) = +1 because 1^2 mod 3 = +1.
a(6) = -1 because (13+1)/2 = 7, and 7 is odd.
a(6) = -1 because 720^2 = 518400 == 12 (mod 13) == -1 (mod 13).
MATHEMATICA
Table[(-1)^((p + 1)/2), {p, Prime[Range[2, 100]]}] (* Geoffrey Critzer, Apr 03 2015 *)
PROG
(PARI) a(n)=-(-1)^(prime(n)\2) \\ Charles R Greathouse IV, Jun 13 2013
CROSSREFS
Sequence in context: A008836 A087960 A164660 * A106400 A112865 A114523
KEYWORD
sign,easy
AUTHOR
Wolfdieter Lang, May 08 2012
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 March 29 11:45 EDT 2024. Contains 371278 sequences. (Running on oeis4.)