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.
%I A387542 #7 Sep 02 2025 14:10:33 %S A387542 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, %T A387542 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, %U A387542 3,2,2,2,2,2,2,2,2,2,2,3,5,5,6,8,8,9,11 %N A387542 a(n) is the distance from the n-th term of A386482 to the nearest term of A386482 coprime to it. %C A387542 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. %C A387542 The sequence is well defined as A386482(1) = 1 is coprime to all terms of A386482. %H A387542 Rémy Sigrist, <a href="/A387542/b387542.txt">Table of n, a(n) for n = 1..10000</a> %H A387542 Rémy Sigrist, <a href="/A387542/a387542.gp.txt">PARI program</a> %e A387542 For n = 7: the GCD of A386482(7) = 12 and its neighboring terms are: %e A387542 d A387542(7+d) gcd(A387542(7), A387542(7+d)) %e A387542 -- ------------ ----------------------------- %e A387542 -4 4 4 %e A387542 -3 6 6 %e A387542 -2 3 3 %e A387542 -1 9 3 %e A387542 0 12 12 %e A387542 1 10 2 %e A387542 2 8 4 %e A387542 3 14 2 %e A387542 4 7 1 %e A387542 The nearest coprime term, A387542(11) = 7, is at distance 4, so a(7) = 4. %o A387542 (PARI) \\ See Links section. %Y A387542 Cf. A386482. %K A387542 nonn,new %O A387542 1,3 %A A387542 _Rémy Sigrist_, Sep 01 2025