OFFSET
1,4
COMMENTS
Primes (from above data) for which pkp is composite for all k are 2, 5, 101, 127, 149, 157, 179, 193, 199, 227, 241, 257, 269, 281, 283, 311, 347, 353, 367. In every case the factorization of pkp contains at least one characteristic prime divisor (very different from A306861).
Conjecture: There are an infinite number of -1 terms in this sequence.
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).
EXAMPLE
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.
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.
CROSSREFS
KEYWORD
sign,base
AUTHOR
David James Sycamore, May 02 2019
STATUS
approved