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).

Original entry on oeis.org

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
Offset: 0

Views

Author

Rémy Sigrist, Feb 29 2024

Keywords

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)

Crossrefs

Programs

  • 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
  • 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);); }

Formula

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