login
a(n+1) is the smallest prime ending with a(n), where a(1)=7.
5

%I #14 Jun 23 2022 13:49:59

%S 7,17,317,6317,26317,126317,2126317,72126317,372126317,5372126317,

%T 125372126317,15125372126317,415125372126317,23415125372126317,

%U 2223415125372126317,152223415125372126317,21152223415125372126317,4221152223415125372126317

%N a(n+1) is the smallest prime ending with a(n), where a(1)=7.

%H Michael S. Branicky, <a href="/A053584/b053584.txt">Table of n, a(n) for n = 1..372</a>

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice

%o def agen(an=7):

%o while True:

%o yield an

%o pow10 = 10**len(str(an))

%o for t in count(pow10+an, step=pow10):

%o if isprime(t):

%o an = t

%o break

%o print(list(islice(agen(), 18))) # _Michael S. Branicky_, Jun 23 2022

%Y Cf. A000040, A053582, A053583, A069612.

%K base,nonn

%O 1,1

%A _G. L. Honaker, Jr._, Jan 18 2000