login
A prime number sieve defined by the recurrence: T(n, k) = If n = k then 1 else if k divides n then -Sum_{i=k+1..n} T(n, i) else T(n,k) = 0.
0

%I #7 Mar 30 2016 18:18:06

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

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

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

%N A prime number sieve defined by the recurrence: T(n, k) = If n = k then 1 else if k divides n then -Sum_{i=k+1..n} T(n, i) else T(n,k) = 0.

%C Same negative sum as in the recurrence for the Möbius function except that it is applied at all the divisors and not only in the first column. The table therefore acts as a prime number sieve giving the characteristic sequence of prime numbers in the first column. Row sums are 1,0,0,0,0,0,0,0,0,...

%F T(n, k) = If n = k then 1 else if k divides n then -Sum_{i=k+1..n} T(n, i) else T(n,k) = 0.

%e {

%e {1},

%e {-1, 1},

%e {-1, 0, 1},

%e {0, -1, 0, 1},

%e {-1, 0, 0, 0, 1},

%e {0, 0, -1, 0, 0, 1},

%e {-1, 0, 0, 0, 0, 0, 1},

%e {0, 0, 0, -1, 0, 0, 0, 1},

%e {0, 0, -1, 0, 0, 0, 0, 0, 1},

%e {0, 0, 0, 0, -1, 0, 0, 0, 0, 1},

%e {-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},

%e {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1}

%e }

%t (* recurrence *) Clear[t, n, k, nn]; nn = 12; t[n_, k_] := t[n, k] = If[n == k, 1, If[Mod[n, k] == 0, -Sum[t[n, i], {i, k + 1, n}], 0]]; Flatten[Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]]

%K sign

%O 1

%A _Mats Granvik_, Mar 29 2016