login
A287146
Number of partitions of n into distinct parts such that the absolute difference between any part and the sum of all smaller parts is not larger than one.
2
1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2
OFFSET
0,14
LINKS
FORMULA
a(2^n) = 0 for n > 0.
a(2^n-1) = 1 for n >= 0.
EXAMPLE
a(3) = 1: 21.
a(13) = 2: 6421, 7321.
a(25) = 3: (12)6421, (12)7321, (13)6321.
MAPLE
b:= proc(n, i) option remember; `if`(i*(i+1)/2<n, 0, `if`(n=0, 1,
b(n, i-1)+`if`(i>n or abs(i-(n-i))>1, 0, b(n-i, i-1))))
end:
a:= n-> b(n$2):
seq(a(n), n=0..120);
MATHEMATICA
b[n_, i_] := b[n, i] = If[i(i+1)/2 < n, 0, If[n == 0, 1, b[n, i - 1] + If[i > n || Abs[i - (n - i)] > 1, 0, b[n - i, i - 1]]]];
a[n_] := b[n, n];
a /@ Range[0, 120] (* Jean-François Alcover, Dec 11 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, May 20 2017
STATUS
approved