OFFSET
0,4
COMMENTS
a(0) = 1 as is common practice with partitions.
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..400
EXAMPLE
There are 4 partitions of 6 into distinct parts, 6, 5+1, 4+2, and 3+2+1. Since 3+2+1 contains the arithmetic progression 3,2,1, it won't be counted here. Thus a(6)=3.
MATHEMATICA
a[n_] := If[n == 0, 1, Select[IntegerPartitions[n],
With[{u = Union[#]}, Length[#] == Length[u] &&
SequencePosition[u, {b_, ___, c_, ___, d_} /;
b-c == c-d, 1] == {}]&] // Length];
Table[an = a[n]; Print[n, " ", an]; an, {n, 0, 60}] (* Jean-François Alcover, Aug 20 2021 *)
PROG
(Sage) has_arith_prog = lambda x, size: any(len(set(differences(c))) <= 1 for c in Combinations(x, size))
A178932 = lambda n: Partitions(n, max_slope=-1).filter(lambda p: not has_arith_prog(sorted(p), 3)).cardinality() # [D. S. McNeil, Dec 31 2010]
CROSSREFS
KEYWORD
nonn
AUTHOR
David S. Newman, Dec 30 2010
STATUS
approved