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-10 of 11 results. Next

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

A359799 a(1) = 1, a(2) = 3; for n > 2, a(n) is the smallest positive number which has not appeared that shares a factor with |a(n-1) - a(n-2)| while the difference |a(n) - a(n-1)| is distinct from all previous differences |a(i) - a(i-1)|, i=2..n-1.

Original entry on oeis.org

1, 3, 6, 12, 2, 10, 14, 26, 4, 11, 28, 17, 22, 35, 65, 5, 20, 36, 8, 32, 9, 23, 42, 76, 18, 38, 56, 15, 41, 16, 25, 54, 87, 21, 48, 27, 63, 24, 66, 7, 59, 13, 44, 93, 49, 84, 30, 62, 100, 19, 69, 106, 37, 90, 212, 34, 74, 122, 33, 89, 46, 129, 249, 39, 86, 141, 40, 101, 183, 50, 95, 159, 52
Offset: 1

Views

Author

Scott R. Shannon, Mar 07 2023

Keywords

Comments

In the first 100000 terms the only fixed point is a(1) = 1; it is unknown if more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(5) = 2 as |a(4) - a(3)| = |12 - 6| = 6, and 2 is the smallest unused number that shares a factor with 6 while the difference |2 - a(4)| = |2 - 12| = 10 is distinct from all previous differences.
		

Crossrefs

A354721 Absolute values of first differences of A354687.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jun 04 2022

Keywords

Comments

See A354687 for further details.

Examples

			a(5) = 8 as | A354687(6) - A354687(5) | = | 6 - 14 | = 8.
		

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, 2}, {1}, 2, 3
        yield from [1]
        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)); yield abs(an-k); an = k
            while mink in aset: mink += 1
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 04 2022

A354755 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that shares a factor with a(n-1) and the sum a(n) + a(n-1) is distinct from all previous sums a(i) + a(i-1), i=2..n-1.

Original entry on oeis.org

1, 2, 2, 4, 4, 6, 3, 9, 6, 8, 8, 10, 10, 12, 9, 15, 10, 16, 12, 15, 15, 18, 14, 20, 15, 21, 18, 20, 20, 22, 22, 24, 21, 27, 24, 26, 26, 28, 21, 35, 20, 38, 19, 57, 3, 60, 2, 62, 4, 64, 6, 63, 9, 66, 8, 70, 7, 77, 11, 88, 2, 78, 3, 84, 2, 80, 5, 60, 32, 62, 31, 93, 3, 99, 6, 92, 8, 96, 10, 85, 25
Offset: 1

Views

Author

Scott R. Shannon, Jun 06 2022

Keywords

Comments

In the first 500000 terms the fixed points are 1,2,4,6,2388,2390,2392,2394; it is likely no more exist. In the same range many numbers do not appear, the lowest five being 59,67,73,89,97. It is possible these and many other numbers never appear although this is unknown.

Examples

			a(7) = 3 as a(6) = 6, and 3 is the smallest number that shares a factor with 6 and whose sum with the previous term, 6 + 3 = 9, has not appeared. Note 2 shares a factor with 6 but 6 + 2 = 8, and a sum of 8 has already occurred with a(4) + a(5) = 4 + 4 = 8, so 2 cannot be chosen.
		

Crossrefs

Programs

A353990 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), does not equal a(n-1)+1, and whose binary expansion has no 1-bit in common with the binary expansion of a(n-1).

Original entry on oeis.org

1, 4, 3, 8, 5, 2, 9, 16, 7, 24, 35, 12, 17, 6, 25, 32, 11, 20, 33, 10, 21, 34, 13, 18, 37, 26, 69, 40, 19, 36, 65, 14, 81, 38, 73, 22, 41, 64, 15, 112, 129, 28, 67, 44, 83, 128, 23, 72, 49, 66, 29, 96, 31, 160, 27, 68, 43, 80, 39, 88, 131, 48, 71, 56, 135, 104, 133, 50, 77, 130, 53, 74, 145, 42
Offset: 1

Views

Author

Scott R. Shannon, May 13 2022

Keywords

Comments

This sequence is similar to A093714 with the additional restriction that no term can have a 1-bit in common with the previous term in their binary expansions. This leads to the terms showing similar behavior to A109812. See the linked image.
In the first 100000 terms the fixed points are 1, 3, 5, 12, 21, 26, 44, 49, 227, 3488, 5890, 9067, 9310, 37625, 74702, although it is likely more exist. In the same range the lowest unseen number is 30686; the sequence is conjectured to be a permutation of the positive integers.

