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 A117127 #20 Mar 20 2015 22:42:12 %S A117127 1,1,2,1,2,3,3,1,2,1,4,3,4,5,4,1,2,2,3,2,3,2,7,3,4,4,6,6,5,7,5,1,2,2, %T A117127 3,1,4,3,4,2,4,2,5,2,4,4,9,3,4,5,5,4,6,4,9,6,6,6,7,9,6,9,6,1,2,2,3,2, %U A117127 3,3,4,2,3,3,5,2,6,4,5,2,4,3,6,3,5,4,7,2,5,4,7,3,7,5,11,3,4,5,5,4,7,5,7,4 %N A117127 Concatenate the first n positive integers written in binary (with each integer written so the most significant 1 is on the left and the concatenated string is from left to right). a(n) is the number of times n written in binary appears in the concatenated string. %C A117127 See also A047778, concatenation of first n numbers in binary. - _Jonathan Vos Post_, Apr 21 2006 %C A117127 Note that these counts reflect the pattern overlapping case. - _Diana L. Mecum_, Aug 06 2008 %C A117127 First occurrence of n: 1, 3, 6, 11, 14, 27, 23, 107, 47, 119, 95, 111, 191, 239, 223, 1007, 767, 447, 1535, 991, 895, 959, 3519, 1791, 1983, 1919, 3583, 7159, 7871, 3839, 14327, 16063, 8063, 7679, 7935, 15839, ??, 15359, 16127, 15871, ..., ; limit of search = 25000. - _Robert G. Wilson v_, Aug 30 2008 %H A117127 Diana Mecum and Robert G. Wilson v, <a href="/A117127/b117127.txt">Table of n, a(n) for n = 1..10000</a> %e A117127 The first 13 positive integers written in binary and concatenated is %e A117127 11011100101110111100010011010101111001101. %e A117127 13 in binary, which is 1101, appears 4 times in the concatenated string, starting at positions (reading from left to right) 1, 12, 25 and 38. %e A117127 The last occurrence of 1101 is the integer 13 itself converted to binary and added to the end of the concatenated string, of course. So a(13) = 4. %p A117127 A007088 := proc(n) convert(n,base,2) ; ListTools[Reverse](%) ; end: %p A117127 A058935 := proc(n) local i,a ; if n = 0 then RETURN([0]) ; else a := [] ; for i from 1 to n do a := [op(a),op(A007088(i))] ; od: fi ; end: %p A117127 A117127 := proc(n) local a058935,strtL,endL,nL,a ; nL := A007088(n) ; a058935 := A058935(n) ; a := 0 ; for strtL from 1 to nops(a058935) do for endL from strtL to nops(a058935) do if verify[sublist]( nL, [op(strtL..endL, a058935)] ) then a := a+1 ; fi ; od: od ; RETURN(a) ; end: for n from 1 to 80 do printf("%d, ",A117127(n)) ; od: # _R. J. Mathar_, Jan 23 2008 %t A117127 a[n_] := StringCount[ ToString@ FromDigits@ Flatten@ IntegerDigits[ Range@n, 2], ToString@ FromDigits@ IntegerDigits[n, 2], Overlaps -> True]; Array[a, 105] (* _Robert G. Wilson v_, Aug 30 2008 *) %t A117127 fc[n_]:=Module[{idn2=IntegerDigits[n,2],len},len=Length[idn2];Count[ Partition[ Flatten[Table[IntegerDigits[i,2],{i,n}]],len,1],idn2]]; Array[fc,110] (* _Harvey P. Dale_, Dec 16 2011 *) %Y A117127 Cf. A007088, A030190, A058935, A047778, A141439. %K A117127 easy,nonn,base %O A117127 1,3 %A A117127 _Leroy Quet_, Apr 20 2006 %E A117127 More terms from _R. J. Mathar_, Jan 23 2008 %E A117127 Terms 81 through 2000 from _Diana L. Mecum_, Aug 06 2008