|
|
A370744
|
|
a(n) is the greatest Fibonacci number f such that f AND n = f (where AND denotes the bitwise AND operator).
|
|
2
|
|
|
0, 1, 2, 3, 0, 5, 2, 5, 8, 8, 8, 8, 8, 13, 8, 13, 0, 1, 2, 3, 0, 21, 2, 21, 8, 8, 8, 8, 8, 21, 8, 21, 0, 1, 34, 34, 0, 5, 34, 34, 8, 8, 34, 34, 8, 13, 34, 34, 0, 1, 34, 34, 0, 21, 34, 55, 8, 8, 34, 34, 8, 21, 34, 55, 0, 1, 2, 3, 0, 5, 2, 5, 8, 8, 8, 8, 8, 13
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
a(n) is the greatest Fibonacci number f <= n such that there are no carries in the base-2 addition of f and n-f.
a(n) is the greatest Fibonacci number f such that binomial(n, f) is odd. (End)
|
|
LINKS
|
|
|
FORMULA
|
a(n) <= n with equality iff n is a Fibonacci number.
|
|
MAPLE
|
Fib:= [seq(combinat:-fibonacci(n), n=0..100)]:
f:= proc(n) local m, k;
m:= ListTools:-BinaryPlace(Fib, n+1);
for k from m by -1 do
if MmaTranslator:-Mma:-BitAnd(Fib[k], n) = Fib[k] then return Fib[k] fi
od
end proc:
|
|
PROG
|
(PARI) a(n) = { my (v = 0, f); for (k = 2, oo, f = fibonacci(k); if (f > n, return (v), bitand(f, n)==f, v = f); ); }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|