OFFSET
1,5
FORMULA
a(n) = A057627(prime(n)).
EXAMPLE
The nonsquarefree numbers counted under each term begin:
n=1: n=2: n=3: n=4: n=5: n=6: n=7: n=8: n=9: n=10: n=11: n=12:
--------------------------------------------------------------
. . 4 4 9 12 16 18 20 28 28 36
8 9 12 16 18 27 27 32
4 8 9 12 16 25 25 28
4 8 9 12 24 24 27
4 8 9 20 20 25
4 8 18 18 24
4 16 16 20
12 12 18
9 9 16
8 8 12
4 4 9
8
4
MATHEMATICA
Table[Length[Select[Range[Prime[n]], !SquareFreeQ[#]&]], {n, 100}]
PROG
(Python)
from math import isqrt
from sympy import prime, mobius
def A378086(n): return (p:=prime(n))-sum(mobius(k)*(p//k**2) for k in range(1, isqrt(p)+1)) # Chai Wah Wu, Dec 05 2024
CROSSREFS
For nonprime numbers we have A014689.
Restriction of A057627 to the primes.
For composite instead of squarefree we have A065890.
A005117 lists the squarefree numbers.
A070321 gives the greatest squarefree number up to n.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 04 2024
STATUS
approved