OFFSET
0,10
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
FORMULA
a(2*n) = a(n),
a(6*n+1) = a(n+1) - a(n),
a(6*n+3) = a(n+2) - 2*a(n+1) + a(n),
a(6*n+5) = a(n+3) - 3*a(n+2) + 3*a(n+1) - a(n).
MAPLE
a:= proc(n) option remember; local m, q, r;
m:= (irem(n, 6, 'q')+1)/2;
`if`(n<2, n, `if`(irem(n, 2, 'r')=0, a(r),
add(a(q+m-j)*(-1)^j*binomial(m, j), j=0..m)))
end:
seq(a(n), n=0..100);
MATHEMATICA
a[n_] := a[n] = Module[{m, q, r, q2, r2}, {q, r} = QuotientRemainder[n, 6]; m = (r+1)/2; If[n<2, n, {q2, r2} = QuotientRemainder[n, 2]; If[r2 == 0, a[q2], Sum[a[q+m-j]*(-1)^j*Binomial[m, j], {j, 0, m}]]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 08 2017, translated from Maple *)
CROSSREFS
AUTHOR
Alois P. Heinz, Sep 30 2013
STATUS
approved