OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..6000
Wikipedia, Partition (number theory)
FORMULA
a(p) = A000720(p) for prime p.
EXAMPLE
a(5) = 3: [2,1,1,1], [3,1,1], [5].
a(6) = 5: [2,2,1,1], [3,2,1], [3,3], [4,1,1], [6].
a(7) = 4: [2,1,1,1,1,1], [3,1,1,1,1], [5,1,1], [7].
a(8) = 7: [2,2,2,1,1], [3,2,2,1], [3,3,2], [4,2,1,1], [4,3,1], [6,2], [8].
a(9) = 9: [2,2,1,1,1,1,1], [3,2,1,1,1,1], [3,3,1,1,1], [4,1,1,1,1,1], [5,2,1,1], [5,3,1], [6,1,1,1], [7,2], [9].
a(10) = 12: [2,2,1,1,1,1,1,1], [3,2,1,1,1,1,1], [3,3,1,1,1,1], [4,1,1,1,1,1,1], [5,2,1,1,1], [5,3,1,1], [5,5], [6,1,1,1,1], [7,2,1], [7,3], [9,1], [10].
MAPLE
with(numtheory):
b:= proc(n, i, m) option remember; `if`(n=0 or i=1,
`if`(m=0, 1, 0), `if`(m<0, 0, b(n, i-1, m)+
`if`(i>n, 0, b(n-i, i, m-bigomega(i)))))
end:
a:= n-> b(n$2, bigomega(n)):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_, m_] := b[n, i, m] = If[n == 0 || i == 1, If[m == 0, 1, 0], If[m < 0, 0, b[n, i-1, m] + If[i>n, 0, b[n-i, i, m - PrimeOmega[i]]]]];
a[0] = 1; a[n_] := b[n, n, PrimeOmega[n]];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Mar 25 2017, translated from Maple *)
PROG
(PARI) b(n, i, m) = if(n==0 || i==1, if(m==0, 1, 0), if(m<0, 0, b(n, i - 1, m) + if(i>n, 0, b(n - i, i, m - bigomega(i)))));
a(n) = if(n<1, 1, b(n, n, bigomega(n)));
for(n=0, 80, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 25 2017, translated from Mathematica
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 20 2017
STATUS
approved