|
|
A215024
|
|
Decimal equivalent of binary number in A215022.
|
|
8
|
|
|
0, 1, 4, 5, 18, 16, 17, 20, 21, 74, 72, 73, 66, 64, 65, 68, 69, 82, 80, 81, 84, 85, 298, 296, 297, 290, 288, 289, 292, 293, 266, 264, 265, 258, 256, 257, 260, 261, 274, 272, 273, 276, 277, 330, 328, 329, 322, 320, 321, 324, 325, 338, 336, 337, 340, 341, 1194
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
MATHEMATICA
|
ind[n_] := Floor[Log[Abs[n]*Sqrt[5] + 1/2]/Log[GoldenRatio]]; f[1] = 1; f[n_] := If[n > 0, i = ind[n - 1]; If[EvenQ[i], i++]; i, i = ind[-n]; If[OddQ[i], i++]; i]; a[n_] := Module[{k = n, s = 0}, While[k != 0, i = f[k]; s += 2^(i - 1); k -= Fibonacci[-i]]; s]; Array[a, 100, 0] (* Amiram Eldar, Oct 15 2019 *)
|
|
PROG
|
(PARI) a(n)=if(n<2, return(n)); my(s=1, k=1, v); while(s<n, s+=fibonacci(k+=2)); v=binary(2^k/2); n-=fibonacci(k); forstep(i=k-2, 1, -1, if(abs(n-fibonacci(-i))<abs(n), n-=fibonacci(-i); v[#v+1-i]=1; i--)); subst(Pol(v), x, 2) \\ Charles R Greathouse IV, Aug 03 2012 [Caution: returns wrong values for some values of n > 15. Amiram Eldar, Oct 15 2019]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|