login
A387542
a(n) is the distance from the n-th term of A386482 to the nearest term of A386482 coprime to it.
2
0, 1, 2, 3, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 4, 2, 2, 2, 2, 3, 5, 4, 3, 5, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 4, 2, 2, 2, 2, 3, 5, 5, 6, 5, 4, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 5, 5, 6, 8, 8, 9, 11
OFFSET
1,3
COMMENTS
In other words: a(n) is the least d >= 0 such that gcd(A386482(n), A386482(n - d)) = 1 or gcd(A386482(n), A386482(n + d)) = 1.
The sequence is well defined as A386482(1) = 1 is coprime to all terms of A386482.
LINKS
Rémy Sigrist, PARI program
EXAMPLE
For n = 7: the GCD of A386482(7) = 12 and its neighboring terms are:
d A387542(7+d) gcd(A387542(7), A387542(7+d))
-- ------------ -----------------------------
-4 4 4
-3 6 6
-2 3 3
-1 9 3
0 12 12
1 10 2
2 8 4
3 14 2
4 7 1
The nearest coprime term, A387542(11) = 7, is at distance 4, so a(7) = 4.
PROG
(PARI) \\ See Links section.
CROSSREFS
Cf. A386482.
Sequence in context: A368713 A375341 A368039 * A382969 A393085 A160558
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Sep 01 2025
STATUS
approved