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.

A091939 Prime numbers with prime sum of any two digits.

Original entry on oeis.org

11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 211, 2111, 4111, 11161, 11411, 16111, 111121, 111211, 111611, 112111, 611111, 1111211, 1114111, 11111141, 11111161, 11141111, 61111111, 1111111121, 1111111411, 1111211111, 1111411111, 1121111111
Offset: 1

Views

Author

Rick L. Shepherd, Feb 16 2004

Keywords

Comments

All repunit primes (A004022) are terms. All other terms contain exactly one nonzero even digit. All non-repunit terms with k>2 digits must contain exactly k-1 copies of the digit 1, including final digit 1 and the remaining digit must be either 2, 4, or 6.
a(3330) has 1001 digits. - Michael S. Branicky, Dec 13 2023

Examples

			2111 is a term because it is prime and all sums of any two of its digits are 2+1 = 3 or 1+1 = 2, both of which are primes.
		

Crossrefs

Cf. A004022 (repunit primes).

Programs

  • Python
    from gmpy2 import is_prime
    from itertools import count, islice
    def agen(): # generator of terms
        yield from [11, 23, 29, 41, 43, 47, 61, 67, 83, 89]
        for k in count(3):
            b = (10**k-1)//9
            if is_prime(b): yield b
            dlst = [j for j in [1, 3, 5] if (k+j)%3]
            for i in range(1, k):
                c = 10**i
                for d in dlst:
                    if is_prime(b + c*d): yield b + c*d
    print(list(islice(agen(), 32))) # Michael S. Branicky, Dec 13 2023