%I #12 Oct 03 2024 08:32:07
%S -2,0,-1,2,-1,-1,0,1,0,0,0,1,-2,0,0,1,-1,0,1,0,-1,0,1,0,-1,0,1,-1,0,0,
%T 0,1,0,-1,1,-1,1,-1,0,1,0,-1,0,0,0,1,0,0,-1,0,0,0,1,-1,0,0,0,0,0,1,-1,
%U 0,1,0,-1,0,1,0,-1,0,1,-1,0,0,0,0,0,1,-1,0
%N Second differences of consecutive non-prime-powers inclusive (A024619). First differences of A375735.
%C Inclusive means 1 is a prime-power but not a non-prime-power. For the exclusive version, shift left once.
%e The non-prime-powers inclusive (A024619) are:
%e 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 30, 33, 34, 35, 36, 38, 39, 40, ...
%e with first differences (A375735):
%e 4, 2, 2, 1, 3, 2, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, ...
%e with first differences (A376599):
%e -2, 0, -1, 2, -1, -1, 0, 1, 0, 0, 0, 1, -2, 0, 0, 1, -1, 0, 1, 0, -1, 0, 1, 0, ...
%t Differences[Select[Range[100],!(#==1||PrimePowerQ[#])&],2]
%o (Python)
%o from sympy import primepi, integer_nthroot
%o def A376599(n):
%o def iterfun(f,n=0):
%o m, k = n, f(n)
%o while m != k: m, k = k, f(k)
%o return m
%o def f(x): return int(n+1+sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
%o return (a:=iterfun(f,n))-((b:=iterfun(lambda x:f(x)+1,a))<<1)+iterfun(lambda x:f(x)+2,b) # _Chai Wah Wu_, Oct 02 2024
%Y The version for A000002 is A376604, first differences of A054354.
%Y For first differences we had A375735, ones A375713(n) - 1.
%Y Positions of zeros are A376600, complement A376601.
%Y A000961 lists prime-powers inclusive, exclusive A246655.
%Y A007916 lists non-perfect-powers.
%Y A057820 gives first differences of prime-powers inclusive, first appearances A376341, sorted A376340.
%Y A321346/A321378 count integer partitions without prime-powers, factorizations A322452.
%Y For non-prime-powers: A024619/A361102 (terms), A375735/A375708 (first differences), A376600 (inflections and undulations), A376601 (nonzero curvature).
%Y For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power).
%Y Cf. A025475, A053707, A064113, A093555, A174965, A251092, A333254, A376653, A376654.
%K sign
%O 1,1
%A _Gus Wiseman_, Oct 02 2024