A030471 Primes which are concatenations of four consecutive numbers.
4567, 14151617, 20212223, 34353637, 58596061, 64656667, 118119120121, 140141142143, 148149150151, 176177178179, 196197198199, 218219220221, 220221222223, 236237238239, 238239240241, 268269270271, 278279280281
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Zak Seidov)
Programs
-
Mathematica
A279204[n_] := FromDigits[Flatten[IntegerDigits[Range[n, n + 3]]]]; Select[Array[A279204, 500], PrimeQ] (* Paolo Xausa, Aug 26 2024 *)
-
PARI
lista(nn) = for(n=1, nn, if (isprime(q=eval(concat(concat(concat(Str(n), Str(n+1)), Str(n+2)), Str(n+3)))), print1(q, ", "))); \\ Michel Marcus, Oct 26 2014
-
Python
from sympy import isprime from itertools import count, islice def agen(): # generator of terms strs = ["1", "2", "3", "4"] for k in count(1): if isprime(t:=int("".join(strs))): yield t strs = strs[1:] + [str(k+4)] print(list(islice(agen(), 20))) # Michael S. Branicky, Aug 26 2024
Extensions
Edited by Charles R Greathouse IV, Apr 23 2010
Comments