OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
G.f.: Product_{k>=0} (1 + (k + 2)! * x^(2^k)).
a(0) = 1; a(n) = (floor(log_2(n)) + 2)! * a(n - 2^floor(log_2(n))).
a(2^(k-1)-1) = A000178(k).
EXAMPLE
21 = 2^0 + 2^2 + 2^4 so a(21) = 2! * 4! * 6! = 34560.
MAPLE
a:= n-> (l-> mul((i+1)!^l[i], i=1..nops(l)))(convert(n, base, 2)):
seq(a(n), n=0..40); # Alois P. Heinz, Feb 10 2020
MATHEMATICA
nmax = 40; CoefficientList[Series[Product[(1 + (k + 2)! x^(2^k)), {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x]
a[0] = 1; a[n_] := (Floor[Log[2, n]] + 2)! a[n - 2^Floor[Log[2, n]]]; Table[a[n], {n, 0, 40}]
PROG
(PARI) a(n)={vecprod([(k+1)! | k<-Vec(select(b->b, Vecrev(digits(n, 2)), 1))])} \\ Andrew Howroyd, Aug 19 2019
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Aug 19 2019
STATUS
approved