OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
The a(1) = 1 through a(8) = 12 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (21) (31) (32) (51) (43) (53)
(111) (211) (41) (321) (52) (71)
(1111) (311) (411) (61) (431)
(2111) (3111) (511) (521)
(11111) (21111) (3211) (611)
(111111) (4111) (5111)
(31111) (32111)
(211111) (41111)
(1111111) (311111)
(2111111)
(11111111)
MAPLE
b:= proc(n, i, s) option remember; `if`(n=0 or i=1, 1,
`if`(andmap(j-> igcd(i, j)=1, s), b(n-i, min(n-i, i-1),
numtheory[factorset](i)), 0)+b(n, i-1, s))
end:
a:= n-> b(n$2, {}):
seq(a(n), n=0..60); # Alois P. Heinz, Oct 13 2019
MATHEMATICA
Table[Length[Select[IntegerPartitions[n], !MatchQ[#, {___, x_, y_, ___}/; GCD[x, y]>1]&]], {n, 0, 30}]
(* Second program: *)
b[n_, i_, s_] := b[n, i, s] = If[n == 0 || i == 1, 1,
If[AllTrue[s, GCD[i, #] == 1&], b[n - i, Min[n - i, i - 1],
FactorInteger[i][[All, 1]]], 0] + b[n, i - 1, s]];
a[n_] := b[n, n, {}];
a /@ Range[0, 60] (* Jean-François Alcover, May 10 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 12 2019
STATUS
approved