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 A327189 #13 Aug 26 2019 16:29:20 %S A327189 0,1,1,2,1,2,3,4,1,2,3,4,3,4,5,6,1,2,3,4,5,6,7,8,3,4,5,6,7,8,9,10,1,2, %T A327189 3,4,5,6,7,8,5,6,7,8,9,10,11,12,3,4,5,6,7,8,9,10,7,8,9,10,11,12,13,14, %U A327189 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,5 %N A327189 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of x + y. %H A327189 Rémy Sigrist, <a href="/A327189/b327189.txt">Table of n, a(n) for n = 0..8192</a> %F A327189 a(n) = 1 iff n is a power of 2. %F A327189 a(n) = 2 iff n = 2^k + 1 for some k > 0. %e A327189 For n=42: %e A327189 - the binary representation of 42 is "101010", %e A327189 - there are 7 ways to split it: %e A327189 - "" and "101010": x=0 and y=42: 0 + 42 = 42, %e A327189 - "1" and "01010": x=1 and y=10: 1 + 10 = 11, %e A327189 - "10" and "1010": x=2 and y=10: 2 + 10 = 12, %e A327189 - "101" and "010": x=5 and y=2: 5 + 2 = 7, %e A327189 - "1010" and "10": x=10 and y=2: 10 + 2 = 12, %e A327189 - "10101" and "0": x=21 and y=0: 21 + 0 = 21, %e A327189 - "101010" and "": x=42 and y=0: 42 + 0 = 42, %e A327189 - hence a(42) = 7. %o A327189 (PARI) a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, (fromdigits(b[1..w],2) + fromdigits(b[w+1..#b],2)))); v %Y A327189 See A327186 for other variants. %K A327189 nonn,look,base %O A327189 0,4 %A A327189 _Rémy Sigrist_, Aug 25 2019