login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A306861
The concatenation kpk is the number obtained by placing k leading and trailing 1's around the prime p; a(n) is the smallest k such that kpk is prime, where p = prime(n), or -1 if no such k exists.
2
-1, 1, 1, 3, -1, 3, 1, 21, 1, 1, 2, -1, 3, 2, 1, 1, 42, 14, 3, 73, 3, 2, 1, 4, 3, -1, 2, 1, 3, 1, 3, 1, 3, 3, 1, 6, 2, 3, 192, 1, 4, 3, 3, 8, 1, 9, 36, 5, 12, 5, 18, 1, 26, 1, 16, 10, 15, 2, 72, 22, 3, 4, 2, 4, 5, 1, 12, 5, 13, 3, 9, 1, 6, 60, 2, 1, 58
OFFSET
1,4
COMMENTS
For p = 2,11,37,101 kpk is composite for all k, hence a(n) = -1.
For p = 397 (n=78), 563, 739, 1249, ... no k (<= 12000) has yet been found such that kpk is prime, but also there is no proof yet that k does not exist.
If p = prime(n) is an odd repunit prime, a(n) is half the difference in repunit length between p and the next repunit prime.
Conjecture: There are infinitely many -1 terms in this sequence.
This is a subsequence of A272232. - Hans Havermann, May 17 2022
LINKS
Hans Havermann, Prime sandwiches (includes a link to a table giving particulars for all primes <10^5)
EXAMPLE
a(1) = -1 because k2k is divisible by the (k+1)-th repunit for all k. The same argument applies to a(26) (p=101). a(2)=1 since 131 is prime, a(3)=1 since 151 is prime, a(4)=3 since 1117111 is prime. a(5)=-1 because k11k is always divisible by 11.
a(12) = -1 because the factor cycle for k37k comprises a covering congruence as follows: k==1 (mod 3)-->3|k37k; k==2 (mod 3)--> 13|k37k; k==3 (mod 3)--> 37|p37p.
For a(78) (p=397) no k (up to 30000) has been found such that kpk is prime.
MAPLE
Wrapped_prime := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k to N do m0 := add(10^i, i = 0 .. k-1); m := m0+10^k*p+10^(k+n)*m0; if isprime(m) then return k end if end do end proc
Wrapped_prime(p). #Enter a value for p in this line and the code will calculate the first k for which kpk is prime (up to a max value of N, which can be chosen arbitrarily).
CROSSREFS
KEYWORD
sign,base,more
AUTHOR
STATUS
approved