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 A381167 #16 Feb 15 2025 23:43:35 %S A381167 1,2,3,5,7,11,4,13,17,19,23,29,9,31,37,8,41,43,47,53,59,61,67,71,6,73, %T A381167 79,83,89,25,97,101,103,107,109,113,127,12,131,137,139,149,151,157, %U A381167 163,167,173,179,181,191,193,197,14,199,211,15,223,227,229,233,239,241,251,257,263,269,271,277 %N A381167 Each term is the least positive integer not appearing earlier such that gcd(a(m),a(n)) = 1 or |m-n| > max(a(m),a(n)) for all m <> n. %C A381167 Not the same as A381019: here we have ..., 61, 67, 71, 6, ... where there we have 61, 6, 67, 71, ... %H A381167 Daniel Mondot, <a href="/A381167/b381167.txt">Table of n, a(n) for n = 1..10000</a> (first 68 entries from M. F. Hasler). %e A381167 The number a(25) = 6 shares a factor with a(16) = 8, and therefore must be at "distance" > 8 (i.e., separated by 8 relatively prime terms) from a(16). This is the first example where the smaller of two terms sharing a common factor occurs after the larger one. %o A381167 (PARI) %o A381167 S=U=[1]; A381167(n)=while(#S<n, S=concat(S,next_term())); S[n] %o A381167 ok(k)=my(n=#S+1); !for(m=2,#S, gcd(k,S[m])==1 || n-m>max(k,S[m]) || return) %o A381167 next_term()={S[#S]>U[1]&& U=setunion(U,[S[#S]]); while(#U>1&&U[2]==U[1]+1, U=U[^1]); for(k=U[1]+1,oo, !setsearch(U, k) && ok(k) && return(k))} %Y A381167 Cf. A381019. %K A381167 nonn %O A381167 1,2 %A A381167 _M. F. Hasler_ and _Ali Sada_, Feb 15 2025