login
A285879
Number of odd squarefree numbers <= n.
3
1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 31, 32, 32, 33, 33, 33, 33, 34, 34, 35
OFFSET
1,3
LINKS
Eric Weisstein's World of Mathematics, Squarefree
FORMULA
G.f.: Sum_{k>=1} x^A056911(k)/(1 - x).
a(n) ~ 4*n/Pi^2. See A185199.
a(n) = Sum_{k=1..n} A008683(2k)^2. - Ridouane Oudra, Aug 16 2019
MAPLE
ListTools:-PartialSums(map(op, [seq(`if`(numtheory:-issqrfree(n), [1, 0], [0, 0]), n=1..100, 2)])); # Robert Israel, May 07 2018
seq(add(mobius(2*k)^2, k=1..n), n=1..100); # Ridouane Oudra, Aug 16 2019
MATHEMATICA
Table[Sum[Boole[OddQ[k] && SquareFreeQ[k]], {k, 1, n}], {n, 85}]
nmax = 85; Rest[CoefficientList[Series[Sum[Boole[OddQ[k] && MoebiusMu[k]^2 == 1] x^k/(1 - x), {k, 1, nmax}], {x, 0, nmax}], x]]
PROG
(PARI) a(n) = sum(k=1, n, (k%2)*issquarefree(k)); \\ Michel Marcus, Apr 27 2017
(Python)
from sympy.ntheory.factor_ import core
def a(n): return sum([1 for k in range(1, n + 1) if k%2==1 and core(k)==k]) # Indranil Ghosh, Apr 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Apr 27 2017
STATUS
approved