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 A375706 #23 Jan 19 2025 20:49:47 %S A375706 1,2,1,1,3,1,1,1,1,1,2,1,1,1,1,1,1,1,2,2,1,1,1,2,1,1,2,1,1,1,1,1,1,1, %T A375706 1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, %U A375706 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,2 %N A375706 First differences of non-perfect-powers. %C A375706 Non-perfect-powers (A007916) are numbers without a proper integer root. %H A375706 Antti Karttunen, <a href="/A375706/b375706.txt">Table of n, a(n) for n = 1..100000</a> %F A375706 a(n) = A007916(n+1) - A007916(n). %e A375706 The 5th non-perfect-power is 7, and the 6th is 10, so a(5) = 3. %t A375706 radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1; %t A375706 Differences[Select[Range[100],radQ]] %o A375706 (Python) %o A375706 from itertools import count %o A375706 from sympy import mobius, integer_nthroot, perfect_power %o A375706 def A375706(n): %o A375706 def f(x): return int(n+1-sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length()))) %o A375706 m, k = n, f(n) %o A375706 while m != k: m, k = k, f(k) %o A375706 return next(i for i in count(m+1) if not perfect_power(i))-m # _Chai Wah Wu_, Sep 09 2024 %o A375706 (PARI) %o A375706 up_to = 112; %o A375706 A375706list(up_to) = { my(v=vector(up_to), pk=2, k=2, i=0); while(i<#v, k++; if(!ispower(k), i++; v[i] = k-pk; pk = k)); (v); }; %o A375706 v375706 = A375706list(up_to); %o A375706 A375706(n) = v375706[n]; \\ _Antti Karttunen_, Jan 19 2025 %Y A375706 For prime-powers (A000961) we have A057820. %Y A375706 For perfect powers (A001597) we have A053289. %Y A375706 For nonprime numbers (A002808) we have A073783. %Y A375706 For squarefree numbers (A005117) we have A076259. %Y A375706 First differences of A007916. %Y A375706 For nonsquarefree numbers (A013929) we have A078147. %Y A375706 For non-prime-powers (A024619) we have A375708. %Y A375706 Positions of 1s are A375740, complement A375714. %Y A375706 Runs of non-perfect-powers: %Y A375706 - length: A375702 = A053289(n+1) - 1 %Y A375706 - first: A375703 (same as A216765 with 2 exceptions) %Y A375706 - last: A375704 (same as A045542 with 8 removed) %Y A375706 - sum: A375705 %Y A375706 Cf. A000040, A046933, A052410, A303707, A305630, A305631, A323054, A323088, A323090, A375736. %K A375706 nonn %O A375706 1,2 %A A375706 _Gus Wiseman_, Aug 31 2024 %E A375706 More terms from _Antti Karttunen_, Jan 19 2025