login
A094787
a(n) = smallest prime p such that p + n is a perfect power m^k, k >= 2.
1
3, 2, 5, 5, 3, 2, 2, 17, 7, 17, 5, 13, 3, 2, 17, 11, 19, 7, 13, 5, 11, 3, 2, 3, 2, 23, 5, 53, 3, 2, 5, 17, 3, 2, 29, 13, 107, 11, 61, 41, 23, 7, 101, 5, 19, 3, 2, 73, 79, 31, 13, 29, 11, 67, 73, 113, 7, 23, 5, 61, 3, 2, 37, 17, 79, 59, 61, 13, 31, 11, 29, 53, 71, 7, 53, 5, 23, 3, 2, 41, 19
OFFSET
1,1
COMMENTS
Conjecture: every prime is contained in this sequence.
EXAMPLE
2+8=10, 3+8=11, 5+8=13, 7+8=15, 11+8=19, 13+8, 17+8=25. 17 is the first prime that when added to 8 gives a perfect power, viz. 25.
MAPLE
A094787 := proc(n)
local i ;
for i from 1 do
if isA001597(ithprime(i)+n) then
return ithprime(i) ;
end if;
end do:
end proc:
seq(A094787(n), n=1..40) ; # R. J. Mathar, Nov 15 2019
PROG
(PARI) k(n, m) = for(j=1, m, forprime(x=2, n, if(ispower(x+j), print1(x", "); break))) ispower(n) = { local(p, r, j); r = sqrt(n); for(j=2, floor(r), p = floor(log(n)/log(j)+.5); if(j^p ==n, return(1)); ); return(0) }
(Magma) a:=[]; for n in [1..81] do p:=2; while not IsPower(p+n) do p:=NextPrime(p); end while; Append(~a, p); end for; a; // Marius A. Burtea, Nov 15 2019
CROSSREFS
Sequence in context: A369992 A124732 A167552 * A132778 A182289 A127738
KEYWORD
nonn
AUTHOR
Cino Hilliard, Jun 10 2004
EXTENSIONS
Offset corrected by R. J. Mathar, Nov 15 2019
STATUS
approved