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 A168588 #6 Feb 01 2021 13:21:51 %S A168588 0,101,0,1011001,10000110011,0,10000000010101111,1000000000001111111, %T A168588 0,10000000000000000101101111101,1000000000000000000011111110111,0, %U A168588 10000000000000000000000000011111111110101,1000000000000000000000000000110111111011111 %N A168588 Smallest p(n)-digit prime with digit sum n, and made up of digits 0 and 1 only, where p(n)=A000040(n) (or 0, if no such prime exists). %C A168588 a(3n) = 0. %H A168588 Robert Israel, <a href="/A168588/b168588.txt">Table of n, a(n) for n = 1..168</a> %p A168588 g:= proc(L) local i,m; %p A168588 m:= -1; %p A168588 for i from 1 do %p A168588 if L[i] = 1 then %p A168588 if m = -1 then m:= i fi; %p A168588 if L[i+1] = 0 then %p A168588 return [1$(i-m),0$(m-1),0,1,op(L[i+2..-1])] %p A168588 fi %p A168588 fi %p A168588 od %p A168588 end proc: %p A168588 f:= proc(n) local L,x,pn,i; %p A168588 if n mod 3 = 0 then return 0 fi; %p A168588 pn:= ithprime(n); %p A168588 L:= [1$(n-1),0$(pn-n),1]; %p A168588 do %p A168588 x:= add(L[i]*10^(i-1),i=1..pn); %p A168588 if isprime(x) then return x fi; %p A168588 L:= g(L); %p A168588 od %p A168588 end proc: %p A168588 map(f, [$1..16]); # _Robert Israel_, Feb 01 2021 %Y A168588 Cf. A036929 %K A168588 nonn,base %O A168588 1,2 %A A168588 _Lekraj Beedassy_, Nov 30 2009 %E A168588 Extended by _Ray Chandler_, Dec 03 2009