OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ (Pi^2/12) * n^2. - Amiram Eldar, Oct 21 2020
Distinct terms of A066779. - Chai Wah Wu, Aug 17 2026
EXAMPLE
The first squarefree numbers are: 1, 2, 3, 5, 6, 7, 10, ...
So, the first partial sums are: 1, 3, 6, 11, 17, 24, 34, ...
MATHEMATICA
Accumulate[Select[Range[100], SquareFreeQ]] (* Harvey P. Dale, Jan 09 2016 *)
PROG
(PARI) lista(nn)=my(s = 0); for (n=1, nn, if (issquarefree(n), s += n; print1(s, ", "); ); ); \\ Michel Marcus, Oct 01 2015
(PARI) helper(n, k)=my(t=(n+1)\k); binomial(t, 2)*k + (n+1 - t*k)*t
a(n)=my(s); forsquarefree(k=1, sqrtint(n), s+=moebius(k)*helper(n, k[1]^2)); s \\ Charles R Greathouse IV, Feb 05 2018
(Python)
from math import isqrt, comb
from sympy import mobius
def A173143(n):
def f(x): return int(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)
return sum(mobius(k)*(s:=k**2)*comb(m//s+1, 2) for k in range(1, isqrt(m)+1)) # Chai Wah Wu, Oct 20 2025
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Feb 10 2010
STATUS
approved