OFFSET
0,4
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..5000
Rémy Sigrist, PARI program for A033639.
EXAMPLE
Suppose base = 3 and a(0)..a(13) are 1, 1, 2, 1, 3, 7, 6, 20, 52, 6, 26, 104, 32, 162. In base 3, 14 = 112, so we convolve the last three terms with 1, 1, 2 to obtain 104*1 + 32*1 + 162*2 = 460.
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, (l->
add(l[i]*a(n-i), i=1..nops(l)))(Bits[Split](n)))
end:
seq(a(n), n=0..49); # Alois P. Heinz, Apr 14 2021
MATHEMATICA
a[0] = 1; a[n_] := a[n] = Total[(d = IntegerDigits[n, 2]) * Table[a[n - Length[d] + k - 1], {k, 1, Length[d]}]]; Array[a, 50, 0] (* Amiram Eldar, Jul 25 2023 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
STATUS
approved