OFFSET
1,2
EXAMPLE
In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
MATHEMATICA
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All, 2]]>1;
Table[NestWhile[#-1&, n, #>1&&perpowQ[#]&], {n, 100}]
PROG
(Python)
from sympy import mobius, integer_nthroot
def A378363(n):
def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length())))
a = n-f(n)
m, k = a, f(a)+a
while m != k: m, k = k, f(k)+a
return m # Chai Wah Wu, Nov 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 24 2024
STATUS
approved
