OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16384
EXAMPLE
a(7) = 6: 31111, 3211, 322, 331, 4111, 421.
a(8) = 10: 32111, 3221, 3311, 332, 41111, 4211, 422, 431, 5111, 521.
a(9) = 8: 42111, 4221, 4311, 432, 51111, 5211, 522, 531.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1)+`if`(i>n or abs(i-(n-i))>2, 0, b(n-i, i))))
end:
a:= n-> b(n$2):
seq(a(n), n=0..100);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1] + If[i > n || Abs[i - (n - i)] > 2, 0, b[n - i, i]]]];
a[n_] := b[n, n];
a /@ Range[0, 100] (* Jean-François Alcover, Dec 11 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, May 20 2017
STATUS
approved