A263299 Primes that are the concatenation of k 1's, the digits of k^2 + k + 1, and k 1's.
131, 11113111, 1111211111, 111113111111, 11111143111111, 11111111111111111111111
Offset: 1
Examples
131 is in the list because 131 is a concatenation of 1, (1^2 + 1 + 1) = 3 and 1, and because 131 is prime.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..8
Programs
-
Mathematica
Select[FromDigits/@Table[Join[PadRight[{},n,1],IntegerDigits[n^2+n+1],PadRight[{},n,1]],{n,20}],PrimeQ] (* Harvey P. Dale, Jan 27 2019 *)
-
PARI
for(n=1, 1e3, if(isprime(k=eval(Str((10^n - 1)/9, n^2 + n + 1, (10^n - 1)/9))), print1(k", ")))
-
Python
from gmpy2 import is_prime A263299_list = [n for n in (int('1'*k+str(k*(k+1)+1)+'1'*k) for k in range(10**2)) if is_prime(n)] # Chai Wah Wu, Oct 19 2015
Comments