Let $L(n)$ denote the number of positive divisors of a number $n$. Prove that $\sum_{n=1}^N L(n)=\lfloor{\sqrt N}\rfloor\pmod 2$.
I wanted to prove that by induction. For $n=1$ True. Assume True for some N. Now we have $N+1$. I observed that $L(n)=n-\phi(n)+1$ where phi is Euler's function. And what now... If $N+1$ is a square, then $\lfloor\sqrt N\rfloor\ne\lfloor\sqrt{N+1}\rfloor\pmod 2$, whereas they are the same modulo 2 if $N+1$ is not a square. When we add $N+1$th element to the sum, we add $N+1-\phi(N+1)+1$ which modulo 2 is $N-\phi(N+1)$. So, the function $k(n)=n-\phi(n+1)$ should be odd if $n+1$ is square, and even if it is not square. But, I opened table of Euler's phi function and that function seems to be odd when n is odd and even when n is even - I looked all naturals < 500. So, where am I wrong?
I would be also happy to see non-induction solution, because it is probably better way. I just cant imagine from where did that sqrt(N) came from when I think about that sum.
Thanks in advance for help. I will probably answer for comments tomorrow.
Your $L(n)$ can be odd only when $n$ itself is a perfect square. So, mod 2, you are just counting the squares up to the upper bound, which you called $N$.
First, $L(1) = 1.$ If $n> 1,$ it has a prime factorization, say $$ n = p_1^{a_1} p_2^{a_2} \cdots p_r^{a_r} $$ with exponents $a_j \geq 1$ and $r$ primes with $r \geq 1.$ Then $$ L(n) = (a_1+1) (a_2 + 1) \cdots (a_r + 1). $$ If any of the $a_j$ is odd, then $a_j + 1$ is even, so $L(n)$ is even. That is the most frequent outcome. It is possible to have $L(n)$ odd only when all the $(a_j + 1)$ are odd, meaning all the $a_j$ are even, meaning $n$ is a perfect square.