OFFSET
0,14
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16384
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