A307873 The concatenation pkp is the number obtained by placing prime p either side of R_k, the k-th repunit (1, k times); a(n) is the smallest k such that pkp is prime, where p=prime(n), or -1 if no such k exists.
-1, 1, -1, 10905, 15, 2, 1, 2, 3, 1, 3, 173, 1, 14, 1, 43, 1, 5, 11, 1, 2, 3, 3, 1, 2, -1, 5, 421, 3, 1, -1, 1, 1, 3, -1, 15, -1, 3, 3, 163, -1, 3, 13, -1, 679, -1, 5, 5, -1, 107, 93, 1, -1, 3, -1, 1, -1, 9, 5, -1, -1, 9, 1089, -1, 3, 7, 3, 15, -1, 27, -1, 1, -1, 27, 17, 25, 1, 15, 3
Offset: 1
Examples
2/2k2, 5/5k5, 7/101k101, 11,13/127k127, 11/149k149, for all k, so a(1)=a(3)=a(26)= a(31)=a(35)=-1. For prime(n)=A004023(2)=R_19, a(n)=R_(317-2*19)=R_279.
Programs
-
Maple
P(p) := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k from 1 to N do m0 := add(10^i, i = 0 .. k-1); m := p*10^(k+n)+m0*10^n+p; if isprime(m) then return k end if; if `mod`(k, 1000) = 0 then print(k) end if end do end proc; P(p) # substitute a prime p here to run the code, it produces an answer (k) if one exists <=N and terms must be computed one at a time.
Formula
If prime(n) is a repunit prime R_k, for some k in A004023 and R_t is the smallest repunit prime such that t > 2*k, then a(n)=R_(t-2*k).
Comments