A210513 Primes formed by concatenating k, k, and 7.
227, 337, 557, 887, 997, 11117, 24247, 26267, 27277, 29297, 30307, 32327, 39397, 48487, 51517, 54547, 60607, 62627, 65657, 68687, 69697, 72727, 74747, 78787, 81817, 87877, 89897, 90907, 92927, 93937, 95957, 101710177, 101910197, 103110317, 103410347, 103810387
Offset: 1
Examples
For k = 2, a(1) = 227. For k = 3, a(2) = 337. For k = 5, a(3) = 557. For k = 8, a(4) = 887. For k = 9, a(5) = 997.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[Table[FromDigits[Flatten[{IntegerDigits[n], IntegerDigits[n], {7}}]], {n, 100}], PrimeQ] (* Alonso del Arte, Feb 01 2013 *)
-
Python
import numpy as np from functools import reduce def factors(n): return reduce(list._add_, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)) for i in range(1, 2000): p1=int(str(i)+str(i)+"7") if len(factors(p1))<3: print(p1, end=',')
-
Python
from sympy import isprime from itertools import count, islice def agen(): yield from filter(isprime, (int(str(k)+str(k)+'7') for k in count(1))) print(list(islice(agen(), 36))) # Michael S. Branicky, Jul 26 2022
Extensions
a(34) and beyond from Michael S. Branicky, Jul 26 2022
Comments