OFFSET
0,3
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..300 (terms 0..150 from Alois P. Heinz)
EXAMPLE
There are a(10) = 18 such partitions of 10: [6,2,1,1], [5,2,2,1], [4,4,1,1], [3,3,2,2], [8,1,1], [7,2,1], [6,3,1], [6,2,2], [5,4,1], [5,3,2], [4,4,2], [4,3,3], [9,1], [8,2], [7,3], [6,4], [5,5], [10].
MAPLE
b:= proc(n, i, l) local j, k, m; m:= nops(l);
for j to m-2 do for k from j+1 to m-1 do
if (l[m]-l[k])*(k-j)=(l[k]-l[j])*(m-k)
then return 0 fi od od;
`if`(n=0, 1, `if`(i<1, 0, b(n, i-1, l)+
`if`(i>n, 0, b(n-i, i, [l[], i]))))
end:
a:= n-> b(n, n, []):
seq(a(n), n=0..40);
MATHEMATICA
b[n_, i_, l_] := Module[{j, k, m = Length[l]}, For[j = 1, j <= m - 2, j++, For[k = j+1, k <= m-1, k++, If[(l[[m]] - l[[k]])*(k - j) == (l[[k]] - l[[j]])*(m - k), Return[0]]]]; If[n == 0, 1, If[i < 1, 0, b[n, i - 1, l] + If[i > n, 0, b[n - i, i, Append[l, i]]]]]];
a[n_] := b[n, n, {}];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 21 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt and Alois P. Heinz, Mar 02 2014
STATUS
approved