OFFSET
1,2
COMMENTS
a(389) has 1002 digits. - Michael S. Branicky, Dec 21 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..388
MATHEMATICA
nmax= 11; a[1]=1; a[2]=5; kmin=1; For[n=3, n<=nmax, n++, For[k=kmin, k>0, k++, If[Mod[Prime[k], a[n-1]]==a[n-2], a[n]=Prime[k]; kmin=k; k=-1]]]; Array[a, nmax] (* Stefano Spezia, Sep 16 2022 *)
PROG
(Python)
from gmpy2 import is_prime
from itertools import count, islice
def agen(): # generator of terms
c, b = 1, 5
yield from [c, b]
for n in count(3):
a = next(c + b*i for i in count(1) if is_prime(c+b*i))
c, b = b, a
yield a
print(list(islice(agen(), 22))) # Michael S. Branicky, Dec 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Mar 04 2010
EXTENSIONS
Definition corrected by Stefano Spezia, Sep 16 2022
a(12) and beyond from Michael S. Branicky, Dec 21 2023
STATUS
approved