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.

This page as a plain text file.
%I A086040 #16 Jun 08 2025 16:15:42
%S A086040 7,47,53,67,97,101,149,401,431,479,487,757,827,887,1061,1171,1409,
%T A086040 1429,1543,1721,1789,1811,1889,1987,2099,2113,2137,2273,2689,2719,
%U A086040 2857,3203,3571,3613,3623,3761,3853,3917,3929,4007,4217,4441,4943,5039,5209,5281,5449
%N A086040 Prime p concatenated with next 4 primes is also prime.
%H A086040 Michael S. Branicky, <a href="/A086040/b086040.txt">Table of n, a(n) for n = 1..10000</a>
%e A086040 a(1) = 7 because 7, 11, 13, 17 and 19 concatenated together yield 711131719, which is prime.
%t A086040 Select[Partition[Prime[Range[800]],5,1],PrimeQ[FromDigits[Flatten[IntegerDigits/@#]]]&][[;;,1]] (* _Harvey P. Dale_, May 25 2025 *)
%o A086040 (Python)
%o A086040 from itertools import islice
%o A086040 from sympy import isprime, nextprime
%o A086040 def agen(): # generator of terms
%o A086040     plst = [2, 3, 5, 7, 11]
%o A086040     slst = list(map(str, plst))
%o A086040     while True:
%o A086040         if isprime(int("".join(slst))):
%o A086040             yield plst[0]
%o A086040         plst = plst[1:] + [nextprime(plst[-1])]
%o A086040         slst = slst[1:] + [str(plst[-1])]
%o A086040 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Jan 26 2023
%Y A086040 Cf. A030459, A030468, A030472, A086041.
%K A086040 base,nonn
%O A086040 1,1
%A A086040 _Chuck Seggelin_, Jul 07 2003
%E A086040 Offset corrected by _Arkadiusz Wesolowski_, May 10 2012
%E A086040 a(15) and beyond from _Michael S. Branicky_, Jan 26 2023