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 A376562 #10 Oct 02 2024 11:36:48 %S A376562 1,-1,0,2,-2,0,0,0,0,1,-1,0,0,0,0,0,0,1,0,-1,0,0,1,-1,0,1,-1,0,0,0,0, %T A376562 0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0, %U A376562 0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 %N A376562 Second differences of consecutive non-perfect-powers (A007916). First differences of A375706. %C A376562 Non-perfect-powers (A007916) are numbers without a proper integer root. %e A376562 The non-perfect powers (A007916) are: %e A376562 2, 3, 5, 6, 7, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, ... %e A376562 with first differences (A375706): %e A376562 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, ... %e A376562 with first differences (A376562): %e A376562 1, -1, 0, 2, -2, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 1, -1, 0, ... %t A376562 radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1; %t A376562 Differences[Select[Range[100],radQ],2] %o A376562 (Python) %o A376562 from itertools import count %o A376562 from sympy import mobius, integer_nthroot, perfect_power %o A376562 def A376562(n): %o A376562 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 A376562 m, k = n, f(n) %o A376562 while m != k: m, k = k, f(k) %o A376562 r = m+((k:=next(i for i in count(1) if not perfect_power(m+i)))<<1) %o A376562 return next(i for i in count(1-k) if not perfect_power(r+i)) # _Chai Wah Wu_, Oct 02 2024 %Y A376562 The version for A000002 is A376604, first differences of A054354. %Y A376562 For first differences we had A375706, ones A375740, complement A375714. %Y A376562 Positions of zeros are A376588, complement A376589. %Y A376562 Runs of non-perfect-powers: %Y A376562 - length: A375702 = A053289(n+1) - 1 %Y A376562 - first: A375703 (same as A216765 with 2 exceptions) %Y A376562 - last: A375704 (same as A045542 with 8 removed) %Y A376562 - sum: A375705 %Y A376562 A000961 lists prime-powers inclusive, exclusive A246655. %Y A376562 A007916 lists non-perfect-powers, complement A001597. %Y A376562 A112344 counts integer partitions into perfect-powers, factorizations A294068. %Y A376562 A333254 gives run-lengths of differences between consecutive primes. %Y A376562 For non-perfect-powers: A375706 (first differences), A376588 (inflections and undulations), A376589 (nonzero curvature). %Y A376562 For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power inclusive), A376599 (non-prime-power inclusive). %Y A376562 Cf. A025475, A052410, A053707, A064113, A069623, A093555, A174965, A182853, A336416, A336417, A361102. %K A376562 sign %O A376562 1,4 %A A376562 _Gus Wiseman_, Oct 01 2024