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