OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..150
EXAMPLE
5^1 = 5 = 2 + 3, 6^2 = 36 = 17 + 19, 2^3 = 8 = 3 + 5, 150^4 =506250000 = 253124999 + 253125001.
MATHEMATICA
a[n_] := For[m = 2, True, m++, p = m^n/2 // NextPrime[#, -1]&; q = NextPrime[p]; If[p + q == m^n, Print["a(", n, ") = ", m]; Return[m]]]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Jun 10 2013 *)
tsp[n_]:=Module[{m=1, t}, t=m^n; While[NextPrime[t/2]+NextPrime[t/2, -1]! = t, m++; t=m^n]; m]; Array[tsp, 50] (* Harvey P. Dale, Nov 10 2014 *)
PROG
(PARI) a(n)=if(n==1, return(5)); my(m=1, M, p); while(1, M=m++^n; p=precprime(M/2); ispseudoprime(M-p) && M-p==nextprime(M/2) && return(m)) \\ Charles R Greathouse IV, Jun 10 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 09 2013
EXTENSIONS
a(41)-a(50) from Jean-François Alcover, Jun 10 2013
STATUS
approved