OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..300
MAPLE
R:= 5: p:= 5: x:= 5:
for count from 2 to 100 do
for y from x by 2 do
if isprime(10^(1+ilog10(y))*p+y) then
R:= R, y; p:= 10^(1+ilog10(y))*p+y; x:= y;
break
fi
od od:
R; # Robert Israel, Nov 22 2020
MATHEMATICA
a[1] = 5; a[n_] := a[n] = Block[{k = a[n - 1], c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits @ Flatten @ Append[c, IntegerDigits[k]]], k += 2]; k]; Table[ a[n], {n, 49}] (* Robert G. Wilson v, Aug 05 2005 *)
PROG
(Python)
from sympy import isprime
def aupton(terms):
alst, astr = [5], "5"
while len(alst) < terms:
an = alst[-1]
while an%5 ==0 or not isprime(int(astr + str(an))): an += 2
alst, astr = alst + [an], astr + str(an)
return alst
print(aupton(49)) # Michael S. Branicky, May 09 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, May 15 1998
STATUS
approved