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 A376559 #20 Oct 02 2024 14:24:36 %S A376559 1,-3,6,2,-7,3,-1,9,2,2,2,2,-17,-1,13,9,2,-7,-11,9,-5,20,2,-16,-1,21, %T A376559 2,2,-15,-11,30,2,2,2,2,2,2,2,-22,-15,41,2,2,2,-36,3,37,2,2,2,-34,-11, %U A376559 49,2,2,-66,45,3,-61,2,83,2,2,2,2,-63,25,42,2,-9,-89 %N A376559 Second differences of consecutive perfect powers (A001597). First differences of A053289. %C A376559 Perfect-powers A007916 are numbers with a proper integer root. %C A376559 Does this sequence contain zero? %e A376559 The perfect powers (A001597) are: %e A376559 1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, ... %e A376559 with first differences (A053289): %e A376559 3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, ... %e A376559 with first differences (A376559): %e A376559 1, -3, 6, 2, -7, 3, -1, 9, 2, 2, 2, 2, -17, -1, 13, 9, 2, -7, -11, 9, -5, 20, ... %t A376559 perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; %t A376559 Differences[Select[Range[1000],perpowQ],2] %o A376559 (Python) %o A376559 from sympy import mobius, integer_nthroot %o A376559 def A376559(n): %o A376559 def bisection(f,kmin=0,kmax=1): %o A376559 while f(kmax) > kmax: kmax <<= 1 %o A376559 while kmax-kmin > 1: %o A376559 kmid = kmax+kmin>>1 %o A376559 if f(kmid) <= kmid: %o A376559 kmax = kmid %o A376559 else: %o A376559 kmin = kmid %o A376559 return kmax %o A376559 def f(x): return int(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length()))) %o A376559 a = bisection(f,n,n) %o A376559 b = bisection(lambda x:f(x)+1,a,a) %o A376559 return a+bisection(lambda x:f(x)+2,b,b)-(b<<1) # _Chai Wah Wu_, Oct 02 2024 %o A376559 (PARI) lista(nn) = my(v = concat (1, select(ispower, [1..nn])), w = vector(#v-1, i, v[i+1] - v[i])); vector(#w-1, i, w[i+1] - w[i]); \\ _Michel Marcus_, Oct 02 2024 %Y A376559 The version for A000002 is A376604, first differences of A054354. %Y A376559 For first differences we have A053289, union A023055, firsts A376268, A376519. %Y A376559 A000961 lists prime-powers inclusive, exclusive A246655. %Y A376559 A001597 lists perfect-powers, complement A007916. %Y A376559 A112344 counts integer partitions into perfect-powers, factorizations A294068. %Y A376559 For perfect-powers: A053289 (first differences), A376560 (positive curvature), A376561 (negative curvature). %Y A376559 For second differences: A036263 (prime), A073445 (composite), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power). %Y A376559 Cf. A045542, A052410, A053707, A064113, A069623, A174965, A216765, A251092, A333254, A336416, A361102. %K A376559 sign %O A376559 1,2 %A A376559 _Gus Wiseman_, Sep 28 2024