OFFSET
1,22
LINKS
Alois P. Heinz, Rows n = 1..500, flattened
O. P. Gupta and S. Luthra, Partitions into primes, Proc. Nat. Inst. Sci. India. Part A. 21 (1955), 181-184.
EXAMPLE
Triangle begins:
0,
1,
0,1,
1,0,
0,1,1,
1,1,0,
0,1,1,1,
1,1,1,0,
0,2,1,1,
1,1,2,1,
...
MAPLE
with(numtheory):
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1)+(p-> `if`(p>n, 0, b(n-p, i)))(ithprime(i))))
end:
T:= n-> `if`(n=1, 0, seq(b(n-ithprime(k), k), k=1..pi(n))):
seq(T(n), n=1..25); # Alois P. Heinz, Aug 16 2015
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i-1] + Function[p, If[p>n, 0, b[n-p, i]]][Prime[i]]]]; T[n_] := If[n == 1, 0, Table[b[n - Prime[k], k], {k, 1, PrimePi[n]}]]; Table[T[n], {n, 1, 25}] // Flatten (* Jean-François Alcover, Dec 06 2016 after Alois P. Heinz *)
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Aug 16 2015
EXTENSIONS
More terms from Alois P. Heinz, Aug 16 2015
STATUS
approved