OFFSET
1,5
EXAMPLE
a(12) = 4 since there are 4 squarefree numbers less than 12 that do not divide 12, namely: 5, 7, 10, and 11.
MATHEMATICA
Table[Sum[MoebiusMu[k]^2 (Ceiling[n/k] - Floor[n/k]), {k, n}], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, n-1, (n % k) && issquarefree(k)); \\ Michel Marcus, Jan 03 2024
(Python)
from math import isqrt
from sympy import factorint, mobius
def A368673(n): return sum(mobius(k)*((n-1)//k**2) for k in range(1, isqrt(n-1)+1))-(1<<len(f:=factorint(n)))+int(max(f.values(), default=1)==1) # Chai Wah Wu, Jan 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 02 2024
STATUS
approved