OFFSET
0,3
COMMENTS
From Robert Israel, Mar 01 2024: (Start)
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
Rémy Sigrist, Table of n, a(n) for n = 0..10000
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:
map(f, [$0..100]); # Robert Israel, Mar 01 2024
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
Rémy Sigrist, Feb 29 2024
STATUS
approved