|
|
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
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|