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

A082756 Larger of a pair of consecutive primes having only prime digits.

Original entry on oeis.org

3, 5, 7, 227, 733, 3257, 3733, 5237, 5333, 7577, 7727, 7757, 22277, 23333, 25537, 27737, 32237, 32327, 32537, 35327, 35537, 37273, 37277, 52237, 52733, 53327, 53353, 53777, 55337, 72227, 72733, 75227, 75533, 75557, 222533, 222553, 222557, 223277, 223757, 225227
Offset: 1

Views

Author

Amarnath Murthy, Apr 18 2003

Keywords

Examples

			227 is a term as the previous prime 223 also has only prime digits.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 0; q = 1; pd = {1}; Do[p = q; pd = qd; q = NextPrim[p]; qd = Union[ Join[{2, 3, 5, 7}, IntegerDigits[q]]]; If[pd == qd == {2, 3, 5, 7}, Print[q]], {n, 1, 20000}]
    Transpose[Select[Partition[Prime[Range[20000]],2,1],And@@PrimeQ[ Flatten[ IntegerDigits/@#]]&]] [[2]] (* Harvey P. Dale, Jul 19 2011 *)
  • Python
    from sympy import nextprime, isprime
    from itertools import count, islice, product
    def onlypd(n): return set(str(n)) <= set("2357")
    def agen():
        yield from [3, 5, 7]
        for digits in count(2):
            for p in product("2357", repeat=digits-1):
                for end in "37":
                    t = int("".join(p) + end)
                    if isprime(t):
                        t2 = nextprime(t)
                        if onlypd(t2):
                            yield t2
    print(list(islice(agen(), 40))) # Michael S. Branicky, Mar 11 2022

Extensions

Edited and extended by Robert G. Wilson v, Apr 22 2003
a(38) and beyond from Michael S. Branicky, Mar 11 2022

A343471 Start of the first run of n or more consecutive primes using only prime digits.

Original entry on oeis.org

2, 2, 2, 2, 2575723, 7533777323, 277535577223, 5323733533375237, 57552737757357223
Offset: 1

Views

Author

Metin Sariyar, Apr 16 2021

Keywords

Comments

This is a variant of A352312. - Bernard Schott, Mar 24 2022

Examples

			a(1) = 2 because it is the first prime using only prime digits.
a(2) = 2 because 2, 3 is the first pair of consecutive primes using only prime digits.
a(5) = 2575723 because 2575723, 2575733, 2575753, 2575757, 2575777 is the first run of 5 consecutive primes using only prime digits.
		

Crossrefs

Programs

  • Python
    from sympy import nextprime, isprime
    from itertools import count, islice, product
    def onlypd(n): return set(str(n)) <= set("2357")
    def agen():
        adict = {i:2 for i in range(1, 5)}
        for i in range(1, 5): yield 2
        for digits in count(2):
            for p in product("2357", repeat=digits-1):
                for end in "37":
                    t0 = t = int("".join(p) + end)
                    run = 0
                    while isprime(t):
                        run += 1
                        t = nextprime(t)
                        if not onlypd(t): break
                    if run not in adict:
                        for r in range(max(adict)+1, run+1):
                            adict[r] = t0
                            yield t0
    print(list(islice(agen(), 6))) # Michael S. Branicky, Mar 11 2022

Extensions

a(8) from Daniel Suteu, Apr 22 2021
a(9) from Michael S. Branicky, Mar 15 2022

A352312 Start of the first run of exactly n consecutive primes using only prime digits.

Original entry on oeis.org

7, 223, 37253, 2, 2575723, 7533777323, 277535577223, 5323733533375237, 57552737757357223
Offset: 1

Views

Author

Bernard Schott, Mar 11 2022

Keywords

Comments

This is a variant of A343471.

Examples

			a(1) = 7 because it is the first prime using only prime digits and whose next prime 11 does not use only prime digits.
a(3) = 37253 because 37253, 37273, 37277 is the first run of 3 consecutive primes using only prime digits, then next prime 37307 has a digit 0.
		

Crossrefs

Subsequence of A019546.

Programs

  • Python
    from sympy import nextprime, isprime
    from itertools import count, islice, product
    def onlypd(n): return set(str(n)) <= set("2357")
    def agen():
        adict, n = {1:7, 4:2}, 1
        yield 7
        for digits in count(2):
            for p in product("2357", repeat=digits-1):
                for end in "37":
                    t0 = t = int("".join(p) + end)
                    run = 0
                    while isprime(t):
                        run += 1
                        t = nextprime(t)
                        if not onlypd(t): break
                    if run not in adict:
                        adict[run] = t0
                        if run > n:
                            for r in range(n+1, run+1):
                                if r in adict:
                                    yield adict[r]
                                    n += 1
    print(list(islice(agen(), 6))) # Michael S. Branicky, Mar 11 2022

Extensions

a(9) from Michael S. Branicky, Mar 15 2022
Showing 1-3 of 3 results.