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.
%I A374356 #16 Jul 13 2025 11:06:42 %S A374356 0,1,2,2,4,5,4,5,8,9,10,10,8,9,10,10,16,17,18,18,20,21,20,21,16,17,18, %T A374356 18,20,21,20,21,32,33,34,34,36,37,36,37,40,41,42,42,40,41,42,42,32,33, %U A374356 34,34,36,37,36,37,40,41,42,42,40,41,42,42,64,65,66,66 %N A374356 a(n) is the greatest 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 A374356 To compute a(n): replace every other bit with zero (starting with the second bit) in each run of consecutive 1's in the binary expansion of n. %C A374356 From _Gus Wiseman_, Jul 11 2025: (Start) %C A374356 This is the greatest binary rank of a sparse subset of the binary indices of n, where: %C A374356 1. The binary indices of a nonnegative integer are the positions of 1 in its reversed binary expansion. %C A374356 2. A set is sparse iff 1 is not a first difference. %C A374356 3. The binary rank of a set {S_1,S_2,...} is Sum_i 2^(S_i-1). %C A374356 (End) %H A374356 Rémy Sigrist, <a href="/A374356/b374356.txt">Table of n, a(n) for n = 0..8191</a> %H A374356 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A374356 a(n) = A374354(n, A277561(n)-1). %F A374356 a(n) = n - A374355(n). %F A374356 a(n) <= n with equality iff n is a fibbinary number. %e A374356 The first terms, in decimal and in binary, are: %e A374356 n a(n) bin(n) bin(a(n)) %e A374356 -- ---- ------ --------- %e A374356 0 0 0 0 %e A374356 1 1 1 1 %e A374356 2 2 10 10 %e A374356 3 2 11 10 %e A374356 4 4 100 100 %e A374356 5 5 101 101 %e A374356 6 4 110 100 %e A374356 7 5 111 101 %e A374356 8 8 1000 1000 %e A374356 9 9 1001 1001 %e A374356 10 10 1010 1010 %e A374356 11 10 1011 1010 %e A374356 12 8 1100 1000 %e A374356 13 9 1101 1001 %e A374356 14 10 1110 1010 %e A374356 15 10 1111 1010 %e A374356 16 16 10000 10000 %t A374356 bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; %t A374356 fbi[q_]:=If[q=={},0,Total[2^q]/2]; %t A374356 Table[Max@@fbi/@Select[Subsets[bpe[n]],FreeQ[Differences[#],1]&],{n,0,100}] (* _Gus Wiseman_, Jul 11 2025 *) %o A374356 (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 += x; break;););); return (v); } %Y A374356 Cf. A277561, A374354, A374355. %Y A374356 The union is A003714 (Fibbinary numbers). %Y A374356 For prime instead of binary indices we have A385216. %Y A374356 A034839 counts subsets by number of maximal runs, for strict partitions A116674. %Y A374356 A166469 counts sparse submultisets of prime indices, maximal A385215. %Y A374356 A245564 counts sparse subsets of binary indices, maximal case A384883. %Y A374356 A319630 ranks sparse submultisets of prime indices, complement A104210. %Y A374356 Cf. A000045, A000071, A001629, A006519, A010049, A044813, A119900, A202023, A202064, A268193, A384890. %K A374356 nonn,base %O A374356 0,3 %A A374356 _Rémy Sigrist_, Jul 06 2024