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.

Showing 1-6 of 6 results.

A347113 a(1)=1; for n > 1, a(n) is the smallest unused positive number k such that k != j and gcd(k,j) != 1, where j = a(n-1) + 1.

Original entry on oeis.org

1, 4, 10, 22, 46, 94, 5, 2, 6, 14, 3, 8, 12, 26, 9, 15, 18, 38, 13, 7, 16, 34, 20, 24, 30, 62, 21, 11, 27, 32, 36, 74, 25, 28, 58, 118, 17, 33, 40, 82, 166, 334, 35, 39, 42, 86, 29, 44, 48, 56, 19, 45, 23, 50, 54, 60, 122, 41, 49, 52, 106, 214, 43, 55, 63, 66
Offset: 1

Views

Author

Grant Olson, Aug 18 2021

Keywords

Comments

Alternative definition: Lexicographically earliest sequence of distinct positive numbers such that a(n) != a(n-1)+1 and gcd(a(n-1)+1,a(n)) > 1. This makes it a cousin of the EKG sequence A064413, the Yellowstone permutation A098550, the Enots Wolley sequence A336957, and others. - N. J. A. Sloane, Sep 01 2021; revised Nov 08 2021.
The successive gcd's are listed in A347309.

Examples

			a(1) = 1, by definition.
a(2) = 4; it cannot be 2, because 2 = a(1) + 1, and it cannot be 3, because gcd(a(1) + 1, 3) = 1.
a(3) = 10, because gcd(a(3), a(2) + 1) cannot equal 1. a(2) + 1 = 5, so a(3) must be a multiple of 5. It cannot be equal to 5, so it must be 10, the next available multiple of 5.
a(4) = 22, because 22 is the smallest positive integer not equal to 11 and not coprime to 11.
		

Crossrefs

See A347306 for the inverse, A347307, A347308 for the records, A347309 for the gcd values, A347312 for the parity of a(n), A347314 for the fixed points, and A348780 for partial sums.
For the main diagonal see (A348787(k), A348788(k)).

