This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A378358 #24 Apr 25 2025 21:10:16 %S A378358 2,2,3,5,5,6,7,10,10,10,11,12,13,14,15,17,17,18,19,20,21,22,23,24,26, %T A378358 26,28,28,29,30,31,33,33,34,35,37,37,38,39,40,41,42,43,44,45,46,47,48, %U A378358 50,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,65,66,67 %N A378358 Least non-perfect-power >= n. %C A378358 Perfect-powers (A001597) are 1 and numbers with a proper integer root, complement A007916. %F A378358 a(n) = n - A378357(n). %t A378358 perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; %t A378358 Table[NestWhile[#+1&,n,perpowQ[#]&],{n,100}] %o A378358 (Python) %o A378358 from sympy import mobius, integer_nthroot %o A378358 def A378358(n): %o A378358 def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length()))) %o A378358 a = max(1,n-f(n-1)) %o A378358 m, k = a, f(a)+a %o A378358 while m != k: m, k = k, f(k)+a %o A378358 return m # _Chai Wah Wu_, Nov 26 2024 %o A378358 (Python) %o A378358 from sympy import perfect_power %o A378358 def A378358(n): return n if n>1 and perfect_power(n)==False else n+1 if perfect_power(n+1)==False else n+2 # _Chai Wah Wu_, Nov 27 2024 %Y A378358 The version for prime-powers is A000015, for non-prime-powers A378372. %Y A378358 The union is A007916, complement A001597. %Y A378358 The version for nonsquarefree numbers is A067535, negative A120327 (subtract A378369). %Y A378358 The version for composite numbers is A113646. %Y A378358 The version for prime numbers is A159477. %Y A378358 The run-lengths are A375706. %Y A378358 Terms appearing only once are A375738, multiple times A375703. %Y A378358 The version for perfect-powers is A377468. %Y A378358 Subtracting from n gives A378357. %Y A378358 The opposite version is A378363, for perfect-powers A081676. %Y A378358 A000040 lists the primes, differences A001223. %Y A378358 A000961 lists the powers of primes, differences A057820. %Y A378358 A001597 lists the perfect-powers, differences A053289. %Y A378358 A007916 lists the non-perfect-powers, differences A375706. %Y A378358 A069623 counts perfect-powers <= n. %Y A378358 A076411 counts perfect-powers < n. %Y A378358 A131605 lists perfect-powers that are not prime-powers. %Y A378358 A377432 counts perfect-powers between primes, zeros A377436. %Y A378358 Cf. A007918, A014210, A031218, A045542, A052410, A065514, A070321, A076412, A188951, A216765, A345531, A378033. %K A378358 nonn %O A378358 1,1 %A A378358 _Gus Wiseman_, Nov 24 2024