login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053582 a(n+1) is the smallest prime ending with a(n), where a(1)=1. 16
1, 11, 211, 4211, 34211, 234211, 4234211, 154234211, 3154234211, 93154234211, 2093154234211, 42093154234211, 342093154234211, 11342093154234211, 3111342093154234211, 63111342093154234211, 2463111342093154234211, 232463111342093154234211 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
The least prime ending with seed 1 is 11; the least prime ending with 11 is 211; the least prime ending with 211 is 4211. - Clark Kimberling, Sep 17 2015
MAPLE
R:= 1: v:= 1:
for iter from 1 to 30 do
d:= ilog10(v)+1;
for x from v+10^d by 10^d do
if isprime(x) then R:= R, x; v:= x; break fi
od
od:
R; # Robert Israel, Sep 24 2020
MATHEMATICA
f[n_] := f[n] = Block[{j = f[n - 1], k = 1, l = Floor[Log[10, f[n - 1]] + 1]}, While[m = k*10^l + j; ! PrimeQ@ m, k++ ]; m]; f[1] = 1; Array[f, 17]
nxt[n_]:=Module[{k=1, p=10^IntegerLength[n]}, While[!PrimeQ[k*p+n], k++]; k*p+n]; NestList[nxt, 1, 20] (* Harvey P. Dale, Jul 14 2016 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(an=1): # generator of terms
while True:
yield an
pow10 = 10**len(str(an))
for t in count(pow10+an, step=pow10):
if isprime(t):
an = t
break
print(list(islice(agen(), 18))) # Michael S. Branicky, Jun 23 2022
CROSSREFS
Sequence in context: A249604 A038399 A053547 * A077714 A089567 A110747
KEYWORD
base,nonn
AUTHOR
G. L. Honaker, Jr., Jan 18 2000
EXTENSIONS
a(14)-a(17) corrected by Robert G. Wilson v, Dec 07 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 22:02 EDT 2024. Contains 371767 sequences. (Running on oeis4.)