login
Indicator sequence of primes p > 3: k = p mod 6, if k = 5 then a(n) = -1, if k = 1 then a(n) = 1 else a(n) = 0, a(2) = -1, a(3) = 1.
1

%I #20 Jul 20 2013 14:31:05

%S 0,-1,1,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,0,0,0,0,-1,0,1,

%T 0,0,0,0,0,1,0,0,0,-1,0,1,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,1,0,0,

%U 0,0,0,1,0,0,0,-1,0,1,0,0,0,0,0,1,0,0,0,-1,0,0

%N Indicator sequence of primes p > 3: k = p mod 6, if k = 5 then a(n) = -1, if k = 1 then a(n) = 1 else a(n) = 0, a(2) = -1, a(3) = 1.

%H Freimut Marschner, <a href="/A227625/b227625.txt">Table of n, a(n) for n = 1..1900</a>

%t Join[{0, -1, 1}, Table[If[!PrimeQ[n], 0, If[Mod[n, 6] = 1, 1, -1], {n, 4, 100}]] (* _T. D. Noe_, Jul 20 2013 *)

%Y Cf. A129950 (indicator function of twin primes), A010051 (characteristic function of primes: 1 if n is prime else 0).

%K sign

%O 1

%A _Freimut Marschner_, Jul 18 2013