Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #15 Jun 07 2014 10:01:28
%S 11,13,31,113,311,1117,7121,11113,31121,111119,911111,1111151,1111157,
%T 7111123,31111121,111111113,311111131,1111111121,1111111139,
%U 9111111127,71111111147,71111111243,311111111111,1111111111139,9111111111211
%N Start with the prime 11; next prime must exceed previous prime, contain no 0's and start with last digit of previous prime.
%H C. Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_045.htm">Puzzle 45 - Prime Solitaire</a>
%e a(4)=113, so a(5)=311 because a(5) must be greater than a(4) and have no zero digit and the last digit, 3, of 113 must link to the first digit, 3, of 311.
%o (PARI) nxtprm(fp) = {fd = digits(fp); ld = fd[#fd]; forprime(p = fp+1, , nd = digits(p); if ((nd[1] == ld) && (vecmin(nd) != 0), return (p)));}
%o lista(nn) = {fp = 1; for (n=1, nn, np = nxtprm(fp); print1(np, ", "); fp = np;);} \\ _Michel Marcus_, Jun 06 2014
%Y Cf. A054262 (similar sequence without the 0 digit condition).
%K easy,nonn,base
%O 0,1
%A _Enoch Haga_, Feb 18 2000
%E More terms from _Patrick De Geest_, Feb 15 2000