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

A376198 a(1) = 1, a(2) = 2. Thereafter, let smc and smp denote the smallest missing composite and smallest missing prime. If a(n) is composite, then if a(n) = 2*smp then a(n+1) = smp, otherwise a(n+1) = smc; if a(n) is a prime, then if smp < smc, a(n+1) = smp, otherwise a(n+1) = smc.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 5, 7, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 13, 17, 19, 23, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 29, 31, 37, 41, 43, 47, 53, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

The composite terms appear in their natural order, as do the primes.
This is a simplified version of A375564 (the difference being in the way the composite numbers are handled: here they appear in order, whereas in A375564 successive composite numbers must have a common gcd greater than 1).
The following table was calculated by Michael S. Branicky on Oct 04 2024.
It shows the beginning, end, and length of the k-th run of successive primes.
a b c : d e f [a = k, b = A376750(k), c = A376751(k),
1 2 2 : 3 3 2 d = A376752(k), e = A376753(k), f = A376754(k)]
2 9 5 : 11 11 3
3 23 13 : 26 23 4
4 52 29 : 59 59 8
5 110 61 : 122 113 13
6 231 127 : 254 251 24
7 472 257 : 514 509 43
8 965 521 : 1042 1039 78
9 1958 1049 : 2099 2099 142
10 3962 2111 : 4222 4219 261
11 7980 4229 : 8458 8447 479
12 16029 8461 : 16922 16921 894
13 32181 16927 : 33854 33851 1674
14 64597 33857 : 67714 67709 3118
15 129574 67723 : 135446 135433 5873
16 259798 135449 : 270899 270899 11102
17 520835 270913 : 541826 541817 20992
18 1043833 541831 : 1083662 1083659 39830
19 2091473 1083689 : 2167378 2167369 75906
20 4190135 2167393 : 4334786 4334777 144652
21 8392863 4334791 : 8669582 8669543 276720
22 16809322 8669593 : 17339186 17339177 529865
23 33661860 17339197 : 34678394 34678381 1016535
24 67402676 34678421 : 69356842 69356839 1954167
25 134952624 69356857 : 138713714 138713711 3761091
26 270177158 138713717 : 277427434 277427431 7250277
27 540861852 277427441 : 554854882 554854873 13993031
28 1082667610 554854889 : 1109709778 1109709709 27042169
29 2167106199 1109709791 : 2219419582 2219419577 52313384
30 4337519113 2219419597 : 4438839194 4438839173 101320082
31 8681255531 4438839259 : 8877678518 8877678499 196422988
32 17374202846 8877678527 : 17755357054 17755357051 381154209
33 34770433922 17755357069 : 35510714138 35510714137 740280217

Crossrefs

See also A113646 (next composite number).

Programs

  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp = 2, 4, 3
        yield from [1, 2]
        while True:
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
            yield an
    print(list(islice(agen(), 87))) # Michael S. Branicky, Oct 03 2024

A376201 Fixed points in A376198.

Original entry on oeis.org

1, 2, 3, 4, 11, 12, 27, 28, 59, 60, 123, 124, 125, 126, 255, 256, 515, 516, 517, 518, 519, 520, 1043, 1044, 1045, 1046, 1047, 1048, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 4223, 4224, 4225, 4226, 4227, 4228, 8459, 8460, 16923, 16924, 16925, 16926, 33855, 33856, 67715, 67716, 67717, 67718, 67719
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

Conjectures: the terms consist of runs of an even number (>1) of successive numbers that increase by 1 at each step; A376758(n) is one-half of the length of the n-th such run; and the run ends at A376751(n) - 1. - N. J. A. Sloane, Oct 07 2024

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp = 2, 4, 3
        yield from [1, 2]
        for n in count(3):
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
            if n == an: yield an
    print(list(islice(agen(), 59))) # Michael S. Branicky, Oct 03 2024

A376750 Indices n where a run of primes begins in A376198.

Original entry on oeis.org

2, 9, 23, 52, 110, 231, 472, 965, 1958, 3962, 7980, 16029, 32181, 64597, 129574, 259798, 520835, 1043833, 2091473, 4190135, 8392863, 16809322, 33661860, 67402676, 134952624, 270177158, 540861852, 1082667610, 2167106199, 4337519113, 8681255531, 17374202846, 34770433922, 69582458821, 139243546013, 278635987083
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def A376750_4gen(): # generator of terms for A376750..4
        an, smc, smp = 2, 4, 3,
        wasprime = startp = startn = endp = endn = rl = 0
        for n in count(2):
            if not isprime(an):
                if wasprime: # a run has ended
                    endn, endp = n-1, wasprime
                    yield startn, startp, endn, endp, rl
                an = smp if an == 2*smp else smc
                wasprime = 0 # False
            else:
                if not wasprime: # a run has started
                    startn, startp, rl = n, an, 1
                else: rl += 1
                wasprime = an
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
    print([out[0] for out in list(islice(A376750_4gen(), 15))]) # Michael S. Branicky, Oct 03 2024

