OFFSET
0,2
COMMENTS
Asymptotically ~ 0.30396355...*(10^n)^2 = (3/Pi^2)*(10^n)^2. Curiously, this limit is the same as A064018.
LINKS
Henri Lifchitz, Table of n, a(n) for n = 0..24 (terms 21..22 from Chai Wah Wu), Jan 10 2026
FORMULA
a(n) = (10^n)*(10^n+1)/2 - A388005(n).
EXAMPLE
The first squarefree numbers are: 1, 2, 3, 5, 6, 7, 10, ...
So, a(1) = 1+2+3+5+6+7+10 = 34.
MATHEMATICA
SumSquareFree[n_Integer?Positive] := Total@Select[Range[n], SquareFreeQ]; Table[ SumSquareFree[10^n], {n, 0, 6}]
PROG
(PARI) a(n) = my(s=0); forsquarefree(x=1, 10^n, s+=x[1]); s; \\ Michel Marcus, Oct 15 2025
(Python)
from math import isqrt, comb
from sympy import mobius
def A387980(n): return sum(mobius(k)*(s:=k**2)*comb(10**n//s+1, 2) for k in range(1, isqrt(10**n)+1)) # Chai Wah Wu, Oct 20 2025
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Henri Lifchitz, Oct 13 2025
STATUS
approved
