This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A306861 #39 May 18 2022 08:30:04 %S A306861 -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, %T A306861 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, %U A306861 22,3,4,2,4,5,1,12,5,13,3,9,1,6,60,2,1,58 %N 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. %C A306861 For p = 2,11,37,101 kpk is composite for all k, hence a(n) = -1. %C A306861 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. %C A306861 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. %C A306861 Conjecture: There are infinitely many -1 terms in this sequence. %C A306861 This is a subsequence of A272232. - _Hans Havermann_, May 17 2022 %H A306861 Hans Havermann, <a href="http://gladhoboexpress.blogspot.com/2019/05/prime-sandwiches-made-with-one-derbread.html">Prime sandwiches</a> (includes a link to a table giving particulars for all primes <10^5) %e A306861 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. %e A306861 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. %e A306861 For a(78) (p=397) no k (up to 30000) has been found such that kpk is prime. %p A306861 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 %p A306861 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). %Y A306861 Cf. A002275, A004022, A069687, A272232. %K A306861 sign,base,more %O A306861 1,4 %A A306861 _David James Sycamore_, Mar 14 2019