login
Numbers k such that R_(k+2) + 10^k is prime, where R_k = 11...1 is the repunit (A002275) of length k.
0

%I #22 Sep 08 2022 08:46:12

%S 136,184,640,37960,217360

%N Numbers k such that R_(k+2) + 10^k is prime, where R_k = 11...1 is the repunit (A002275) of length k.

%C Also, numbers k such that (109*10^k - 1)/9 is prime.

%C Terms from Kamada.

%C a(6) > 250000.

%C Numbers k such that 12 followed by k ones is prime. - _Harvey P. Dale_, Jan 30 2022

%H Makoto Kamada, <a href="https://stdkmd.net/nrr/abaaa.htm">Near-repdigit numbers of the form ABAA...AA</a>.

%H Makoto Kamada, <a href="https://stdkmd.net/nrr/1/12111.htm#prime">Prime numbers of the form 1211...11</a>.

%H <a href="/index/Pri#Pri_rep">Index entries for primes involving repunits</a>.

%t Select[Range[0, 250000], PrimeQ[(109*10^#-1)/9 ] &]

%t Select[Range[700],PrimeQ[FromDigits[PadRight[{1,2},#,1]]]&]-2 (* The program generates the first 3 terms of the sequence. To generate more, increase the Range constant but the program may take a long time to run. *) (* _Harvey P. Dale_, Jan 30 2022 *)

%o (Magma) [n: n in [0..300] | IsPrime((109*10^n-1) div 9)]; // _Vincenzo Librandi_, Apr 14 2015

%o (PARI) for(n=0,700,if(isprime((109*10^n-1)/9),print1(n,", "))) \\ _Derek Orr_, Apr 14 2015

%Y Cf. A002275.

%K more,hard,nonn

%O 1,1

%A _Robert Price_, Apr 13 2015