login
A112448
a(n) = 1 if 2*n+1 is prime, otherwise a(n) = minimal residue of (-1)^binomial(n+2,2) mod (2n+1).
0
0, -1, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, -1, -1, 0, 1, 0, 0, 1, 0, 0, -1, 1, 0, 0, -1, 0, 1, -1, 0, 0, 1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 1, 1, 0, -1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 1, 0, 0, -1, 1, 0, 0, 0, 0, 1, -1, 0, 1, 1, 0, 0
OFFSET
0,1
LINKS
Eric Weisstein's World of Mathematics, Wilson's Theorem
MATHEMATICA
Table[If[PrimeQ[2 n + 1], (-1)^Binomial[n + 2, 2], 0], {n, 0, 101}] (* Michael De Vlieger, Aug 22 2015 *)
PROG
(PARI) a(n) = if (isprime(2*n+1), ((-1)^ (binomial(n+2, 2))), 0); \\ Michel Marcus, Aug 16 2015
CROSSREFS
Apart from signs, same as A101264.
Sequence in context: A130854 A165191 A189576 * A101264 A189723 A095770
KEYWORD
sign
AUTHOR
Eric W. Weisstein, Dec 12 2005
STATUS
approved