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 A302295 #8 Apr 07 2018 03:56:39 %S A302295 1,1,2,1,3,2,3,1,4,3,2,4,4,4,4,1,5,4,3,5,5,2,5,5,5,5,5,3,5,5,5,1,6,5, %T A302295 4,6,3,6,6,6,6,6,2,6,6,3,6,6,6,6,6,4,6,6,3,6,6,6,6,6,6,6,6,1,7,6,5,7, %U A302295 4,7,7,7,7,3,7,7,7,7,7,7,7,7,7,7,7,2,7 %N A302295 a(n) is the period of the binary expansion of n (with leading zeros allowed). %C A302295 Equivalently, a(n) is the least positive k such that n is a repdigit number in base 2^k. %C A302295 See A302291 for the variant where leading zeros are not allowed. %H A302295 Rémy Sigrist, <a href="/A302295/b302295.txt">Table of n, a(n) for n = 0..10000</a> %H A302295 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A302295 a(2^n) = n + 1 for any n >= 0. %F A302295 a(2^n - 1) = 1 for any n >= 0. %F A302295 a(n) <= A302291(n). %F A302295 A059711(n) <= 2^a(n). %e A302295 The first terms, alongside the binary expansion of n with periodic part in parentheses, are: %e A302295 n a(n) bin(n) %e A302295 -- ---- ------ %e A302295 0 1 (0) %e A302295 1 1 (1) %e A302295 2 2 (10) %e A302295 3 1 (1)(1) %e A302295 4 3 (100) %e A302295 5 2 (01)(01) %e A302295 6 3 (110) %e A302295 7 1 (1)(1)(1) %e A302295 8 4 (1000) %e A302295 9 3 (001)(001) %e A302295 10 2 (10)(10) %e A302295 11 4 (1011) %e A302295 12 4 (1100) %e A302295 13 4 (1101) %e A302295 14 4 (1110) %e A302295 15 1 (1)(1)(1)(1) %e A302295 16 5 (10000) %e A302295 17 4 (0001)(0001) %e A302295 18 3 (10)(10) %e A302295 19 5 (10011) %e A302295 20 5 (10100) %o A302295 (PARI) a(n) = for (k=1, oo, if (#Set(digits(n, 2^k))<=1, return (k))) %Y A302295 Cf. A059711, A302291. %K A302295 nonn,base,easy %O A302295 0,3 %A A302295 _Rémy Sigrist_, Apr 04 2018