OFFSET
1,4
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
PROG
(Python)
from math import gcd
from itertools import count, islice
def A386487_gen(): # generator of terms
m, mset, c = 2, {2}, 3
yield from (0, 0)
for j in count(3):
for i in range(m-1, c-1, -1):
if i not in mset and gcd(i, m)>1:
yield i-j
break
else:
for i in count(max(c, m+1)):
if i not in mset and gcd(i, m)>1:
yield i-j
break
m = i
mset.add(i)
while c in mset:
mset.remove(c)
c += 1
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Sep 01 2025
STATUS
approved
