OFFSET
1,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Wikipedia, Rank of a partition
FORMULA
G.f.: (1/Product_{k>=1} (1-x^k)) * Sum_{k>=1} (-1)^(k-1) * x^(k*(3*k-1)/2) * (1-x^k) * Sum_{p prime} x^(k*p).
a(n) = Sum_{p prime} A063995(n,p). - Alois P. Heinz, Dec 20 2024
EXAMPLE
a(6) = 3 counts these partitions: 6, 5+1, 4+2.
MAPLE
b:= proc(n, i, c) option remember; `if`(i>n, 0, `if`(i=n,
`if`(isprime(i-c), 1, 0), b(n-i, i, c+1)+b(n, i+1, c)))
end:
a:= n-> b(n, 1$2):
seq(a(n), n=1..56); # Alois P. Heinz, May 23 2023
MATHEMATICA
b[n_, i_, c_] := b[n, i, c] = If[i > n, 0, If[i == n, If[i-c > 0 && PrimeQ[i-c], 1, 0], b[n-i, i, c+1] + b[n, i+1, c]]];
a[n_] := b[n, 1, 1];
Table[a[n], {n, 1, 56}] (* Jean-François Alcover, Dec 20 2024, after Alois P. Heinz *)
PROG
(PARI) my(N=60, x='x+O('x^N)); concat([0, 0], Vec(1/prod(k=1, N, 1-x^k)*sum(k=1, N, (-1)^(k-1)*x^(k*(3*k-1)/2)*(1-x^k)*sum(j=1, N, isprime(j)*x^(k*j)))))
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Seiichi Manyama, May 23 2023
STATUS
approved