OFFSET
1,8
COMMENTS
FORMULA
a(n) = n - A378358(n).
MATHEMATICA
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All, 2]]>1;
Table[NestWhile[#+1&, n, #>1&&perpowQ[#]&]-n, {n, 100}]
PROG
(Python)
from sympy import perfect_power
def A378357(n): return 0 if n>1 and perfect_power(n)==False else 1 if perfect_power(n+1)==False else 2 # Chai Wah Wu, Nov 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 24 2024
STATUS
approved