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.

A374355 a(n) is the least fibbinary number f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

This page as a plain text file.
%I A374355 #11 Jul 09 2024 02:21:30
%S A374355 0,0,0,1,0,0,2,2,0,0,0,1,4,4,4,5,0,0,0,1,0,0,2,2,8,8,8,9,8,8,10,10,0,
%T A374355 0,0,1,0,0,2,2,0,0,0,1,4,4,4,5,16,16,16,17,16,16,18,18,16,16,16,17,20,
%U A374355 20,20,21,0,0,0,1,0,0,2,2,0,0,0,1,4,4,4,5,0
%N A374355 a(n) is the least fibbinary number f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).
%C A374355 To compute a(n): replace every other bit with zero (starting with the first bit) in each run of consecutive 1's in the binary expansion of n.
%H A374355 Rémy Sigrist, <a href="/A374355/b374355.txt">Table of n, a(n) for n = 0..8191</a>
%H A374355 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A374355 a(n) = A374354(n, 0).
%F A374355 a(n) = n - A374356(n).
%F A374355 a(n) >= 0 with equality iff n is a fibbinary number.
%e A374355 The first terms, in binary and in decimal, are:
%e A374355   n   a(n)  bin(n)  bin(a(n))
%e A374355   --  ----  ------  ---------
%e A374355    0     0       0          0
%e A374355    1     0       1          0
%e A374355    2     0      10          0
%e A374355    3     1      11          1
%e A374355    4     0     100          0
%e A374355    5     0     101          0
%e A374355    6     2     110         10
%e A374355    7     2     111         10
%e A374355    8     0    1000          0
%e A374355    9     0    1001          0
%e A374355   10     0    1010          0
%e A374355   11     1    1011          1
%e A374355   12     4    1100        100
%e A374355   13     4    1101        100
%e A374355   14     4    1110        100
%e A374355   15     5    1111        101
%e A374355   16     0   10000          0
%o A374355 (PARI) a(n) = { my (v = 0, e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], v += y; break;););); return (v); }
%Y A374355 Cf. A003714, A374354, A374356.
%K A374355 nonn,base
%O A374355 0,7
%A A374355 _Rémy Sigrist_, Jul 06 2024