login
Minimal nested palindromic primes with seed 111111111.
2

%I #10 Oct 02 2015 13:09:00

%S 111111111,1311111111131,31131111111113113,3311311111111131133,

%T 333113111111111311333,3033311311111111131133303,

%U 1323033311311111111131133303231,313230333113111111111311333032313,9531323033311311111111131133303231359

%N Minimal nested palindromic primes with seed 111111111.

%C Let s be a palindrome and put a(1) = s. Let a(2) be the least palindromic prime having s in the middle; for n > 2, let a(n) be the least palindromic prime having a(n-1) in the middle. Then (a(n)) is the sequence of minimal nested palindromic primes with seed s.

%H Clark Kimberling, <a href="/A262499/b262499.txt">Table of n, a(n) for n = 1..200</a>

%e As a triangle:

%e 111111111

%e 1311111111131

%e 31131111111113113

%e 3311311111111131133

%e 333113111111111311333

%e 3033311311111111131133303

%e 1323033311311111111131133303231

%e 313230333113111111111311333032313

%t s0 = "111111111"; s = {ToExpression[s0]};Do[NestWhile[# + 1 &, 1, ! PrimeQ[tmp = FromDigits[Join[#, IntegerDigits[Last[s], 10, Max[StringLength[s0],Length[IntegerDigits[Last[s]]]]], Reverse[#]]&[IntegerDigits[#]]]] &]; AppendTo[s, tmp], {10}]; s0 <> ", " <> StringTake[ToString[Rest[s]], {2, -2}]

%t (* _Peter J. C. Moses_, Sep 23 2015 *)

%Y Cf. A261881.

%K nonn,base,easy

%O 1,1

%A _Clark Kimberling_, Sep 24 2015