login
A301295
Smallest distance from n to a prime power (as defined in A000961).
3
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2
OFFSET
1,21
LINKS
PROG
(PARI) A301295(n) = if(1==n, 0, my(k=0); while(!isprimepower(n+k) && !isprimepower(n-k), k++); (k)); \\ Antti Karttunen, Sep 25 2018
CROSSREFS
There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2).
Identical to A080732 except here a(1)=0.
Cf. also A051699, A175851.
Sequence in context: A338757 A080733 A080732 * A215036 A294448 A088568
KEYWORD
nonn,look
AUTHOR
N. J. A. Sloane, Mar 24 2018
EXTENSIONS
More terms from Antti Karttunen, Sep 25 2018
STATUS
approved