cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A387542 a(n) is the distance from the n-th term of A386482 to the nearest term of A386482 coprime to it.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Sep 01 2025

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A386482.

Programs

  • PARI
    \\ See Links section.