cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A370744 #12 Mar 02 2024 08:00:27
%S A370744 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 A370744 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 A370744 34,34,8,21,34,55,0,1,2,3,0,5,2,5,8,8,8,8,8,13
%N A370744 a(n) is the greatest Fibonacci number f such that f AND n = f (where AND denotes the bitwise AND operator).
%C A370744 From _Robert Israel_, Mar 01 2024: (Start)
%C A370744 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 A370744 a(n) is the greatest Fibonacci number f such that binomial(n, f) is odd. (End)
%H A370744 Rémy Sigrist, <a href="/A370744/b370744.txt">Table of n, a(n) for n = 0..10000</a>
%F A370744 a(n) <= n with equality iff n is a Fibonacci number.
%p A370744 Fib:= [seq(combinat:-fibonacci(n),n=0..100)]:
%p A370744 f:= proc(n) local m,k;
%p A370744   m:= ListTools:-BinaryPlace(Fib,n+1);
%p A370744   for k from m by -1 do
%p A370744     if MmaTranslator:-Mma:-BitAnd(Fib[k],n) = Fib[k] then return Fib[k] fi
%p A370744   od
%p A370744 end proc:
%p A370744 map(f, [$0..100]); # _Robert Israel_, Mar 01 2024
%o A370744 (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 A370744 Cf. A000045, A370730.
%K A370744 nonn,base
%O A370744 0,3
%A A370744 _Rémy Sigrist_, Feb 29 2024