login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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) = A000015(n) - A031218(n);
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];
Array[a, 100] (* Jean-François Alcover, Dec 02 2021 *)
PROG
(PARI)
A000015(n) = if(1==n, n, while(!isprimepower(n), n++); n);
A031218(n) = if(1==n, n, while(!isprimepower(n), n--); n);
A097106(n) = (A000015(n) - A031218(n)); \\ Antti Karttunen, Sep 23 2018
CROSSREFS
Sequence in context: A087893 A079169 A345060 * A175801 A361250 A165619
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Sep 15 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 15 03:01 EDT 2024. Contains 375172 sequences. (Running on oeis4.)