find number of positive integers smaller $N$ that have an even number of proper divisors

26 Views Asked by At

Given a number $N$, I want to determine $\vert\{x\in\mathbb{N}\ \vert\ 1\leq x\leq N\wedge\ \text{candidate}(x)\}\vert$

where

$\text{candidate}(x) = \vert\{y\in\mathbb{N}\ \vert\ 1\leq y < x \wedge x \mod y = 0\}\vert\ \mod 2 = 0$

Really stuck with this and would appreciate some help.

1

There are 1 best solutions below

0
On BEST ANSWER

The candidates are precisely the perfect squares (because all divisors $d\ne\sqrt x$ come in pairs $d,\frac xd$, where special care is needed for $1$ and $x$). Hence the desired number is $\lfloor\sqrt N\rfloor$.