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 A332929 #19 Sep 18 2021 18:55:21 %S A332929 3,1,2,1,2,18,1,13,8,2,21,18,1,17,16,13,8,27,2,62,25,21,18,93,49,1,20, %T A332929 17,95,16,15,13,97,8,27,45,2,128,62,146,25,60,21,395,229,18,93,209,49, %U A332929 65,1,78,42,20,17,105,95,116,186,16,175,15,14,13,97,110 %N A332929 Position where the binary expansion of n occurs for the first time in the binary expansion of Pi. %H A332929 Harvey P. Dale, <a href="/A332929/b332929.txt">Table of n, a(n) for n = 0..1000</a> %e A332929 In binary, Pi = 11.00100100.... The bitstring 10 (for 2) occurs at position 2, so a(2) = 2. %t A332929 p = RealDigits[Pi,2,500][[1]]; L = {}; Do[t = SequencePosition[p, IntegerDigits[n, 2], 1]; If[t == {}, Break[], AppendTo[L, t[[1, 1]]]], {n, 0, 65}]; L (* _Giovanni Resta_, Mar 16 2020 *) %t A332929 Module[{nn=500,bp},bp=RealDigits[Pi,2,nn][[1]];Table[ SequencePosition[ bp,IntegerDigits[n,2],1][[All,1]],{n,0,70}]]//Flatten (* _Harvey P. Dale_, Sep 18 2021 *) %o A332929 (Perl) %o A332929 #! /usr/bin/perl %o A332929 # Feed b004601.txt to this to get the binary digits of Pi. %o A332929 while (<>) { %o A332929 chomp; %o A332929 (undef, $d[$n++]) = split(" "); %o A332929 } %o A332929 $pi = join("",@d); %o A332929 $k = 0; %o A332929 while (1) { %o A332929 last if ($pos = index($pi, sprintf("%b", $k++))) < 0; %o A332929 $out .= $pos +2 . ", "; %o A332929 } %o A332929 print $out,"\n"; %Y A332929 Cf. A004601, A014777, A178707. %Y A332929 Cf. A032445 (for decimal expansion rather than binary). %K A332929 nonn,base,easy %O A332929 0,1 %A A332929 _Thomas König_, Mar 02 2020