login
A175207
a(1) = 1, a(2) = 5, for n >= 3, a(n) = smallest prime > a(n-1) such that a(n) mod a(n-1) = a(n-2).
3
1, 5, 11, 71, 863, 10427, 42571, 95569, 2145089, 42997349, 1292065559, 12963652939, 27219371437, 285157367309, 6870996186853, 261383012467723, 10984957519831219, 922997814678290119, 27700919397868534789, 333334030589100707587, 3361041225288875610659
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