OFFSET
0,2
REFERENCES
Donald E. Knuth, The Art of Computer Programming, Volume 1, Fundamental Algorithms. Third Edition, Addison-Wesley, 1997. Chapter 1.2.8, exercise 34, page 86, introduces the Fibonacci number system first described by E. Zeckendorf, see answer page 495.
Donald E. Knuth, The Art of Computer Programming, Volume 4A, Combinatorial Algorithms Part 1. Pearson Education, 2011. Chapter 7.1.3, exercise 158, page 196, asks for a method to increment Fibonacci codewords with answer on page 607.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
MATHEMATICA
A396674[n_] := BitOr[n, BitAnd[#, BitNot[#+1]]] + 1 & [BitOr[n, BitShiftRight[n]]];
Array[A396674, 100, 0] (* Paolo Xausa, Jun 08 2026, after PARI *)
PROG
(PARI) a396674(x) = my(y=bitor(x, x>>1), z=bitand(y, bitneg(y+1))); bitor(x, z)+1
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Jun 08 2026
STATUS
approved