Examples

			a(4) = 8 as a(3) = 3, and 8 has not yet appeared, is coprime to 3, is not 1 more than 3, while 8 = 1000_2 and 3 = 11_2 which have no 1-bits in common.
		

Crossrefs

Programs

  • Python
    from math import gcd
    from itertools import count, islice
    def A353990_gen(): # generator of terms
        yield 1
        a, s, b = 1, 2, set()
        while True:
            for i in count(s):
                if not (i == a+1 or i & a or gcd(i,a) > 1 or i in b):
                    yield i
                    a = i
                    b.add(i)
                    while s in b:
                        s += 1
                    break
    A353990_list = list(islice(A353990_gen(),30)) # Chai Wah Wu, May 24 2022

A355621 a(1) = 1; for n > 1, a(n) is the number of terms in the first n-1 terms of the sequence that share a 1-bit with a(n-1) in their binary expansions.

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 5, 6, 5, 8, 1, 8, 2, 4, 5, 11, 15, 17, 12, 11, 19, 17, 15, 23, 22, 19, 22, 21, 24, 16, 10, 18, 20, 21, 29, 33, 22, 30, 33, 23, 38, 31, 42, 28, 35, 37, 38, 37, 40, 22, 41, 40, 24, 33, 35, 46, 49, 49, 50, 47, 59, 60, 55, 61, 62, 61, 64, 1, 39, 63, 69, 58, 60, 64, 3, 60, 65, 46, 67
Offset: 1

Views

Author

Scott R. Shannon, Jul 10 2022

Keywords

Comments

The indices where a(n) = 1 in the first 500000 terms are 1, 2, 4, 11, 68, 131, 2051, 4099. It is unknown if more exist. Many terms of the sequence are close to the line a(n) = n although only the first term is a possible fixed point. In the first 500000 terms the lowest values not to appear are 7, 9, 14, 25, 26. It is likely these and other numbers never appear although this is unknown.

Examples

			a(7) = 5 as a(6) = 5 and the total number of terms in the first six terms that share a 1-bit with 5 in their binary expansions is five, namely 1, 1, 1, 3, 5.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen():
        an, alst = 1, [1]
        for n in count(2):
            yield an
            an = sum(1 for k in alst if k&an)
            alst.append(an)
    print(list(islice(agen(), 79))) # Michael S. Branicky, Jul 10 2022

A355625 a(1) = 1; for n > 1, a(n) is the number of terms in the first n-1 terms of the sequence that share a 1-bit with n in their binary expansions.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 4, 0, 3, 2, 6, 2, 6, 7, 11, 0, 6, 9, 13, 6, 13, 13, 18, 6, 11, 17, 21, 16, 21, 22, 26, 0, 14, 16, 26, 14, 23, 25, 31, 12, 22, 27, 34, 27, 33, 34, 39, 19, 31, 35, 43, 36, 44, 44, 49, 36, 42, 48, 52, 47, 52, 53, 57, 0, 29, 32, 48, 30, 48, 48, 57, 25, 41, 46, 56, 47, 57, 58, 65, 34
Offset: 1

Views

Author

Scott R. Shannon, Jul 10 2022

Keywords

Comments

The indices where a(n) = 1 in the first 500000 terms are 1, 3, 6. It is likely no more exist although this is unknown. Many terms of the sequence are close to the line a(n) = n although only the first term is a possible fixed point. In the first 500000 terms the lowest values not to appear are 5, 8, 10, 15, 20, 24, 28. It is likely these and other numbers never appear although this is unknown. All terms for n > 1 where n is a power of 2 equal 0.

Examples

			a(7) = 4 as the total number of terms in the first six terms that share a 1-bit with 7 in their binary expansions is four, namely 1, 1, 2, 1.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen():
        an, alst = 1, [1]
        for n in count(2):
            yield an
            an = sum(1 for k in alst if k&n)
            alst.append(an)
    print(list(islice(agen(), 80))) # Michael S. Branicky, Jul 10 2022

A361314 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number which has not appeared that shares a factor with a(n-2) + a(n-1) while the sum a(n) + a(n-1) is distinct from all previous sums a(i) + a(i-1), i=2..n-1.

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 7, 9, 10, 19, 29, 12, 41, 53, 14, 67, 15, 16, 31, 47, 13, 20, 18, 22, 24, 26, 25, 17, 27, 28, 11, 21, 36, 30, 32, 38, 34, 39, 73, 35, 33, 42, 45, 48, 51, 44, 40, 46, 43, 89, 50, 139, 49, 52, 101, 54, 55, 109, 56, 57, 113, 58, 60, 59, 63, 61, 62, 66, 64, 65, 69, 68, 137, 70
Offset: 1

Views

Author

Scott R. Shannon, Mar 08 2023

