|
|
A022290
|
|
Replace 2^k in binary expansion of n with Fibonacci(k+2).
|
|
36
|
|
|
0, 1, 2, 3, 3, 4, 5, 6, 5, 6, 7, 8, 8, 9, 10, 11, 8, 9, 10, 11, 11, 12, 13, 14, 13, 14, 15, 16, 16, 17, 18, 19, 13, 14, 15, 16, 16, 17, 18, 19, 18, 19, 20, 21, 21, 22, 23, 24, 21, 22, 23, 24, 24, 25, 26, 27, 26, 27, 28, 29, 29, 30, 31, 32, 21, 22, 23, 24, 24, 25, 26
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
G.f.: 1/(1-x) * Sum_{k>=0} F(k+2)*x^2^k/(1+x^2^k), where F = A000045.
Can be computed from the recurrence:
a(4*k) = a(k)+a(2*k),
a(4*k+1) = a(k)+a(2*k+1),
a(4*k+2) = a(k)-a(2*k)+2*a(2*k+1),
a(4*k+3) = a(k)-2*a(2*k)+3*a(2*k+1),
and the initial terms a(0) = 0, a(1) = 1. (End)
Empirically:
(End)
|
|
EXAMPLE
|
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
0
1
2, 3
3, 4, 5, 6
5, 6, 7, 8, 8, 9, 10, 11
8, 9, 10, 11, 11, 12, 13, 14, 13, 14, 15, 16, 16, 17, 18, 19
...
(End)
|
|
MAPLE
|
dgs := convert(n, base, 2) ;
add( op(i, dgs)*A000045(i+1), i=1..nops(dgs)) ;
# second Maple program:
b:= (n, i, j)-> `if`(n=0, 0, j*irem(n, 2, 'q')+b(q, j, i+j)):
a:= n-> b(n, 1$2):
|
|
MATHEMATICA
|
Table[Reverse[#].Fibonacci[1 + Range[Length[#]]] &@ IntegerDigits[n, 2], {n, 0, 54}] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
|
|
PROG
|
(Haskell)
a022290 0 = 0
a022290 n = h n 0 $ drop 2 a000045_list where
h 0 y _ = y
h x y (f:fs) = h x' (y + f * r) fs where (x', r) = divMod x 2
(PARI) my(m=Mod('x, 'x^2-'x-1)); a(n) = subst(lift(subst(Pol(binary(n)), 'x, m)), 'x, 2); \\ Kevin Ryde, Sep 22 2020
(Python)
a, b, s = 1, 2, 0
for i in bin(n)[-1:1:-1]:
s += int(i)*a
a, b = b, a+b
|
|
CROSSREFS
|
Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A054204 (even index Fibonaccis), A062877 (odd index Fibonaccis), A059590 (factorials), A089625 (primes).
|
|
KEYWORD
|
nonn,tabf,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|