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 A030317 #24 Jul 22 2025 16:28:29 %S A030317 1,1,1,1,0,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,1,0,0,1, %T A030317 1,1,0,1,0,1,1,0,1,1,1,1,1,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0, %U A030317 0,0,1,1,0,0,0,1,1,1,0,0,1,0,1,1,0,0,1,1,1,1 %N A030317 Write the odd numbers 2n - 1 in base 2 and juxtapose these binary expansions; read the result bit-by-bit. %e A030317 1 in binary is 1. %e A030317 3 in binary is 11. %e A030317 5 in binary is 101. %e A030317 7 in binary is 111. %e A030317 9 in binary is 1001. %e A030317 Putting those together, we obtain 1111011111001. Then, splitting bit by bit, we get 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, the beginning of this sequence. %p A030317 twon := 1 : %p A030317 dig := 1: %p A030317 A030317 := proc() %p A030317 global twon,dig ; %p A030317 local a,dgs; %p A030317 dgs := convert(twon,base,2) ; %p A030317 a := op(-dig,%) ; %p A030317 if dig = nops(dgs) then %p A030317 twon := twon+2 ; %p A030317 dig :=1 ; %p A030317 else %p A030317 dig := dig+1 ; %p A030317 end if; %p A030317 return a; %p A030317 end proc: %p A030317 seq(A030317(),n=1..100) ; # _R. J. Mathar_, Jul 22 2025 %t A030317 Flatten[Table[IntegerDigits[2n - 1, 2], {n, 50}]] (* _Harvey P. Dale_, Aug 06 2013 *) %o A030317 (Scala) (1 to 31 by 2).map(Integer.toString(_, 2)).mkString.split("").map(Integer.parseInt(_)).toList // _Alonso del Arte_, Feb 10 2020 %Y A030317 Cf. A099821 (odd positive integers in base 2). %K A030317 nonn,base,easy %O A030317 1,1 %A A030317 _Clark Kimberling_