Programs

  • Maple
    b:= proc() true end:
    a:= proc(n) option remember; local j, k; j:= a(n-1)+1;
          for k from 2 do if b(k) and k<>j and igcd(k, j)>1
            then b(k):= false; return k fi od
        end: a(1):= 1:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 02 2021
  • Mathematica
    Block[{a = {1}, c, k, m = 2}, Do[If[IntegerQ@Log2[i], While[IntegerQ[c[m]], m++]]; Set[k, m]; While[Or[IntegerQ[c[k]], k == # + 1, GCD[k, # + 1] == 1], k++] &[a[[-1]]]; AppendTo[a, k]; Set[c[k], i], {i, 65}]; a] (* Michael De Vlieger, Aug 18 2021 *)
  • PARI
    find(va, x) = {my(k=1, s=Set(va)); while ((k==x) || (gcd(k, x) == 1) || setsearch(s, k), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = find(va, va[n-1]+1);); va;} \\ Michel Marcus, Aug 21 2021
    
  • Python
    from math import gcd
    A347113_list, nset, m = [1], {1}, 2
    for _ in range(100):
        j = A347113_list[-1]+1
        k = m
        while k == j or gcd(k,j) == 1 or k in nset:
            k += 1
        A347113_list.append(k)
        nset.add(k)
        while m in nset:
            m += 1 # Chai Wah Wu, Sep 01 2021

Extensions

Comments edited (including deletion of incorrect comments) by N. J. A. Sloane, Sep 05 2021
For the moment I am withdrawing my claim that this is a permutation of the positive integers. - N. J. A. Sloane, Sep 05 2022

A347756 Local minima in A347113.

Original entry on oeis.org

1, 2, 3, 7, 11, 17, 19, 23, 31, 37, 59, 61, 67, 79, 97, 151, 157, 199, 211, 229, 271, 307, 337, 367, 499, 577, 601, 619, 691, 727, 829, 877, 937, 1009, 1237, 1279, 1297, 1399, 1459, 1531, 1609, 1657, 1867, 2011, 2029, 2089, 2131, 2137, 2179, 2281, 2311, 2467, 2539
Offset: 1

Views

Author

Michael De Vlieger, Sep 12 2021

Keywords

Comments

Distinct terms in A347755.
Conjecture: subset of A008578.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 2^13, a = {1}, c, k, m, u = 2, v}, v = a; Map[Set[c[#], 1] &, Union@ a]; Do[Set[k, u]; If[PrimeQ[#], m = 2; While[IntegerQ[c[m #]], m++]; k = m #, While[Or[IntegerQ[c[k]], k == #, GCD[k, #] == 1], k++]] &[a[[-1]] + 1]; AppendTo[a, k]; Set[c[k], 1]; AppendTo[v, u]; If[k == u, While[IntegerQ[c[u]], u++]], nn]; Union@ v]
    (* or using A347113 bfile: *)
    Block[{a, u = {1}, v = 1}, a = Import["https://oeis.org/A347113/b347113.txt", "Data"][[All, -1]]; Do[If[a[[i]] == v, While[! FreeQ[a[[1 ;; i]], v], v++]]; AppendTo[u, v], {i, Length[a]}];  Union@ u]
  • Python
    from math import gcd
    A347756_list, nset, m, j = [1], {1}, 2, 2
    for _ in range(10**4):
        k = m
        while k == j or gcd(k,j) == 1 or k in nset:
            k += 1
        j = k + 1
        nset.add(k)
        if k == m:
            A347756_list.append(k)
        while m in nset:
            m += 1 # Chai Wah Wu, Sep 13 2021

Formula

A347757(n) = index of a(n) in A347113.

A347308 Indices of records in A347113.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 36, 41, 42, 90, 91, 92, 93, 94, 519, 1044, 1251, 1252, 1422, 2748, 3591, 6528, 10685, 11661, 12028, 12236, 17326, 19899, 20074, 22571, 26429, 27702, 30538, 43975, 54016, 54017, 54229, 61703, 63862, 63863, 127935, 127936, 269513, 297679, 342675
Offset: 1

Views

Author

N. J. A. Sloane, Sep 01 2021

Keywords

Crossrefs

Programs

  • Python
    from math import gcd
    A347308_list, nset, m, c, j, i = [1], {1}, 2, 0, 2, 1
    for _ in range(10**4):
        i += 1
        k = m
        while k == j or gcd(k,j) == 1 or k in nset:
            k += 1
        if k > c:
            c = k
            A347308_list.append(i)
        j = k + 1
        nset.add(k)
        while m in nset:
            m += 1 # Chai Wah Wu, Sep 01 2021

Extensions

a(23)-a(40) from Alois P. Heinz, Sep 01 2021
a(41)-a(42) from Chai Wah Wu, Sep 01 2021
a(43)-a(45) from Chai Wah Wu, Sep 02 2021

A347755 Least k that does not appear in A347113(m), 1 <= m <= n.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 23, 23, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31
Offset: 0

Views

Author

Michael De Vlieger, Sep 12 2021

Keywords

Comments

a(0) = 1 by definition, since A347113 = 1 by definition of that sequence.
Lower bound on A347113.
Conjecture: all terms are in A008578. This is true for n <= 327680. Let j = A347113(m-1) and k = A347113(m) for k in A347757. For m > 0, k | j.

Examples

			Let b(n) = A347113(n).
a(1) = 2 since b(1) = a(0) = 1.
a(k) = 2 for 1 <= k <= 7 since b(k) > 2.
a(8) = 3 since b(8) = a(7) = 2.
a(k) = 3 for 9 <= k <= 10 since b(k) > 3.
a(11) = 7 since b(11) = a(10) = 3.
a(k) = 7 for 12 <= k <= 17 since b(k) > 7, etc.
		

Crossrefs

Cf. A008578, A347113, A347307, A347756 (distinct terms in this sequence).

Programs

  • Mathematica
    Block[{nn = 71, a = {1}, c, k, m, u = 2, v}, v = a; Map[Set[c[#], 1] &, Union@ a]; Do[Set[k, u]; If[PrimeQ[#], m = 2; While[IntegerQ[c[m #]], m++]; k = m #, While[Or[IntegerQ[c[k]], k == #, GCD[k, #] == 1], k++]] &[a[[-1]] + 1]; AppendTo[a, k]; Set[c[k], 1]; AppendTo[v, u]; If[k == u, While[IntegerQ[c[u]], u++]], nn]; v]
    (* or using A347113 bfile: *)
    Block[{a, u = {1}, v = 1}, a = Import["https://oeis.org/A347113/b347113.txt", "Data"][[All, -1]]; Do[If[a[[i]] == v, While[! FreeQ[a[[1 ;; i]], v], v++]]; AppendTo[u, v], {i, Length[a]}]; u]
  • Python
    from math import gcd
    A347755_list, nset, m, j = [1], {1}, 2, 2
    for _ in range(10**2):
        k = m
        while k == j or gcd(k,j) == 1 or k in nset:
            k += 1
        j = k + 1
        nset.add(k)
        A347755_list.append(m)
        while m in nset:
            m += 1 # Chai Wah Wu, Sep 13 2021

A349405 a(n) = A347113(A347313(n))+1.

Original entry on oeis.org

95, 6, 15, 39, 14, 22, 119, 87, 57, 46, 123, 215, 159, 94, 93, 219, 74, 118, 122, 303, 142, 134, 327, 166, 695, 178, 395, 206, 214, 226, 447, 959, 262, 254, 543, 291, 302, 326, 334, 699, 346, 358, 382, 386, 394, 843, 1727, 879, 446, 454, 478, 482, 502, 8159, 514
Offset: 1

Views

Author

Michael De Vlieger, Nov 16 2021

Keywords

Comments

These numbers generate primes in A347113.
Let s = A347113, j = s(i)+1, and k = s(i+1). For prime k, j is a squarefree semiprime pq, p < q.
The first 3 primes in s have k = p, while all others observed for i <= 2^19 have k = q.

Examples

			a(1) = s(6)+1 = 95 -> s(7) = 5,
a(2) = s(7)+1 = 6 -> s(8) = 2,
a(3) = s(10)+1 = 15, -> s(11) = 3,
a(4) = s(18)+1 = 39, -> s(19) = 13, etc.
		

Crossrefs

Programs

A349406 a(n) = A349405(n)/A348779(n).

Original entry on oeis.org

19, 3, 5, 3, 2, 2, 7, 3, 3, 2, 3, 5, 3, 2, 3, 3, 2, 2, 2, 3, 2, 2, 3, 2, 5, 2, 5, 2, 2, 2, 3, 7, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 11, 3, 2, 2, 2, 2, 2, 41, 2, 2, 3, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 5, 3, 5, 3, 3, 5, 2, 2, 2, 2, 2, 2, 2, 2, 3, 5, 3, 2, 2
Offset: 1

Views

Author

Michael De Vlieger, Nov 16 2021

Keywords

Comments

Ratio of progenitor and prime in A347113.
Let s = A347113, j = s(i)+1, and k = s(i+1). For prime k, j is a squarefree semiprime pq, p < q.
The first 3 primes in s have k = p, while all others observed for i <= 2^19 have k = q. This sequence thus lists the other prime factor r of j such that r*k = j.
The quasi-linear striations k < n are arranged according to this sequence (see color-coded log-log scatterplot). - Michael De Vlieger, Nov 17 2021

Examples

			s(6)+1 = 95 -> s(7) = 5; a(1) = 95/5 = 19.
s(7)+1 = 6 -> s(8) = 2; a(2) = 6/2 = 3.
s(10)+1 = 15, -> s(11) = 3; a(3) = 15/3 = 5.
s(18)+1 = 39, -> s(19) = 13; a(4) = 39/13 = 3, etc.
		

Crossrefs

Programs

Showing 1-6 of 6 results.