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.

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.

Original entry on oeis.org

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, 79, 83, 89, 25, 97, 101, 103, 107, 109, 113, 127, 12, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 14, 199, 211, 15, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1

Views

Author

M. F. Hasler and Ali Sada, Feb 15 2025

Keywords

Comments

Not the same as A381019: here we have ..., 61, 67, 71, 6, ... where there we have 61, 6, 67, 71, ...

Examples

			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.
		

Crossrefs

Cf. A381019.

Programs

  • PARI
    S=U=[1]; A381167(n)=while(#Smax(k,S[m]) || return)
    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))}