login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A370731
a(n) is the least k >= 0 such that F(k) AND n = n (where F(k) denotes A000045(k), the k-th Fibonacci number and AND denotes the bitwise AND operator).
2
0, 1, 3, 4, 5, 5, 10, 10, 6, 7, 16, 16, 7, 7, 22, 22, 8, 8, 10, 10, 8, 8, 10, 10, 11, 11, 16, 16, 17, 17, 46, 46, 9, 10, 9, 10, 10, 10, 10, 10, 13, 13, 22, 22, 17, 17, 22, 22, 10, 10, 10, 10, 10, 10, 10, 10, 14, 14, 64, 64, 17, 17, 94, 94, 11, 11, 15, 16, 19
OFFSET
0,3
COMMENTS
This sequence is well defined (see Comments in A370730).
FORMULA
a(A000045(k)) = k for any k != 2.
MATHEMATICA
A370731[n_] := Block[{k = -1}, While[BitAnd[Fibonacci[++k], n] != n]; k];
Array[A370731, 100, 0] (* Paolo Xausa, Mar 01 2024 *)
PROG
(PARI) a(n) = { for (k = 0, oo, if (bitand(fibonacci(k), n)==n, return (k); ); ); }
CROSSREFS
Sequence in context: A278168 A130271 A139369 * A151555 A263728 A370760
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 28 2024
STATUS
approved