The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A370744 a(n) is the greatest Fibonacci number f such that f AND n = f (where AND denotes the bitwise AND operator). 2

%I #12 Mar 02 2024 08:00:27

%S 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,

%T 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,

%U 34,34,8,21,34,55,0,1,2,3,0,5,2,5,8,8,8,8,8,13

%N a(n) is the greatest Fibonacci number f such that f AND n = f (where AND denotes the bitwise AND operator).

%C From _Robert Israel_, Mar 01 2024: (Start)

%C 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.

%C a(n) is the greatest Fibonacci number f such that binomial(n, f) is odd. (End)

%H Rémy Sigrist, <a href="/A370744/b370744.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) <= n with equality iff n is a Fibonacci number.

%p Fib:= [seq(combinat:-fibonacci(n),n=0..100)]:

%p f:= proc(n) local m,k;

%p m:= ListTools:-BinaryPlace(Fib,n+1);

%p for k from m by -1 do

%p if MmaTranslator:-Mma:-BitAnd(Fib[k],n) = Fib[k] then return Fib[k] fi

%p od

%p end proc:

%p map(f, [$0..100]); # _Robert Israel_, Mar 01 2024

%o (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);); }

%Y Cf. A000045, A370730.

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Feb 29 2024

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 18 01:23 EDT 2024. Contains 372608 sequences. (Running on oeis4.)