Extensions

a(14)-a(33) from Michael S. Branicky, Oct 04 2024
a(34)-a(36) from Michael S. Branicky, Oct 07 2024

A376751 Primes that begin a run of primes in A376198.

Original entry on oeis.org

2, 5, 13, 29, 61, 127, 257, 521, 1049, 2111, 4229, 8461, 16927, 33857, 67723, 135449, 270913, 541831, 1083689, 2167393, 4334791, 8669593, 17339197, 34678421, 69356857, 138713717, 277427441, 554854889, 1109709791, 2219419597, 4438839259, 8877678527, 17755357069, 35510714159, 71021428351, 142042856719
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Crossrefs

Programs

Extensions

a(14)-a(33) from Michael S. Branicky, Oct 04 2024
a(34)-a(36) from Michael S. Branicky, Oct 07 2024

A376752 Indices n where a run of primes ends in A376198.

Original entry on oeis.org

3, 11, 26, 59, 122, 254, 514, 1042, 2099, 4222, 8458, 16922, 33854, 67714, 135446, 270899, 541826, 1083662, 2167378, 4334786, 8669582, 17339186, 34678394, 69356842, 138713714, 277427434, 554854882, 1109709778, 2219419582, 4438839194, 8877678518, 17755357054, 35510714138, 71021428318, 142042856702, 284085713438
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Crossrefs

Programs

Extensions

a(14)-a(33) from Michael S. Branicky, Oct 04 2024
a(34)-a(36) from Michael S. Branicky, Oct 07 2024

A376199 Index where n appears in A376198.

Original entry on oeis.org

1, 2, 3, 4, 9, 5, 10, 6, 7, 8, 11, 12, 23, 13, 14, 15, 24, 16, 25, 17, 18, 19, 26, 20, 21, 22, 27, 28, 52, 29, 53, 30, 31, 32, 33, 34, 54, 35, 36, 37, 55, 38, 56, 39, 40, 41, 57, 42, 43, 44, 45, 46, 58, 47, 48, 49, 50, 51, 59, 60, 110, 61, 62, 63, 64, 65, 111, 66, 67, 68, 112, 69, 113, 70, 71, 72, 73, 74, 114, 75, 76, 77, 115, 78, 79
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp, adict, n = 2, 4, 3, {1: 1, 2: 2}, 1
        for k in count(3):
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
            if an not in adict: adict[an] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 85))) # Michael S. Branicky, Oct 03 2024

A376200 Indices where primes appear in A376198.

Original entry on oeis.org

2, 3, 9, 10, 11, 23, 24, 25, 26, 52, 53, 54, 55, 56, 57, 58, 59, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

The primes appear in order, so a(n) is also the index of prime(n) in A376198.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp = 2, 4, 3
        for n in count(2):
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                yield n
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
    print(list(islice(agen(), 71))) # Michael S. Branicky, Oct 03 2024

A376753 Primes that end a run of primes in A376198.

Original entry on oeis.org

3, 11, 23, 59, 113, 251, 509, 1039, 2099, 4219, 8447, 16921, 33851, 67709, 135433, 270899, 541817, 1083659, 2167369, 4334777, 8669543, 17339177, 34678381, 69356839, 138713711, 277427431, 554854873, 1109709709, 2219419577, 4438839173, 8877678499, 17755357051, 35510714137, 71021428277, 142042856611, 284085713419
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Crossrefs

Programs

Extensions

a(14)-a(33) from Michael S. Branicky, Oct 04 2024
a(34)-a(36) from Michael S. Branicky, Oct 07 2024

A376763 Length of n-th run of composite numbers in A376198.

Original entry on oeis.org

5, 11, 25, 50, 108, 217, 450, 915, 1862, 3757, 7570, 15258, 30742, 61859, 124351, 249935, 502006, 1007810, 2022756, 4058076, 8139739, 16322673, 32724281, 65595781, 131463443, 263434417, 527812727, 1057396420, 2118099530, 4242416336, 8496524327, 17015076867, 34071744682, 68222117694, 136593130380
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2024

Keywords

Crossrefs

Formula

a(n) = A376750(n+1) - A376752(n) (a simple consequence of the definition).
Showing 1-9 of 9 results.