OFFSET
0,2
COMMENTS
LINKS
C. Deugau and F. Ruskey, Complete k-ary Trees and Generalized Meta-Fibonacci Sequences
B. Jackson and F. Ruskey, Meta-Fibonacci Sequences, Binary Trees and Extremal Compact Codes
B. Jackson and F. Ruskey, Meta-Fibonacci Sequences, Binary Trees and Extremal Compact Codes, Electronic Journal of Combinatorics, 13 (2006), #R26, 13 pages.
F. Ruskey, C. Deugau, The Combinatorics of Certain k-ary Meta-Fibonacci Sequences, JIS 12 (2009) 09.4.3. [This is a later version than that in the GenMetaFib.html link]
FORMULA
Recurrence: a(2n) = 2a(n) + A000120(n) - 1, a(2n+1) = a(2n) + 1.
G.f.: (1 / 1-z) * (z + z * sum(z^(2^i) * (s + (1 / (1 - z^(2^k)))),i=0..infinity)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
MATHEMATICA
Table[IntegerExponent[(2 n)!, 2] + 1, {n, 0, 65}] (* or *)
Table[2 n - DigitCount[2 n, 2, 1] + 1, {n, 0, 65}] (* Michael De Vlieger, Feb 04 2017 *)
PROG
(PARI) a(n)=1+sum(k=1, n, valuation(k, 2)+1)
(PARI) a(n)=if(n==0, 1, if((n%2)==0, 2*a(n/2)+subst(Pol(binary(n)), x, 1)-1, a(n-1)+1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Dec 28 2004
STATUS
proposed