A375707 First differences minus 1 of nonsquarefree numbers.
3, 0, 2, 3, 1, 1, 3, 0, 1, 0, 3, 3, 3, 3, 0, 2, 0, 0, 1, 1, 1, 3, 2, 0, 3, 3, 2, 0, 3, 0, 2, 3, 1, 1, 3, 1, 0, 0, 3, 3, 3, 3, 0, 2, 0, 2, 0, 0, 1, 3, 2, 0, 3, 3, 2, 0, 1, 1, 0, 2, 3, 1, 1, 3, 0, 1, 0, 2, 0, 3, 3, 3, 0, 2, 3, 1, 1, 3, 2, 0, 3, 3, 3, 3, 0, 2, 3
Offset: 1
Examples
The runs of squarefree numbers begin: (5,6,7) () (10,11) (13,14,15) (17) (19) (21,22,23) () (26) () (29,30,31) (33,34,35)
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Positions of 0, 1, 2, 3 are A375709, A375710, A375711, A375712. This is a set partition of the positive integers into four blocks.
For runs of squarefree numbers:
For runs of nonsquarefree numbers:
A046933 counts composite numbers between consecutive primes.
A073784 counts primes between consecutive composite numbers.
A093555 counts non-prime-powers between consecutive prime-powers.
Programs
-
Mathematica
Differences[Select[Range[100],!SquareFreeQ[#]&]]-1
-
PARI
lista(nmax) = {my(prev = 4); for (n = 5, nmax, if(!issquarefree(n), print1(n - prev - 1, ", "); prev = n));} \\ Amiram Eldar, Sep 17 2024
Formula
Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = 6/(Pi^2-6) = 1.550546... . - Amiram Eldar, Sep 17 2024
Comments