A378363 Greatest number <= n that is 1 or not a perfect-power.
1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 12, 13, 14, 15, 15, 17, 18, 19, 20, 21, 22, 23, 24, 24, 26, 26, 28, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67
Offset: 1
Examples
In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
Crossrefs
Programs
-
Mathematica
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; Table[NestWhile[#-1&,n,#>1&&perpowQ[#]&],{n,100}]
-
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
Comments