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 A300654 #8 Mar 11 2018 17:17:38 %S A300654 2,2,2,2,4,2,2,2,4,4,8,2,9,2,2,2,4,4,16,4,4,8,6,2,8,9,11,2,20,2,2,2,4, %T A300654 4,8,4,32,16,6,4,4,4,8,8,6,6,12,2,12,8,2,9,33,11,10,2,8,20,37,2,41,2, %U A300654 2,2,4,4,64,4,14,8,14,4,4,32,11,16,17,6,22,4 %N A300654 a(n) is the greatest k such that, for i = 1..k, the binary representation of i appears as a substring in the binary representation of 1/n (ignoring the radix point and adding trailing zeros if necessary in case of a terminating expansion). %C A300654 Equivalently, a(n) is the greatest k such that A300653(n, k) = k. %C A300654 This sequence has similarities with A144016: here we consider the binary expansion of 1/n, there the binary expansion of n. %H A300654 Rémy Sigrist, <a href="/A300654/a300654.gp.txt">PARI program for A300654</a> %F A300654 a(2*n) = a(n). %F A300654 a(n) = 2 iff n belongs to A300630. %e A300654 For n = 19: %e A300654 - the binary expansion of 1/19 is 0.0000(110101111001010000) (with repeating digits in parentheses), %e A300654 - the first occurrence of the binary representation of k for k = 1..16 is: %e A300654 k bin(k) bin(1/19) with bin(k) in parentheses %e A300654 -- ------ ------------------------------------ %e A300654 1 1 0.0000(1)101... %e A300654 2 10 0.00001(10)101... %e A300654 3 11 0.0000(11)010... %e A300654 4 100 0.000011010111(100)101... %e A300654 5 101 0.00001(101)011... %e A300654 6 110 0.0000(110)101... %e A300654 7 111 0.000011010(111)100... %e A300654 8 1000 0.00001101011110010(1000)011... %e A300654 9 1001 0.000011010111(1001)010... %e A300654 10 1010 0.00001(1010)111... %e A300654 11 1011 0.0000110(1011)110... %e A300654 12 1100 0.00001101011(1100)101... %e A300654 13 1101 0.0000(1101)011... %e A300654 14 1110 0.0000110101(1110)010... %e A300654 15 1111 0.000011010(1111)001... %e A300654 16 10000 0.00001101011110010(10000)110... %e A300654 - the binary representation of 17 (10001) is missing, %e A300654 - hence a(19) = 16. %o A300654 (PARI) See Links section. %Y A300654 Cf. A144016, A300653, A300630. %K A300654 nonn,base %O A300654 1,1 %A A300654 _Rémy Sigrist_, Mar 10 2018