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
David James Sycamore, Mar 14 2019
STATUS
approved