OFFSET
1,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..5000
MAPLE
b:= proc(n, i, t, s) option remember; `if`(n=0, t*s, `if`(i<1, 0,
b(n, i-1, t, s)+(h-> `if`(h in {1, 2}, add(b(n-i*j, i-1,
`if`(h=1, 1, t), `if`(h=2, 1, s)), j=1..n/i), 0))(irem(i, 8))))
end:
a:= n-> b(n$2, 0$2):
seq(a(n), n=1..75); # Alois P. Heinz, Sep 04 2020
MATHEMATICA
b[n_, i_, t_, s_] := b[n, i, t, s] = If[n == 0, t s, If[i < 1, 0, b[n, i - 1, t, s] + Function[h, If[h == 1 || h == 2, Sum[b[n - i j, i - 1, If[h == 1, 1, t], If[h == 2, 1, s]], {j, 1, n/i}], 0]][Mod[i, 8]]]];
a[n_] := b[n, n, 0, 0];
Array[a, 75] (* Jean-François Alcover, Oct 31 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved