OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
For n=3 there are three unrestricted partitions: 3, 2+1, and 1+1+1. The least positive integer not in the first partition is 1. One is not a prime so the first partition is not counted. For the second partition the smallest missing positive integer is 3, which is prime. For the third partition the missing number is 2, which is prime. So a(3)=2.
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0,
`if`(t or isprime(i), 1, 0), `if`(i>n, 0,
`if`(t or isprime(i), b(n, i+1, true), 0)+
add(b(n-i*j, i+1, t), j=1..n/i)))
end:
a:= n-> b(n, 1, false):
seq(a(n), n=0..70); # Alois P. Heinz, Jun 16 2018
MATHEMATICA
nend = 30;
For[n = 1, n <= nend, n++,
sum[n] = 0;
partition = {n};
For[i = 1, i <= PartitionsP[n], i++,
partition = NextPartition[partition];
mex = Min[Complement[Range[n + 1], partition]];
If [PrimeQ[mex], sum[n]++; ] ] ];
Table[sum[i], {i, 1, nend}]
CROSSREFS
KEYWORD
nonn
AUTHOR
David S. Newman, Jun 14 2018
STATUS
approved