login
Numbers k such that R(k) - 10^floor(k/2-1) is prime, where R(k) = (10^k-1)/9 (repunit: A002275).
6

%I #30 Jul 23 2024 08:38:29

%S 8,12,17,20,24,42,1124,1169,1538,7902,27617,29684

%N Numbers k such that R(k) - 10^floor(k/2-1) is prime, where R(k) = (10^k-1)/9 (repunit: A002275).

%C The corresponding primes are a subsequence of A065074: near-repunit primes that contain the digit 0.

%C In base 10, R(k) - 10^floor(k/2-1) has ceiling(k/2) digits 1, one digit 0 and again floor(k/2-1) digits 1: for even as well as odd k, there is a digit 0 just right of the middle of the repunit of length k.

%C No term can be congruent to 1 (mod 3). - _Chai Wah Wu_, Feb 07 2020

%C a(13) > 50000. - _Michael S. Branicky_, Jul 23 2024

%e For k = 8, R(8) - 10^(4-1) = 11110111 is prime.

%e For k = 12, R(12) - 10^(6-1) = 111111011111 is prime.

%e For k = 17, R(12) - 10^(8-1) = 11111111101111111 is prime.

%o (PARI) for(n=2,9999,isprime(p=10^n\9-10^(n\2-1))&&print1(n","))

%Y Cf. A002275 (repunits), A011557 (powers of 10), A065074 (near-repunit primes that contain the digit 0), A138148 (Cyclop numbers with digits 0 & 1).

%Y Cf. A331862 (variant with floor(n/2) instead of floor(n/2-1)), A331860 (variant with + (digit 2) instead of - (digit 0)).

%K nonn,hard,more,base

%O 1,1

%A _M. F. Hasler_, Jan 30 2020

%E a(7)-a(10) from _Giovanni Resta_, Jan 31 2020

%E a(11)-a(12) from _Michael S. Branicky_, Jul 22 2024