%I #11 Oct 02 2024 12:26:06
%S 0,1,-1,0,2,-2,1,-1,0,1,0,0,-1,0,2,0,-2,0,1,-1,0,1,-1,0,1,-1,0,2,-2,3,
%T -2,0,0,-1,0,1,-1,2,-2,0,1,-1,0,1,-1,2,-2,0,2,-2,1,-1,0,1,0,0,-1,0,1,
%U 2,-3,0,1,-1,0,1,-1,0,1,-1,0,2,-2,2,-2,3,-2,-1
%N Second differences of consecutive squarefree numbers (A005117). First differences of A076259.
%e The squarefree numbers (A005117) are:
%e 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, 31, 33, 34, ...
%e with first differences (A076259):
%e 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, ...
%e with first differences (A376590):
%e 0, 1, -1, 0, 2, -2, 1, -1, 0, 1, 0, 0, -1, 0, 2, 0, -2, 0, 1, -1, 0, 1, -1, 0, 1, ...
%t Differences[Select[Range[100],SquareFreeQ],2]
%o (Python)
%o from math import isqrt
%o from sympy import mobius
%o def A376590(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 n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
%o a = iterfun(f,n)
%o b = iterfun(lambda x:f(x)+1,a)
%o return a+iterfun(lambda x:f(x)+2,b)-(b<<1) # _Chai Wah Wu_, Oct 02 2024
%Y The version for A000002 is A376604, first differences of A054354.
%Y The first differences were A076259, see also A375927, A376305, A376306, A376307, A376311.
%Y Zeros are A376591, complement A376592.
%Y Sorted positions of first appearances are A376655.
%Y A000040 lists the prime numbers, differences A001223.
%Y A001597 lists perfect-powers, complement A007916.
%Y A005117 lists squarefree numbers, complement A013929 (differences A078147).
%Y A073576 counts integer partitions into squarefree numbers, factorizations A050320.
%Y A333254 lists run-lengths of differences between consecutive primes.
%Y For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376593 (nonsquarefree), A376596 (prime-power inclusive), A376599 (non-prime-power inclusive).
%Y For squarefree numbers: A076259 (first differences), A376591 (inflections and undulations), A376592 (nonzero curvature), A376655 (sorted first positions).
%Y Cf. A000961, A007674, A053797, A053806, A061398, A072284, A112925, A112926, A120992, A251092, A373198, A376342.
%K sign
%O 1,5
%A _Gus Wiseman_, Oct 01 2024