|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|