[go: up one dir, main page]

login
A286298
a(0) = 0, a(1) = 1; thereafter, a(2n) = a(n) + 1 + (n mod 2), a(2n+1) = a(n) + 2 - (n mod 2).
2
0, 1, 3, 2, 4, 5, 4, 3, 5, 6, 7, 6, 5, 6, 5, 4, 6, 7, 8, 7, 8, 9, 8, 7, 6, 7, 8, 7, 6, 7, 6, 5, 7, 8, 9, 8, 9, 10, 9, 8, 9, 10, 11, 10, 9, 10, 9, 8, 7, 8, 9, 8, 9, 10, 9, 8, 7, 8, 9, 8, 7, 8, 7, 6, 8, 9, 10, 9, 10, 11, 10, 9, 10, 11, 12, 11, 10, 11, 10, 9, 10, 11, 12, 11, 12, 13, 12, 11, 10, 11, 12
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
Danielle Cox and K. McLellan, A problem on generation sets containing Fibonacci numbers, Fib. Quart., 55 (No. 2, 2017), 105-113.
FORMULA
a(n) = A005811(n) + A000523(n) for n >= 1. - Karyn McLellan, Aug 16 2018
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
Cf. A000523, A005811, A286299 (first differences).
Sequence in context: A021759 A070221 A020814 * A128440 A063201 A173258
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 02 2017
STATUS
approved