A065083 The least k such that precisely n near-repunit primes can be formed from (10^k-1)/9 by changing one digit from 1 to 0.
1, 3, 8, 24, 20, 12, 488, 42, 162, 4848, 642, 1682
Offset: 0
Examples
a(5) = 12 because R_12 = (10^12 -1)/9 = 111111111111 and from this number, by changing just one digit from 1 to 0, out of the eleven candidates, 111111111101, 111111110111, 111111011111, 111011111111 and 101111111111 are primes.
Links
- Chris Caldwell, Below are all of the 12-digit Near-Repunit primes:
- Chris Caldwell, Repunits
Programs
-
Mathematica
a = Table[0, {10} ]; Do[p = IntegerDigits[ (10^n - 1)/9]; c = 0; Do[ If[ q = FromDigits[ ReplacePart[p, 0, i]]; PrimeQ[q], c++ ], {i, 2, n} ]; If[ a[[c + 1]] == 0, a[[c + 1]] = n], {n, 1, 400} ]; a
-
PARI
a(n)=my(k=1);while(sum(i=1,k-2,ispseudoprime(10^k\9-10^i)) != n, k++); k \\ Charles R Greathouse IV, May 01 2012
Extensions
a(6) from Charles R Greathouse IV, May 01 2012
a(9) from Robert Price, Nov 04 2023
a(10)-a(11) from comments and verified by Robert Price, Nov 04 2023
Comments