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.

A217556 Terms as well as ending/starting digits are of alternating parity; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 11, 22, 13, 24, 15, 26, 17, 28, 19, 40, 31, 42, 33, 44, 35, 46, 37, 48, 39, 60, 51, 62, 53, 64, 55, 66, 57, 68, 59, 80, 71, 82, 73, 84, 75, 86, 77, 88, 79, 200, 91, 202, 93, 204, 95, 206, 97, 208, 99, 210, 101, 212, 103, 214, 105, 216, 107, 218, 109
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Oct 06 2012

Keywords

Crossrefs

A simplified variant of A217555.
See also A217559, A217560, where "parity" is replaced by "primality".

Programs

  • PARI
    A217556(n,show=0,a=1,u)={for( i=2, n, u+=1<M. F. Hasler, Oct 06 2012

A217559 Terms as well as ending/starting digits have alternating primality; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 9, 23, 10, 29, 22, 11, 24, 31, 25, 13, 12, 17, 14, 37, 15, 19, 26, 53, 16, 59, 28, 71, 30, 73, 18, 79, 20, 211, 21, 223, 48, 227, 49, 229, 27, 41, 32, 43, 44, 233, 45, 47, 46, 239, 33, 61, 34, 241, 35, 67, 60, 251, 36, 257, 62, 83, 63, 89, 38, 263, 64, 269, 39, 271, 50, 277
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Oct 06 2012

Keywords

Comments

Exactly every other term is prime; moreover the ending digit of a(n) and the initial digit of a(n+1) are never both prime or both composite.

Crossrefs

This is a simplified variant of A217560.
See also A217555, A217556, where "primality" is replaced by "parity".

Programs

  • PARI
    A217559(n,show_all=0,a=1,u)={for( i=2, n, u+=1<
    				

A217560 Terms as well as digits have alternating primality; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 9, 29, 20, 31, 21, 59, 24, 71, 26, 79, 28, 263, 12, 13, 15, 17, 42, 43, 45, 47, 62, 67, 63, 83, 65, 97, 82, 131, 30, 283, 85, 139, 34, 293, 87, 151, 36, 307, 92, 179, 38, 313, 93, 421, 39, 317, 95, 431, 50, 347, 120, 367, 121, 383, 124, 397, 126, 503, 128, 547, 129, 563, 130, 587, 134, 593, 136, 743, 138, 787
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Oct 06 2012

Keywords

Comments

Exactly every other term, and also every other digit (in concatenated terms) is prime.

Crossrefs

The sequence A217559 is a simplified variant.
See also A217555, A217556, where "primality" is replaced by "parity".

Extensions

Values from a(26)=43 on corrected by Jean-Marc Falcoz, Oct 10 2012

A375326 Terms as well as digits fit the nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 2, 1, 3, 4, 5, 6, 7, 8, 29, 20, 31, 21, 59, 24, 71, 26, 79, 28, 263, 9, 283, 12, 13, 15, 17, 42, 43, 45, 47, 62, 67, 63, 83, 65, 97, 82, 131, 30, 293, 85, 139, 34, 307, 87, 151, 36, 313, 92, 179, 38, 317, 93, 421, 39, 347, 95, 431, 50, 367, 120, 383, 121, 397, 124, 503, 126, 547, 128, 563, 129, 587, 130
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 12 2024

Keywords

Examples

			a(9) = 8, a(10) = 29, a(11) = 20, a(12) = 31; we see that a(9) and a(11) are nonprimes and that a(10) and a(12) are primes. The digits involved fit the pattern nonprime/prime too; they are 8, 2, 9, 2, 0, 3, 1.
		

Crossrefs

Cf. A217555.

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with prime/nonprime or nonprime/prime digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)&1] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if s[0]!="0")
    def agen(): # generator of terms
        seen, s, an = {0, 2}, 2, 2
        yield from [0, 2]
        for n in count(3):
            p = (n&1) == 0
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 12 2024

A281878 The sum of two successive terms is prime and the sum of two successive digits is also prime.

Original entry on oeis.org

0, 2, 1, 4, 3, 8, 5, 6, 7, 412, 9, 20, 21, 16, 111, 112, 121, 120, 29, 212, 11, 12, 125, 234, 149, 230, 203, 216, 143, 258, 305, 252, 167, 432, 161, 116, 123, 214, 165, 202, 129, 238, 303, 298, 321, 250, 207, 434, 323, 294, 307, 612, 325, 232, 141, 256, 505, 292, 147, 416, 503, 438, 349, 474, 347, 414, 329, 492, 385, 676, 525, 656, 507
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Feb 01 2017

Keywords

Comments

The sequence is started with a(1)=0 and always extended with the smallest integer not yet present in the sequence and not leading to a contradiction.

Examples

			Prime sum of successive terms:
0+2 is prime; 2+1 is prime; 1+4 is prime; ... 6+7 is prime; 7+412 is prime; 412+9 is prime; etc.
Prime sum of successive digits: 0+2 is prime; 2+1 is prime; 1+4 is prime; ... 6+7 is prime; 7+4 is prime; 4+1 is prime; 1+2 is prime; etc.
		

Crossrefs

Cf. A217555.

A375305 Terms as well as digits fit the even/even/odd pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 2, 1, 4, 6, 3, 8, 210, 21, 20, 10, 23, 22, 12, 25, 24, 14, 27, 26, 16, 29, 28, 18, 41, 40, 30, 43, 42, 32, 45, 44, 34, 47, 46, 36, 49, 48, 38, 61, 60, 50, 63, 62, 52, 65, 64, 54, 67, 66, 56, 69, 68, 58, 81, 80, 70, 83, 82, 72, 85, 84, 74, 87, 86, 76, 89, 88, 78, 21001, 2010, 212, 21003, 2012, 214, 21005
Offset: 1

Views

Author

Eric Angelini, Aug 11 2024

Keywords

Examples

			a(7) = 8, a(8) = 210, a(9) = 21; the three terms follow the even/even/odd pattern and so do their digits: 8/2/1 and 0/2/1.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice, repeat
    def c(s, i):
        return all(int(d)%2 == int((i+j)%3 == 2) for j, d in enumerate(s))
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(0):
            eo = int(n%3 == 2)
            an = next(k for k in count(eo, 2) if k not in seen and c(str(k), s))
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 11 2024

A375306 Terms as well as digits fit the even/odd/odd pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 101, 10, 11, 21, 12, 13, 23, 14, 15, 25, 16, 17, 27, 18, 19, 29, 30, 31, 41, 32, 33, 43, 34, 35, 45, 36, 37, 47, 38, 39, 49, 50, 51, 61, 52, 53, 63, 54, 55, 65, 56, 57, 67, 58, 59, 69, 70, 71, 81, 72, 73, 83, 74, 75, 85, 76, 77, 87, 78, 79, 89, 90, 91, 211, 6, 93, 213, 8, 95, 215, 2110, 97
Offset: 1

Views

Author

Eric Angelini, Aug 11 2024

Keywords

Examples

			a(7) = 4, a(8) = 9, a(9) = 101, a(10) = 10; terms follow the even/odd/odd pattern and so do their digits: 4/9/1 and 0/1/1.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice, repeat
    def c(s, i):
        return all(int(d)%2 == int((i+j)%3 > 0) for j, d in enumerate(s))
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(0):
            eo = int(n%3 > 0)
            an = next(k for k in count(eo, 2) if k not in seen and c(str(k), s))
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 11 2024

A375327 Terms as well as digits fit the nonprime/nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 1, 2, 4, 6, 3, 8, 9, 5, 10, 20, 13, 14, 21, 17, 16, 24, 43, 18, 26, 47, 40, 28, 67, 44, 30, 83, 46, 34, 97, 48, 36, 131, 12, 49, 7, 60, 38, 139, 15, 64, 29, 42, 66, 31, 45, 68, 59, 62, 69, 71, 63, 80, 79, 65, 81, 211, 39, 82, 11, 50, 85, 19, 51, 87, 41, 54, 92, 61, 56, 93, 89, 58, 95, 103, 84, 70, 151, 120
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 13 2024

Keywords

Examples

			a(9) = 5, a(10) = 10, a(11) = 20, a(12) = 13, a(13) = 14, a(14) = 21 ; we see that a(9) and a(12) are primes and that a(10), a(11), a(13); and a(14) are nonprimes. The digits involved fit the pattern nonprime/nonprime/prime too; they are 5,1,0,2,0,1,3,1,4,2 and 1.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with np/np/p, np/p/np, or p/np/np digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)%3 == 2] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(1):
            p = (n-1)%3 == 2
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 13 2024

A375328 Terms as well as digits fit the prime/prime/nonprime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

2, 3, 0, 5, 7, 1, 23, 13, 20, 37, 17, 21, 53, 43, 24, 73, 47, 26, 229, 239, 22, 67, 29, 25, 83, 31, 27, 97, 59, 32, 127, 137, 4, 251, 271, 33, 157, 173, 6, 331, 359, 35, 433, 457, 8, 379, 521, 52, 653, 673, 9, 571, 739, 55, 677, 823, 12, 71, 751, 57, 827, 853, 15, 79, 2203, 28, 2207, 263, 30, 2213, 283, 34, 2243
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 13 2024

Keywords

Examples

			a(4) = 5, a(5) = 7, a(6) = 1, a(7) = 23, a(8) = 13, a(9) = 20; we see that a(4), a(5), a(7) and a(8) are primes and that a(6) and a(9) are nonprimes. The digits involved fit the pattern prime/prime/nonprime too; they are 5,7,1,2,3,1,3,2 and 0.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with p/p/np, p/np/p, or np/p/p digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)%3 < 2] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(1):
            p = (n-1)%3 < 2
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 13 2024
Showing 1-9 of 9 results.