OFFSET
0,3
COMMENTS
FORMULA
a(0)=1, a(n) = Sum_{i=0..floor(log_2(n))} Cat(n-(2^i))
G.f.: 1 + Sum_{k>=0} x^(2^k)*C(x) where C(x) = (1-sqrt(1-4*x))/(2*x) is the g.f. of the Catalan numbers (A000108). [Joerg Arndt, Jul 02 2012]
MAPLE
A073268 := proc(n) local i; if(0=n) then 1 else add(Cat(n-2^i), i=0..floor(evalf(log[2](n)))); fi; end;
Cat := n -> binomial(2*n, n)/(n+1);
MATHEMATICA
a[0] = 1; a[n_] := Sum[CatalanNumber[n - 2^i], {i, 0, Log[2, n]}]; Table[ a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 05 2016 *)
PROG
(MIT/GNU Scheme) (define (A073268 n) (if (zero? n) 1 (let sumloop ((i (floor->exact (/ (log n) (log 2)))) (s 0)) (cond ((negative? i) s) (else (sumloop (-1+ i) (+ s (A000108 (- n (expt 2 i))))))))))
(PARI)
N=66; x='x+O('x^N); lg=ceil(log(N)/log(2));
C(x)=(1-sqrt(1-4*x))/(2*x);
gf=1+sum(k=0, lg, x^(2^k)*C(x) );
Vec(gf)
/* Joerg Arndt, Jul 02 2012 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 25 2002
STATUS
approved