OFFSET
1,5
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The sequence of nonsquarefree numbers (A013929) is:
4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, ...
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, ...
with runs:
(4),(1),(3),(4),(2,2),(4),(1),(2),(1),(4,4,4,4),(1),(3),(1,1),(2,2,2), ...
with lengths (A376267):
1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 2, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, ...
MAPLE
nsf:= remove(numtheory:-issqrfree, [$4..1000]):
S:= nsf[2..-1]-nsf[1..-2]:
R:= NULL: x:= 4: t:= 1:
for i from 2 to nops(S) do
if S[i] = x then t:= t+1
else R:= R, t; x:= S[i]; t:= 1
fi
od:
R; # Robert Israel, Jan 27 2025
MATHEMATICA
Length/@Split[Differences[Select[Range[1000], !SquareFreeQ[#]&]]]//Most
CROSSREFS
For prime instead of nonsquarefree numbers we have A333254.
For run-sums instead of run-lengths we have A376264.
For squarefree instead of nonsquarefree we have A376306.
For prime-powers instead of nonsquarefree numbers we have A376309.
For compression instead of run-lengths we have A376312.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 27 2024
STATUS
approved