OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..400
EXAMPLE
a(4) = 4: [1,1,1,1], [1,1,2], [1,3], [4];
a(5) = 6: [1,1,1,1,1], [1,1,1,2], [1,2,2], [1,1,3], [1,4], [5];
a(6) = 10: [1,1,1,1,1,1], [1,1,1,1,2], [1,1,2,2], [2,2,2], [1,1,1,3], [1,2,3],[3,3], [1,1,4], [1,5], [6].
MAPLE
with (combinat):
b:= proc(n, j, t, s) option remember;
add (b(n-i, i, irem(t+1, s), s), i=j..iquo(n, 2))+
`if`(igcd(t, s)=1, 1, 0)
end:
a:= n-> numbpart(n-1) +`if`(n>1, 1, 0) +add (b(n-i, i, 2, i), i=2..iquo(n, 2)):
seq (a(n), n=1..50);
MATHEMATICA
b[n_, j_, t_, s_] := b[n, j, t, s] = Sum[b[n-i, i, Mod[t+1, s], s], {i, j, Quotient[n, 2]}] + If[GCD[t, s]==1, 1, 0]; a[n_] := PartitionsP[n-1] + If[n>1, 1, 0] + Sum [b[n-i, i, 2, i], {i, 2, Quotient[n, 2]}]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Feb 15 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 25 2011
STATUS
approved