A076259 Gaps between squarefree numbers: a(n) = A005117(n+1) - A005117(n).
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, 1, 3, 1, 4, 2, 2, 2, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 3, 1, 4, 2, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 2, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1
Offset: 1
Examples
As 24 = 3*2^3 and 25 = 5^2, the next squarefree number greater A005117(16) = 23 is A005117(17) = 26, therefore a(16) = 26-23 = 3.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Mayank Pandey, Squarefree numbers in short intervals, arXiv preprint, arXiv:2401.13981 [math.NT], 2024.
Crossrefs
Programs
-
Haskell
a076259 n = a076259_list !! (n-1) a076259_list = zipWith (-) (tail a005117_list) a005117_list -- Reinhard Zumkeller, Aug 03 2012
-
Maple
A076259 := proc(n) A005117(n+1)-A005117(n) ; end proc: # R. J. Mathar, Jan 09 2013
-
Mathematica
Select[Range[200], SquareFreeQ] // Differences (* Jean-François Alcover, Mar 10 2019 *)
-
PARI
t=1; for(n=2,1e3, if(issquarefree(n), print1(n-t", "); t=n)) \\ Charles R Greathouse IV, Jul 23 2015
-
Python
from math import isqrt from sympy import mobius def A076259(n): def f(x): return n+x-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) r, k = n+1, f(n+1)+1 while r != k: r, k = k, f(k)+1 return int(r-m) # Chai Wah Wu, Aug 15 2024
Formula
Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = Pi^2/6 (A013661). - Amiram Eldar, Oct 21 2020
a(n) < n^(1/5) for large enough n by a result of Pandey. (The constant Pi^2/6 can be absorbed by any eta > 0.) - Charles R Greathouse IV, Dec 04 2024
Comments