OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..48
MATHEMATICA
r = -1; s = Import["https://oeis.org/A386482/b386482.txt", "Data"][[All, -1]]; Reap[Do[If[# > r, r = #; Sow[n]] &[s[[n]] - n], {n, Length[s]}] ][[-1, 1]] (* Michael De Vlieger, Sep 01 2025 *)
PROG
(Python)
from math import gcd
from itertools import count, islice
def A387519_gen(): # generator of terms
m, mset, c, a = 2, {2}, 3, 0
yield 1
for j in count(3):
for i in range(m-1, c-1, -1):
if i not in mset and gcd(i, m)>1:
if i-j>a:
yield j
a = i-j
break
else:
for i in count(max(c, m+1)):
if i not in mset and gcd(i, m)>1:
if i-j>a:
yield j
a = i-j
break
m = i
mset.add(i)
while c in mset:
mset.remove(c)
c += 1
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 01 2025
EXTENSIONS
More terms from Michael De Vlieger, Sep 01 2025
a(40)-a(45) from Chai Wah Wu, Sep 11 2025
STATUS
approved
