OFFSET
1,1
COMMENTS
The range is {-3, -2, -1, 0, 1, 2, 3}.
EXAMPLE
The nonsquarefree numbers (A013929) are:
4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, 52, ...
with first differences (A078147):
4, 1, 3, 4, 2, 2, 4, 1, 2, 1, 4, 4, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 3, 1, 4, 4, ...
with first differences (A376593):
-3, 2, 1, -2, 0, 2, -3, 1, -1, 3, 0, 0, 0, -3, 2, -2, 0, 1, 0, 0, 2, -1, -2, ...
MATHEMATICA
Differences[Select[Range[100], !SquareFreeQ[#]&], 2]
PROG
(Python)
from math import isqrt
from sympy import mobius, factorint
def A376593(n):
def f(x): return n+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k: m, k = k, f(k)
k = next(i for i in range(1, 5) if any(d>1 for d in factorint(m+i).values()))
return next(i for i in range(1-k, 5-k) if any(d>1 for d in factorint(m+(k<<1)+i).values())) # Chai Wah Wu, Oct 02 2024
CROSSREFS
The first differences were A078147.
A064113 lists positions of adjacent equal prime gaps.
A114374 counts partitions into nonsquarefree numbers.
A333254 lists run-lengths of differences between consecutive primes.
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376596 (prime-power inclusive), A376599 (non-prime-power inclusive).
For nonsquarefree numbers: A013929 (terms), A078147 (first differences), A376594 (inflections and undulations), A376595 (nonzero curvature).
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 01 2024
STATUS
approved