OFFSET
1,1
COMMENTS
a(n+1) is the next smallest prime beginning with a(n). Initial term is 8. After a(1), these are the primes arising in A069610.
EXAMPLE
a(1) = 8 by definition.
a(2) is the next smallest prime beginning with 8, so a(2) = 83.
a(3) is the next smallest prime beginning with 83, so a(3) = 839.
MATHEMATICA
smp[n_]:=Module[{k=1}, While[!PrimeQ[n*10^IntegerLength[k]+k], k++]; n 10^IntegerLength[k]+ k]; NestList[smp, 8, 15] (* Harvey P. Dale, Aug 10 2024 *)
PROG
(Python)
import sympy
from sympy import isprime
def b(x):
..num = str(x)
..n = 1
..while n < 10**3:
....new_num = str(x) + str(n)
....if isprime(int(new_num)):
......print(int(new_num))
......x = new_num
......n = 1
....else:
......n += 1
b(8)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jan 29 2014
STATUS
approved