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.

A086040 Prime p concatenated with next 4 primes is also prime.

Original entry on oeis.org

7, 47, 53, 67, 97, 101, 149, 401, 431, 479, 487, 757, 827, 887, 1061, 1171, 1409, 1429, 1543, 1721, 1789, 1811, 1889, 1987, 2099, 2113, 2137, 2273, 2689, 2719, 2857, 3203, 3571, 3613, 3623, 3761, 3853, 3917, 3929, 4007, 4217, 4441, 4943, 5039, 5209, 5281, 5449
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Examples

			a(1) = 7 because 7, 11, 13, 17 and 19 concatenated together yield 711131719, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[800]],5,1],PrimeQ[FromDigits[Flatten[IntegerDigits/@#]]]&][[;;,1]] (* Harvey P. Dale, May 25 2025 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        plst = [2, 3, 5, 7, 11]
        slst = list(map(str, plst))
        while True:
            if isprime(int("".join(slst))):
                yield plst[0]
            plst = plst[1:] + [nextprime(plst[-1])]
            slst = slst[1:] + [str(plst[-1])]
    print(list(islice(agen(), 50))) # Michael S. Branicky, Jan 26 2023

Extensions

Offset corrected by Arkadiusz Wesolowski, May 10 2012
a(15) and beyond from Michael S. Branicky, Jan 26 2023