OFFSET
1,3
COMMENTS
EXAMPLE
prime(12) = 37 -> 1 0 0 1 0 1 ..... n = 6
prime(13) = 41 -> 1 0 1 0 0 1 ..... all primes p:
prime(14) = 43 -> 1 0 1 0 1 1 ..... 2^(6-1) <= p < 2^6
prime(15) = 47 -> 1 0 1 1 1 1
prime(16) = 53 -> 1 1 0 1 0 1
prime(17) = 59 -> 1 1 1 0 1 1
prime(18) = 61 -> 1 1 1 1 0 1
col-sums of bits: 7 3 5 4 3 7 : T(6,5)=7, T(6,4)=3, T(6,3)=5,
...
MATHEMATICA
S[n_] := S[n] = IntegerDigits[Select[Range[2^(n-1), 2^n], PrimeQ], 2] // Transpose;
T[1, 1] = 0;
T[n_, k_] := S[n][[n-k+1]] // Total;
Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 14 2021 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Reinhard Zumkeller, Jul 19 2004
STATUS
approved