OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
MATHEMATICA
sp[n_] := If[n == 1, 1, Module[{m = n}, While[!PrimePowerQ[m], m++]; m]];
gp[n_] := If[n == 1, 1, Module[{m = n}, While[!PrimePowerQ[m], m--]; m]];
a[n_] := sp[n] - gp[n];
Array[a, 100] (* Jean-François Alcover, Dec 02 2021 *)
PROG
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Sep 15 2004
STATUS
approved