OFFSET
0,4
COMMENTS
If n is prime, a(n) = A000041(n) - 1.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
With n = 6, the prime divisors of 6 are 2 and 3, and the partitions of 6 that do not contain either 2 or 3 are: [6], [5,1], [4,1,1] and [1,1,1,1,1,1], so a(6) = 4.
MAPLE
with(numtheory): with(combinat):
a:= proc(n) local b, s; s:= factorset(n);
b:= proc(n, i) option remember;
`if`(n=0, 1, `if`(i<1, 0, b(n, i-1)+
`if`(i>n or i in s, 0, b(n-i, i))))
end;
`if`(isprime(n), numbpart(n)-1, b(n$2))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Feb 04 2014
MATHEMATICA
a[1]=1; a[n_] := If[PrimeQ[n], PartitionsP[n] - 1, Block[{p = First /@ FactorInteger@n}, Length@ Select[ IntegerPartitions[n], Intersection[#, p] == {} &]]]; Array[a, 50] (* Giovanni Resta, Feb 04 2014 *)
a[0] = a[1] = 1; a[n_] := Module[{b, s}, s = FactorInteger[n][[All, 1]]; b[m_, i_] := b[m, i] = If[m == 0, 1, If[i<1, 0, b[m, i-1]+ If[i>m || MemberQ[s, i], 0, b[m-i, i]]]]; If[PrimeQ[n], PartitionsP[n]-1, b[n, n] ]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Nov 11 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
J. Stauduhar, Feb 03 2014
EXTENSIONS
a(8)-a(49) from Giovanni Resta, Feb 04 2014
STATUS
approved