While reading about the prime number distribution I came across this fact that the percentage of natural numbers that are perfect square is zero. How do I prove this ?
[Math] Percentage of natural numbers that are perfect squares
elementary-number-theorynumber theory
Related Solutions
It is almost Valentine's Day. So if $a$ and $b$ are positive integers such that $a\ne b$ and $ab=N$, call $a$ and $b$ lovers. There are two cases to consider, (i) $N$ is not a perfect square and (ii) $N$ is a perfect square.
Case (i): If $N$ is not a perfect square, then the positive divisors of $N$ are divided into pairs of lovers. The number of pairs is $\frac{d(N)}{2}$, where $d(N)$ is the number of positive divisors of $N$.
The product of the divisors of $N$ is therefore $N^{d(N)/2}$. This is $N^2$ (meaning that $N$ is multiplicatively perfect) precisely if $d(N)=4$. This is the case if $N$ is the product of $2$ distinct primes or if $N$ is the cube of a prime. Here we have used the fact that if $N=p_1^{a_1}\cdots p_k^{a_k}$, where the $p_i$ are distinct primes, then $d(N)=(a_1+1)\cdots (a_k+1)$, though one can do it with less machinery.
Case (ii): Let $N$ be a perfect square, say $m^2$. Then the divisors of $N$ consist of pairs of lovers, together with the solitary divisor $m$. So the product of the divisors is $N^{(d(N)-1)/2}\sqrt{N}$, which is $N^{d(N)/2}$. For this to be $N^2$ we want either $N=1$ or $\frac{d(N)}{2}=2$, which is impossible if $N$ is a perfect square. So in addition to the examples you mentioned, $1$ is also multiplicatively perfect.
\
For the first question, $n - 1 = y^2$ and $n+1 = x^3$, so $n = y^2 + 1 = x^3 - 1$, so $y^2 = x^3 - 2$. Fermat famously challenged British mathematicians to explain why the only solution in positive integers is $(x,y) = (3,5)$. Its solutions in integers are $(x,y) = (3,\pm 5)$ and one way to show that uses properties of the ring $\mathbf Z[\sqrt{-2}]$ (namely, that it has unique factorization and its only units are $\pm 1$). This ring gets involved by rewriting $y^2 = x^3 - 2$ as $x^3 = y^2 + 2 = (y+\sqrt{-2})(y-\sqrt{-2})$. You put a link to this approach in an edit to your post.
For the second question, $n - 1 = x^3$ and $n+1 = y^2$, so $n = x^3 + 1 = y^2 - 1$, so $y^2 = x^3 + 2$. Rewrite this as $x^3 = y^2 - 2 = (y+\sqrt{2})(y-\sqrt{2})$ in $\mathbf Z[\sqrt{2}]$, which is a PID (it is Euclidean). Show $x$ and $y$ are odd and, using that condition, show $y+\sqrt{2}$ and $y-\sqrt{2}$ are relatively prime in $\mathbf Z[\sqrt{2}]$. Therefore since their product is a cube, each is a cube up to unit multiple, so $$ y+\sqrt{2} = (a+b\sqrt{2})^3u $$ for some unit $u \in \mathbf Z[\sqrt{2}]$. On the right side, unit cubes can be absorbed into $(a+b\sqrt{2})^3$, so we only need to use as $u$ representatives of the units modulo cubes of units. It turns out that the units of $\mathbf Z[\sqrt{2}]$ are $\pm(1+\sqrt{2})^{\mathbf Z}$, so representatives for the units modulo unit cubes are $1, 1+\sqrt{2}$, and $(1+\sqrt{2})^{-1} = -(1-\sqrt{2})$. We can ignore the factor $-1$ since it's a unit cube, so we're reduced to three equations: $$ y+\sqrt{2} = (a+b\sqrt{2})^3, $$ $$ y+\sqrt{2} = (a+b\sqrt{2})^3(1+\sqrt{2}), $$ $$ y+\sqrt{2} = (a+b\sqrt{2})^3(1-\sqrt{2}). $$
The first equation, after equating coefficients of $\sqrt{2}$ on both sides, implies $$ 1 = 3a^2b + 2b^3 = b(3a^2 + 2b^2). $$ Therefore $b$ has to be $\pm 1$, but neither choice leads to an integer for $a$. So we get no solutions this way to the original equation.
The second equation, after equating coefficients of $\sqrt{2}$ on both sides, implies $$ 1 = a^3 + 3a^2b + 6ab^2 + 2b^3. $$ It turns out that the only integral solution to this is $(a,b) = (1,0)$, but that is not easy! (I don't have a reference for you off the top of my head -- google "cubic Thue equations".) Using this fact, $y+\sqrt{2} = (a+b\sqrt{2})^3(1+\sqrt{2}) = 1+\sqrt{2}$. so $y = 1$ and $x^3 = y^2- 2 = -1$. Thus $(x,y)= (-1,1)$.
The third equation, after equating coefficients of $\sqrt{2}$ on both sides, implies $$ 1 = (-a)^3 + 3(-a)^2b + 6(-a)b^2 + 2b^3, $$ which is the same as the previous equation with $-a$ in place of $a$. Therefore $(a,b) = (-1,0)$, which leads to $y = -1$ and then $x^3 = y^2 - 2 = -1$, so $(x,y) = (-1,-1)$.
In summary, if we accept that the only solution of $1 = a^3 + 3a^2b + 6ab^2 + 2b^3$ in $\mathbf Z$ is $(a,b) = (1,0)$ then the above argument shows the integral solutions of $y^2 = x^3 + 2$ are $(x,y) = (-1,\pm 1)$.
One lesson from this is that when $y^2 = x^3 + k$ really has integral solutions and you want to prove that you found all of them, the case when $k > 0$ is typically more difficult than the case when $k < 0$.
Best Answer
"Percentage" is a bad word, you mean something like natural density.
For that it's easy, as the limit exists, you just compute
The numerator is bounded above by $\sqrt{n}$ so we get