OFFSET
1,2
COMMENTS
a(n) is even for n > 1.
(k+1)^M-(k-1)^M is divisible by 2 for any n. Thus, if it is a semiprime, then ((k+1)^M-(k-1)^M)/2 must be prime. This is only prime if M is also prime. Thus we may assume M is a prime.
EXAMPLE
(6+1)^(prime(3))-(6-1)^(prime(3)) = 7^5-5^5 = 13682 = 2*6841. Thus a(3) = 6.
MATHEMATICA
lnk[n_]:=Module[{k=1}, While[PrimeOmega[(k+1)^n-(k-1)^n]!=2, k++]; k]; lnk/@Prime[Range[70]] (* Harvey P. Dale, Jun 05 2015 *)
PROG
(PARI) a(n)=for(k=1, 10^4, if(ispseudoprime(((k+1)^prime(n)-(k-1)^prime(n))/2), return(k)))
n=1; while(n<100, print1(a(n), ", "); n+=1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jun 01 2014
STATUS
approved