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.

A353731 a(n) = index where prime(n) appears in A352808.

Original entry on oeis.org

2, 6, 4, 11, 18, 19, 16, 24, 45, 52, 63, 29, 30, 78, 122, 71, 123, 148, 46, 72, 53, 162, 96, 66, 100, 161, 243, 212, 194, 186, 394, 75, 86, 110, 114, 177, 204, 111, 254, 295, 273, 274, 494, 124, 167, 386, 338, 642, 339, 410, 347, 650, 351, 762, 159, 180, 195, 250, 191, 208, 225, 270, 284, 595, 340, 689, 290, 238, 732, 730, 258, 651, 696, 624, 749, 1062, 271, 311, 300, 326, 666, 625, 1006, 634, 1007, 1050, 269, 738, 759, 970, 898, 1443, 1122, 1123, 1139, 1570, 1483
Offset: 1

Views

Author

N. J. A. Sloane, May 17 2022

Keywords

Comments

Here prime(n) means the n-th prime in 2, 3, 5, 7, ..., not the n-th term of A352808 that happens to be a prime.

Crossrefs

Programs

  • Python
    from sympy import nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        A352808lst = [0, 1]; A352808set = {0, 1}
        mink = p = 2
        for n in count(2):
            ahalf, k = A352808lst[n//2], mink
            while k in A352808set or k&ahalf: k += 1
            A352808lst.append(k); A352808set.add(k)
            while mink in A352808set: mink += 1
            while p in A352808set: yield A352808lst.index(p); p = nextprime(p)
    print(list(islice(agen(), 76))) # Michael S. Branicky, May 17 2022

Formula

a(n) = k if A352808(k) = prime(n). - Michael S. Branicky, May 17 2022

A353732 Inverse permutation to A352808: a(n) = index where n appears in A352808.

Original entry on oeis.org

0, 1, 2, 6, 3, 4, 10, 11, 5, 7, 8, 18, 12, 19, 32, 44, 9, 16, 14, 24, 13, 17, 15, 45, 20, 21, 50, 56, 51, 52, 62, 63, 22, 25, 26, 27, 28, 29, 33, 40, 23, 30, 34, 78, 48, 70, 79, 122, 36, 64, 38, 84, 37, 71, 82, 98, 83, 85, 94, 123, 92, 148, 134, 210, 31, 41, 35, 46, 42, 47, 43, 72, 49, 53, 57, 73, 54, 76, 128, 162, 39, 65, 58, 96, 55, 68, 60
Offset: 0

Views

Author

N. J. A. Sloane, May 17 2022

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        A352808lst = [0, 1]; A352808set = {0, 1}; yield from [0, 1]
        mink = 2
        for n in count(2):
            ahalf, k = A352808lst[n//2], mink
            while k in A352808set or k&ahalf: k += 1
            A352808lst.append(k); A352808set.add(k)
            while mink in A352808set: yield A352808lst.index(mink); mink += 1
    print(list(islice(agen(), 87))) # Michael S. Branicky, May 17 2022

A354142 a(n) = smallest number missing from A352808 after A352808(n) has been found.

Original entry on oeis.org

1, 2, 3, 3, 3, 3, 6, 6, 6, 6, 7, 11, 11, 11, 11, 11, 11, 11, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 23, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 30, 30, 30, 30, 30, 30, 31, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43
Offset: 0

Views

Author

N. J. A. Sloane, May 18 2022

Keywords

Examples

			A352808 (with offset 0) begins 0,1,2,4,5,8; after A352808(0) = 0 has been found, the smallest missing number is 1, so a(0) = 1; after A352808(5) = 8 has been found, the smallest missing number is 3, so a(5) = 3.
		

Crossrefs

Cf. A352808.

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        A352808lst, A352808set, mink = [0], {0}, 1
        for n in count(1):
            yield mink
            ahalf, k = A352808lst[n//2], mink
            while k in A352808set or k&ahalf: k += 1
            A352808lst.append(k); A352808set.add(k)
            while mink in A352808set: mink += 1
    print(list(islice(agen(), 78))) # Michael S. Branicky, May 18 2022

A354141 Indices of terms in A352808 that are powers of 2.

Original entry on oeis.org

1, 2, 3, 5, 9, 22, 31, 61, 121, 247, 479, 951, 1862, 3802, 7431, 15180, 29723, 59766, 118893, 239999, 475573, 959341, 1902293, 3835229, 7609175, 15268473, 30436701, 61001391
Offset: 1

Views

Author

N. J. A. Sloane, May 18 2022

Keywords

Comments

Every power of 2 will eventually appear in A353730, so the sequence is infinite.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def ispow2(k): return bin(k).count("1") == 1
    def agen(): # generator of terms
        A352808lst = [0, 1]; A352808set = {0, 1}
        k, mink, p = 1, 2, 2
        for n in count(2):
            if ispow2(k): yield n-1
            ahalf, k = A352808lst[n//2], mink
            while k in A352808set or k&ahalf: k += 1
            A352808lst.append(k); A352808set.add(k)
            while mink in A352808set: mink += 1
    print(list(islice(agen(), 8))) # Michael S. Branicky, May 18 2022
    (C++) See Links section.

Extensions

a(16)-a(22) from Michael S. Branicky, May 19 2022
a(23)-a(28) from Rémy Sigrist, May 21 2022

A353733 a(0)=0, a(1)=1; for k >= 1, a(2*k+1) and a(2*k+2) are the two smallest numbers not yet in the sequence whose binary expansions have no 1's in common with the binary expansion of a(k).

Original entry on oeis.org

0, 1, 2, 4, 6, 5, 8, 3, 9, 16, 17, 10, 18, 7, 19, 12, 20, 22, 32, 11, 13, 14, 34, 21, 33, 36, 37, 24, 40, 44, 64, 35, 48, 41, 42, 65, 72, 15, 23, 52, 68, 50, 66, 49, 80, 25, 28, 74, 96, 26, 30, 27, 67, 82, 88, 38, 39, 69, 70, 81, 83, 29, 31, 76, 84, 71, 73, 86
Offset: 0

Views

Author

N. J. A. Sloane, May 17 2022

Keywords

Comments

A variant of A352808.
This is a permutation of the nonnegative numbers (the proof is similar to that for A352808).

Examples

			For k=2, after a(2) = 2 = 10_2, we get a(5) = 5 = 101_2 and a(6) = 8 = 1000_2 since 101_2, 1000_2 have no 1's in common with 10_2.
		

Crossrefs

Cf. A352808.

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [0, 1]; aset = {0, 1}; yield from alst
        mink = 2
        for n in count(2):
            ahalf, k = alst[(n-1)//2], mink
            while k in aset or k&ahalf: k += 1
            alst.append(k); aset.add(k); yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 68))) # Michael S. Branicky, May 17 2022

Extensions

More terms from Michael S. Branicky, May 17 2022

A354143 a(n) = smallest number missing from A353733 after A353733(n) has been found.

Original entry on oeis.org

1, 2, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 23, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 31, 43, 43, 43, 43, 43, 43
Offset: 0

Views

Author

N. J. A. Sloane, May 18 2022

Keywords

Crossrefs

Programs

Showing 1-6 of 6 results.