A378457 Difference between n and the greatest prime power <= n, allowing 1.
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 0, 1, 2, 3, 4
Offset: 1
Keywords
Examples
The greatest prime power <= 6 is 5, so a(6) = 1.
Crossrefs
Programs
-
Mathematica
Table[n-NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]
Comments