OFFSET
0,3
COMMENTS
Let S be a set containing 0 and let S grow in generations G(i), defined by these rules: If x is in S then 2x is in S and 1 - x is in S. So G(0) = 0, G(1) = {1}, G(2) = {2}, G(3) = {-1,4}, ... Then a(n) is the generation containing the integer k where n = 2k - 1 for k>0 and -2k for k <= 0. The question posed by Clark Kimberling was "Does each generation contain a Fibonacci number or its negative?" It has been proved that every integer occurs in some G(i). - Karyn McLellan, Aug 16 2018
REFERENCES
C. Kimberling, Problem proposals, Proceedings of the Sixteenth International Conference on Fibonacci Numbers and Their Applications, P. Anderson, C. Ballot and W. Webb, eds. The Fibonacci Quarterly, 52.5(2014), 5-14.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..10000
Danielle Cox and K. McLellan, A problem on generation sets containing Fibonacci numbers, Fib. Quart., 55 (No. 2, 2017), 105-113.
FORMULA
EXAMPLE
For k = -5, n = 10 and f(10) = 7, so -5 first appears in G(7). - Karyn McLellan, Aug 16 20 18
MAPLE
f:=proc(n) option remember;
if n <= 1 then n
elif (n mod 2) = 0 then f(n/2)+1+((n/2) mod 2);
else f((n-1)/2) + 2 - ((n-1)/2 mod 2); end if;
end proc;
[seq(f(n), n=0..120)];
PROG
(Python)
def A286298(n):
if n <= 1:
return n
a, b = divmod(n, 2)
return A286298(a) + 1 + b + (-1)**b*(a % 2) # Chai Wah Wu, Jun 02 2017
(PARI) a(n) = if (n==0, 0, logint(n, 2) + hammingweight(bitxor(n, n>>1))); \\ Michel Marcus, Aug 21 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 02 2017
STATUS
approved