Keywords

Comments

In the first 100000 terms the fixed points are 1, 2, 3, 6, 9, 10, 39, 91, 112; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(23) = 20 as a(21) + a(22) = 47 + 13 = 60, and 20 is the smallest unused number that shares a factor with 60 while the sum a(22) + 20 = 13 + 20 = 33 is distinct from all previous sums. Note that 18 is unused and shares a factor with 60 but the sum a(22) + 18 = 13 + 18 = 31 is the same as a(18) + a(19) = 15 + 16 = 31. This is the first term that differs from A337136.
		

Crossrefs

A351691 Lexicographically earliest infinite sequence of distinct positive numbers such that, for n>2, a(n) has a common factor with a(n-1), shares a 1-bit in its binary expansion with a(n-1), has no common factor with a(n-2), and does not share a 1-bit in its binary expansion with a(n-2).

Original entry on oeis.org

1, 2, 6, 21, 161, 736, 66, 15, 145, 464, 68, 527, 155, 80, 96, 33, 143, 26, 48, 165, 65, 338, 14, 133, 209, 88, 10, 35, 273, 24, 40, 295, 531, 144, 136, 1037, 305, 50, 74, 333, 129, 688, 20, 325, 299, 138, 132, 341, 1147, 1184, 384, 261, 551, 608, 72, 141, 517, 770, 18, 57, 589, 1798, 34, 8313
Offset: 1

Views

Author

Scott R. Shannon, May 26 2022

Keywords

Comments

The sequence is similar to A336957 but with the addition restrictions that each new term a(n) must share a 1-bit in its binary expansion with a(n-1), while sharing no 1-bits with the binary expansion of a(n-2). To ensure the sequence is infinite each a(n) must not only have a prime factor not in a(n-1), implying no prime or prime powers can occur (see A336957), it must also have a 1-bit in its binary expansion that is a 0-bit in the binary expansion of a(n-1).

Examples

			a(5) = 161 = 10100001_2 as a(4) = 21 = 10101_2, a(3) = 6 = 110_2, and 161 is the smallest unused number that shares a factor with 21, has a 1-bit in common with 21 in their binary expansions, does not share a factor with 6, has no 1-bit in common with 6 in their binary expansions, has a prime factor not in 21, and has a 1-bit in its binary expansion that is a 0-bit in the binary expansion of 21.
		

Crossrefs

A362842 a(1) = 1; a(2) = 2; for n > 2, a(n) is the smallest positive number that has not yet appeared that shares a factor with a(n-1) when both a(n-1) and a(n) are read as numbers in bases from one more than the maximum digit in a(n-1) and a(n), up to base 10.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 24, 8, 20, 10, 30, 33, 11, 22, 26, 13, 39, 15, 48, 28, 14, 49, 7, 70, 16, 38, 19, 57, 69, 18, 56, 76, 36, 60, 40, 42, 21, 63, 66, 44, 46, 23, 92, 32, 64, 62, 31, 93, 27, 90, 5, 50, 55, 77, 84, 35, 80, 68, 17, 119, 34, 94, 47, 329, 91, 52, 96, 45, 95, 25, 190, 54, 98, 58, 29
Offset: 1

Views

Author

Scott R. Shannon, May 05 2023

Keywords

Comments

This is a base variation of the EKG sequence A064413. Despite numbers with larger digits having to share a factor with a(n-1) in fewer bases than those with only small digits, and would therefore seemingly appear more frequently, the frequency of the digits 8 and 9, for example, in the first 200000 terms is the same as the smaller digits 0 to 7, so surprisingly this does not appear to influence the determination of a(n).
In the first 200000 terms the smallest unused number is 25411, which implies all numbers will eventually appear. In the same range the fixed points are 1, 2, 424, 507, 1261, 1577, 2461, 4311; it is likely no more appear.

Examples

			a(7) = 12 as the maximum digit in a(6) = 9 and 12 is 9, so a(6) and a(7) are only read as base 10 numbers, and 12 is the smallest unused number which shares a factor with 9 in base 10.
a(8) = 24 as the maximum digit in a(7) = 12 and 24 is 4, and 12_k shares a factor with 24_k when they are read as numbers in all bases k = 5,6,7,8,9,10. No unused smaller number has this property, e.g. a(8) cannot equal 8 as a(7) in base 9 is 12_9 = 11, which does not share a factor with 8_9 = 8. This is the first term to differ from A064413.
a(9) = 8 as the maximum digit in a(8) = 24 and 8 is 8, and 24_k shares a factor with 8_k when they are read as numbers in all bases k = 9,10.
		

Crossrefs

Showing 1-10 of 11 results. Next