OFFSET
1,2
COMMENTS
We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).
EXAMPLE
The sequence of squarefree numbers (A005117) is:
1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ...
with first differences (A076259):
1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 1, 2, 1, ...
with run-compression (A376305):
1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 4, 2, 1, 2, 1, ...
with ones at (A376342):
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38, ...
MATHEMATICA
Join@@Position[First /@ Split[Differences[Select[Range[100], SquareFreeQ]]], 1]
CROSSREFS
Before compressing we had A076259.
Positions of 1's in A376305.
The version for nonsquarefree numbers gives positions of ones in A376312.
For prime instead of squarefree numbers we have A376343.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 24 2024
STATUS
approved