login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359483
For n > 2, a(n) is the least prime p > a(n-1) such that a(n-1) + p is divisible by a(n-2); a(1) = 2, a(2) = 3.
1
2, 3, 5, 7, 13, 29, 101, 131, 677, 2467, 5657, 19013, 48871, 521519, 553643, 3618509, 14098067, 116168257, 193989217, 1200029867, 8887409417, 12713128189, 573855893333, 773735694701, 9555670385293, 30678585739159, 160434821966701, 1312137293512931, 2217428789754491, 100129280104254127
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 5 because 5 is prime and a(2) + 5 = 8 is divisible by a(1) = 2.
a(4) = 7 because 7 is prime and a(3) + 7 = 12 is divisible by a(2) = 3.
a(5) = 13 because 13 is prime and a(4) + 13 = 20 is divisible by a(3) = 5.
MAPLE
p:= 2: q:= 3: R:= p, q: t:= 3: count:= 2:
while count < 40 do
t:= t + p;
if isprime(t) then
R:= R, t; count:= count+1;
p:= q; q:= t;
t:= floor(2*q/p)*p-q;
fi
od:
R;
MATHEMATICA
nmax=17; a[1]=2; a[2]=3; For[n=3, n<=nmax, n++, For[k=1, k>0, k++, If[Prime[k]>a[n-1] && Mod[a[n-1]+Prime[k], a[n-2]]==0, a[n]=Prime[k]; k=-1]]]; Array[a, nmax] (* Stefano Spezia, Apr 01 2023 *)
CROSSREFS
Sequence in context: A167134 A071905 A306317 * A067573 A103199 A054217
KEYWORD
nonn
AUTHOR
Zak Seidov and Robert Israel, Mar 31 2023
STATUS
approved