OFFSET
1
COMMENTS
EXAMPLE
For n=3 (p=5), prime(3) = 5 = (4*1 + 1) = (6*1 - 1), then a(3) = 1 * -1 = -1.
For n=4 (p=7), prime(4) = 7 = (4*2 - 1) = (6*1 + 1), then a(4) = -1 * 1 = -1.
MATHEMATICA
Table[If[Mod[Prime[n + 2], 4] == 3, -1, 1] If[Mod[Prime[n + 2], 6] == 5, -1, 1], {n, 60}] (* Michael De Vlieger, May 12 2015 *)
Table[Which[MemberQ[{1, 11}, Mod[p, 12]], 1, MemberQ[{5, 7}, Mod[p, 12]], -1, True, 0], {p, Prime[Range[80]]}] (* Harvey P. Dale, Aug 05 2021 *)
PROG
(PARI) a(n)=if(prime(n)\/6%2, -1, 1) \\ Charles R Greathouse IV, May 13 2015
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Miguel Angel Velilla Mula, May 10 2015
EXTENSIONS
Edited by Charles R Greathouse IV, May 13 2015 and N. J. A. Sloane, Jun 21 2015
STATUS
approved