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-3 of 3 results.

A354687 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that shares a factor with a(n-1) and the difference | a(n) - a(n-1) | is distinct from all previous differences.

Original entry on oeis.org

1, 2, 4, 8, 14, 6, 3, 12, 22, 10, 5, 20, 34, 16, 32, 52, 13, 26, 48, 15, 36, 9, 33, 44, 18, 46, 23, 69, 21, 28, 58, 24, 56, 7, 42, 78, 27, 72, 30, 55, 11, 66, 104, 38, 19, 76, 116, 29, 87, 141, 39, 91, 35, 85, 17, 102, 40, 100, 25, 90, 153, 45, 114, 50, 120, 192, 51, 68, 142, 54, 130, 208, 60
Offset: 1

Views

Author

Scott R. Shannon, Jun 03 2022

Keywords

Comments

The terms are concentrated along many different lines, although three lines contain a higher concentration of terms than the others; these are similar to the three lines seen in A064413. See the linked image. The primes do not occur in their natural order, and unlike A064413, the terms proceeding and following a prime term can be high multiples of the prime.
In the first 200000 terms the fixed points are 1,2,6,10,68. It is plausible no more exist although this is unknown. The sequence is conjectured to be a permutation of the positive integers.
See A354721 for the differences between terms.

Examples

			a(4) = 8 as a(3) = 4, and 8 is the smallest unused number that shares a factor with 4 and whose difference from the previous term,| 8 - 4 | = 4, has not appeared. Note 6 shares a factor with 4 but | 6 - 4 | = 2, and a difference of 2 has already occurred between as | a(3) - a(2) |, so 6 cannot be chosen.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = d[] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, ! CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jun 04 2022 *)
  • Python
    from math import gcd
    from sympy import isprime, nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, diffset, an, mink = {1, 2}, {1}, 2, 3
        yield from [1, 2]
        for n in count(3):
            k = mink
            while k in aset or abs(an-k) in diffset or gcd(an, k) == 1: k += 1
            aset.add(k); diffset.add(abs(k-an)); an = k; yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 73))) # Michael S. Branicky, Jun 04 2022

A354688 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1) and the difference | a(n) - a(n-1) | is distinct from all previous differences.

Original entry on oeis.org

1, 2, 5, 3, 7, 12, 19, 4, 13, 21, 8, 25, 6, 17, 11, 23, 9, 29, 39, 10, 31, 15, 37, 14, 41, 16, 47, 65, 18, 53, 20, 57, 83, 22, 61, 27, 55, 79, 24, 67, 26, 71, 33, 73, 43, 75, 119, 30, 89, 32, 81, 28, 93, 35, 86, 149, 34, 101, 45, 91, 127, 36, 107, 38, 111, 49, 97, 139, 40, 117, 167, 42, 121, 46
Offset: 1

Views

Author

Scott R. Shannon, Jun 03 2022

Keywords

Comments

All of the terms are concentrated along four lines - this is in contrast to A352588 where they all concentrated along one line. See the linked image. The primes do not occur in their natural order. The sequence is conjectured to be a permutation of the positive integers.
See A354731 for the differences between terms.

Examples

			a(6) = 12 as a(5) = 7, and 12 is the smallest unused number that is coprime to 7 and whose difference from the previous term, | 12 - 7 | = 5, has not appeared. Note that 4,6,8,9,10,11 are all coprime to 7 but their differences from 7 have all appeared as differences between previous terms so none can be chosen.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = d[] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jun 04 2022 *)
  • Python
    from math import gcd
    from sympy import isprime, nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, diffset, an, mink = {1}, set(), 1, 2
        yield 1
        for n in count(2):
            k = mink
            while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1
            aset.add(k); diffset.add(abs(k-an)); an = k; yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 74))) # Michael S. Branicky, Jun 04 2022

A354731 Absolute values of first differences of A354688.

Original entry on oeis.org

1, 3, 2, 4, 5, 7, 15, 9, 8, 13, 17, 19, 11, 6, 12, 14, 20, 10, 29, 21, 16, 22, 23, 27, 25, 31, 18, 47, 35, 33, 37, 26, 61, 39, 34, 28, 24, 55, 43, 41, 45, 38, 40, 30, 32, 44, 89, 59, 57, 49, 53, 65, 58, 51, 63, 115, 67, 56, 46, 36, 91, 71, 69, 73, 62, 48, 42, 99, 77, 50, 125, 79, 75, 83, 85, 81
Offset: 1

Views

Author

Scott R. Shannon, Jun 04 2022

Keywords

Comments

See A354688 for further details.

Examples

			a(3) = 2 as | A354688(4) - A354688(3) | = | 3 - 5 | = 2.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = d[] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; {1}~Join~Reap[Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; Sow[Abs[k - j]]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]][[-1, -1]] (* Michael De Vlieger, Jun 04 2022 *)
  • Python
    from math import gcd
    from sympy import isprime, nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, diffset, an, mink = {1}, set(), 1, 2
        for n in count(2):
            k = mink
            while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1
            aset.add(k); diffset.add(abs(k-an)); yield abs(k-an); an = k
            while mink in aset: mink += 1
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 04 2022
Showing 1-3 of 3 results.