|
|
A097106
|
|
a(n) = (Smallest prime power >= n) - (greatest prime power <= n).
|
|
2
|
|
|
0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 3, 3, 0, 0, 2, 0, 4, 4, 4, 0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 5, 5, 5, 5, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 2, 0, 3, 3, 0, 3, 3, 0, 4, 4, 4, 0, 2, 0, 6, 6, 6, 6, 6, 0, 2, 0, 2, 0, 6, 6, 6, 6, 6, 0, 8, 8, 8, 8, 8, 8, 8, 0, 4, 4, 4, 0, 2, 0, 4, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 0 iff n is a power of a prime (in A000961).
|
|
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];
|
|
PROG
|
(PARI)
A000015(n) = if(1==n, n, while(!isprimepower(n), n++); n);
A031218(n) = if(1==n, n, while(!isprimepower(n), n--); n);
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|