A262399 Primes that are the concatenation of n 1's, 2*n and n 1's.
11411, 111181111, 111111011111, 111111111111112811111111111111
Offset: 1
Examples
a(1) = 11411 because the concatenation of 11, 4 and 11 is a prime number. a(2) = 111181111 because the concatenation of 1111, 8 and 1111 is a prime number. a(3) = 111111011111 because the concatenation of 11111, 10 and 11111 is a prime number.
Programs
-
Mathematica
Select[Table[w = Table[1, {k}]; FromDigits@ Join[w, IntegerDigits[2 k], w], {k, 60}], PrimeQ] (* Michael De Vlieger, Sep 21 2015 *) Select[Table[FromDigits[Flatten[Join[{PadRight[{},n,1],IntegerDigits[2n],PadRight[{},n,1]}]]],{n,20}],PrimeQ] (* Harvey P. Dale, Feb 25 2024 *)
-
PARI
for(n=1, 1e3, if(isprime(k=eval(Str((10^n - 1)/9, 2*n, (10^n - 1)/9))), print1(k", ")))
-
Perl
use ntheory ":all"; for my $n (1..1e5) { my $s=join("", "1" x $n, 2*$n, "1" x $n); say $s if is_prob_prime($s); } # Dana Jacobsen, Oct 13 2015
Comments