A272232 Smallest k > 0 such that R_k//n//R_k is prime, where R_k is the repunit A002275(k) of length k and // denotes concatenation; or -1 if no such k exists.
1, 9, -1, 1, 2, 1, 10, 3, 1, 1, 3, -1, 2, 3, 33, 1, 2, 1, 1, 21, 1, 2, -1, 1, 7, 48, 292, 4, 3, 1, 1, 2, 1, -1, 135, -1, 1, -1, 1, 34, 3, 3, 40, 2, -1, 1, 3, 1, 1, 32, 61, 1, 2, 1, 137, -1, 3, 1, 2, 42, 1, 14, 1, 262, 2, 22, -1, 3, 9, 2, 33, 73, 1, 3, 1, 2, 3, -1, 2, 2, 1
Offset: 0
Examples
a(0) = 1 since 101 is prime; a(1) refers to the prime 1111111111111111111. a(124) = -1 because R_k//124//R_k is divisible by 125*10^k-1.
Links
- Hans Havermann, Table of n, a(n) for n = 0..139
Programs
-
Mathematica
Table[SelectFirst[Range[10^4], PrimeQ@ FromDigits@ Flatten@ {#, IntegerDigits@ n, #} &@ Table[1, {#}] &], {n, 0, 91}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, Apr 25 2016, Version 10.2 *)
-
PARI
a(n) = my(k=1); while(!ispseudoprime(eval(Str((10^k-1)/9, n, (10^k-1)/9))), k++); k
Extensions
a(35)-a(80) from Giovanni Resta, May 01 2016
Escape clausae value changed to -1 by N. J. A. Sloane, May 17 2022
Comments