%I #44 Mar 04 2022 11:16:35
%S -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,
%T -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,
%U -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
%N a(n) = Legendre(-3, prime(n)).
%C Value of lowest trit of prime(n) in balanced ternary representation (A059095) (original definition).
%C For p = prime(n) != 3, a(n) = +1 if p is of the form 3*k + 1, and -1 if the p is of the form 3*k - 1. - _Joerg Arndt_, Sep 16 2014
%H Charles R Greathouse IV, <a href="/A134323/b134323.txt">Table of n, a(n) for n = 1..10000</a>
%F -1 if the n-th prime is 2 or == 5 mod 6, +1 if the n-th prime is == 1 mod 6, and 0 if it is 3.
%F a(n) = (1 - 0^A039701(n)) * (-1)^(A039701(n)+1).
%F a(n) != 0 for n != 2;
%F a(A049084(A003627(n))) = -1; a(A049084(A002476(n))) = +1.
%e 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.
%e 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.
%t 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_ *)
%t JacobiSymbol[-3, Prime[Range[100]]] (* _Alonso del Arte_, Aug 02 2017 *)
%o (Haskell)
%o a134323 n = (1 - 0 ^ m) * (-1) ^ (m + 1) where m = a000040 n `mod` 3
%o -- _Reinhard Zumkeller_, Sep 16 2014
%o (PARI) apply(p->kronecker(-3,p), primes(100)) \\ _Charles R Greathouse IV_, Aug 14 2017
%Y Cf. A000040, A039701, A049084, A112632 (partial sums), A059095 (balanced ternary)
%Y Cf. A091177 (indices of -1's), A091178 (indices of +1's), A003627, A002476.
%Y Other moduli: A070750, A257834.
%K sign,easy
%O 1,1
%A _Reinhard Zumkeller_, Oct 21 2007
%E Wording of definition changed by _N. J. A. Sloane_, Jun 21 2015
%E Name simplified by _Alonso del Arte_, Aug 02 2017