OFFSET
1,15
COMMENTS
Prime powers allowing 1 are listed by A000961.
EXAMPLE
The greatest prime power <= 6 is 5, so a(6) = 1.
MATHEMATICA
Table[n-NestWhile[#-1&, n, #>1&&!PrimePowerQ[#]&], {n, 100}]
CROSSREFS
Sequences obtained by subtracting each term from n are placed in parentheses below.
Subtracting from n gives (A031218).
For squarefree we have (A070321).
Adding one gives A276781.
For nonsquarefree we have (A378033).
For non perfect power we have (A378363).
A000015 gives the least prime power >= n.
KEYWORD
nonn,new
AUTHOR
Gus Wiseman, Nov 29 2024
STATUS
approved