OFFSET
1,1
FORMULA
a(n) = n - A3783587(n).
MATHEMATICA
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All, 2]]>1;
Table[NestWhile[#+1&, n, perpowQ[#]&], {n, 100}]
CROSSREFS
The version for composite numbers is A113646.
The version for prime numbers is A159477.
The run-lengths are A375706.
The version for perfect-powers is A377468.
Subtracting n gives A378357.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
KEYWORD
nonn,new
AUTHOR
Gus Wiseman, Nov 24 2024
STATUS
approved