OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
EXAMPLE
MAPLE
b:= proc(n, l) option remember; local k, t; t:= min(l[]);
if n=0 then 1
elif t>0 then b(n-t, map(h->h-t, l))
else for k while l[k]>0 do od;
add(`if`(n>=j, b(n, s(k=j, l)), 0), j=2..3)+
`if`(k<=6 and l[k+2]=0, b(n, s(k=1, k+2=1, l)), 0)+
`if`(k<=4 and l[k+2]=0 and l[k+2*2]=0, b(n, s(k=1,
k+2=1, k+2*2=1, l)), 0)+ `if`(irem(k, 2)>0 and
l[k+1]=0, b(n, s(k=1, k+1=1, l)), 0)
fi
end:
a:=n-> b(n, [0$8]): s:= subsop:
seq(a(n), n=0..10);
MATHEMATICA
b[n_, l_] := b[n, l] = Module[{k, t}, t = Min[l]; Which[n == 0, 1, t > 0, b[n-t, l-t], True, For[k = 1, l[[k]] > 0, k++]; Sum[If[n >= j, b[n, ReplacePart[l, k -> j]], 0], {j, 2, 3}] + If[k <= 6 && l[[k + 2]] == 0, b[n, ReplacePart[l, {k -> 1, k+2 -> 1}]], 0] + If[k <= 4 && l[[k+2]] == 0 && l[[k+2*2]] == 0, b[n, ReplacePart[l, {k -> 1, k+2 -> 1, k+2*2 -> 1}]], 0] + If[Mod[k, 2] > 0 && l[[k+1]] == 0, b[n, ReplacePart[l, {k -> 1, k+1 -> 1}]], 0]]]; a[n_] := b[n, Array[0&, 8]]; Table[Print[an = a[n]]; an, {n, 0, 16}] (* Jean-François Alcover, Dec 30 2013, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 11 2013
STATUS
approved