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.

A349492 a(1)=1, a(2)=6; for n > 2, a(n) is the smallest unused positive number such that gcd(a(n-1)+n, a(n)) > 1, gcd(a(n-1), a(n)) > 1, and gcd(n, a(n)) > 1.

Original entry on oeis.org

1, 6, 3, 42, 470, 2, 84, 4, 78, 8, 418, 10, 598, 12, 9, 30, 1598, 14, 114, 16, 222, 18, 1886, 20, 5, 310, 2022, 22, 174, 15, 186, 24, 21, 60, 25, 610, 47878, 26, 13, 1378, 246, 27, 258, 28, 438, 32, 7426, 34, 1162, 36, 33, 90, 1166, 38, 66, 40, 582, 44, 12154, 46, 13054, 48, 39, 618, 6830
Offset: 1

Views

Author

Scott R. Shannon, Nov 19 2021

Keywords

Comments

The majority of terms lie near a line of gradient 1, but some terms show extremely large jumps in value, e.g., in the first 30000 terms the largest value is a(25391) = 87893333254. It is likely all numbers eventually appear although this is unknown. In the same range, and other than a(3) = 3, there are twenty-one fixed points all between 626 to 856 inclusive. As the terms for n>30000 appear both above and below the line y = n it is possible more exist although this is unknown.

Examples

			a(3) = 3 as a(2)+3 = 9, gcd(9,3)>1, gcd(6,3)>1, gcd(3,3)>1 and 3 has not been used.
a(4) = 42 as a(3)+4 = 7, gcd(7,42)>1, gcd(3,42)>1, gcd(4,42)>1 and 42 has not been used.
a(5) = 470 as a(4)+5 = 47, gcd(47,470)>1, gcd(42,470)>1, gcd(5,470)>1 and 470 has not been used.
a(6) = 2 as a(5)+6 = 476, gcd(476,2)>1, gcd(470,2)>1, gcd(6,2)>1 and 2 has not been used.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1; a[2]=6; a[n_]:=a[n]=(k=2;While[MemberQ[Array[a,n-1],k]||GCD[a[n-1]+n,k]<=1||GCD[a[n-1],k]<=1||GCD[n,k]<=1,k++];k); Array[a,65] (* Giorgos Kalogeropoulos, Nov 20 2021 *)
  • Python
    from math import gcd
    terms, appears = [1, 6], {6:True}
    for n in range(3, 100):
        t = 2
        while not (appears.get(t) is None and gcd(terms[-1]+n, t)>1 and gcd(terms[-1], t)>1 and gcd(n, t)>1):
            t += 1
        appears[t] = True; terms.append(t)
    print(terms) # Gleb Ivanov, Nov 20 2021