OFFSET
1,1
COMMENTS
Using only base-5 digits 0,1,2,3,4, 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 have a(n-1) in the middle. Then (a(n)) is the sequence of minimal nested palindromic base-5 primes with seed s.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..300
EXAMPLE
a(3) = 31313 is the least base-5 prime having a(2) = 131 in its middle.
Triangular format:
3
131
31313
1313131
413131314
2341313131432
MATHEMATICA
s = {3}; base = 5; z = 20; Do[NestWhile[# + 1 &, 1, ! PrimeQ[tmp = FromDigits[Join[#, IntegerDigits[Last[s]], Reverse[#]] &[IntegerDigits[#, base]], base]] &];
AppendTo[s, FromDigits[IntegerDigits[tmp, base]]], {z}]; s (* A262643 *)
Map[FromDigits[ToString[#], base] &, s] (* A262644 *)
(* Peter J. C. Moses, Sep 01 2015 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Oct 24 2015
STATUS
approved