A134323 a(n) = Legendre(-3, prime(n)).
-1, 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, 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
Offset: 1
Examples
For n=20, prime(20) = 71, and we verify that -3 is not a quadratic residue modulo 71, hence a(20) = -1. Also, we see that the balanced ternary representation row A059095(71) = {1, 0, -1, 0, -1} which ends in -1. For n=21, prime(21) = 73, and we see that x^2 = -3 mod 73 has solutions like x = 17, 56, hence a(21) = 1. Also, the balanced ternary representation row A059095(73) = {1, 0 -1, 0, 1} which ends in 1.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Haskell
a134323 n = (1 - 0 ^ m) * (-1) ^ (m + 1) where m = a000040 n `mod` 3 -- Reinhard Zumkeller, Sep 16 2014
-
Mathematica
A134323[n_] := (r = Mod[Prime[n], 6]; If[r == 1, 1, -1]); A134323[1] = -1; A134323[2] = 0; Table[A134323[n], {n, 1, 102}] (* Jean-François Alcover, Nov 07 2011, after Bill McEachen *) JacobiSymbol[-3, Prime[Range[100]]] (* Alonso del Arte, Aug 02 2017 *)
-
PARI
apply(p->kronecker(-3,p), primes(100)) \\ Charles R Greathouse IV, Aug 14 2017
Formula
Extensions
Wording of definition changed by N. J. A. Sloane, Jun 21 2015
Name simplified by Alonso del Arte, Aug 02 2017
Comments