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.

A349491 a(1)=1, a(2)=4; for n > 2, a(n) is the smallest unused positive number such that gcd(a(n-1)*n,a(n)) > 1, where a(n) != a(n-1) and a(n) != n.

Original entry on oeis.org

1, 4, 2, 6, 3, 8, 10, 5, 12, 9, 15, 14, 7, 16, 18, 20, 22, 11, 33, 21, 24, 26, 13, 27, 30, 25, 35, 32, 28, 34, 17, 36, 38, 19, 40, 39, 42, 44, 45, 46, 23, 48, 50, 52, 51, 54, 56, 49, 63, 55, 57, 58, 29, 60, 62, 31, 66, 64, 68, 65, 70, 72, 69, 74, 37, 75, 78, 76, 80, 77, 84, 81, 87
Offset: 1

Views

Author

Scott R. Shannon, Nov 19 2021

Keywords

Comments

This sequence shows similar behavior to the EKG sequence A064413. See the linked image.

Examples

			a(3) = 2 as a(2)*3 = 6, 2!=4, 2!=3, 2 is unused and gcd(6,2) > 1.
a(4) = 6 as a(3)*4 = 8, 6!=2, 6!=4, 6 is unused and gcd(8,6) > 1.
		

Crossrefs

Programs

  • Python
    from math import gcd
    terms, appears = [1], {}
    for n in range(2, 100):
        t = 2
        while not(appears.get(t) is None and gcd(terms[-1]*n, t)>1 and t!=terms[-1] and t!=n):
            t += 1
        appears[t] = True; terms.append(t);
    print(terms) # Gleb Ivanov, Nov 20 2021