I was messing around with numbers and I made the following conjecture:
Conjecture:
Let $\pi_n$ be the $n^{\text{th}}$ perfect number; $p_a$ be the prime after $\pi_n$ and $p_b$ be the prime before $\pi_n$. Then, one may always see that$$\begin{align}\pi_n^{ \ \ 2}+p_a^{ \ \ 2}+p_b^{ \ \ 2}&=\sum_{i=1}^4x_i^{ \ 2}\tag{$\exists x_i\in\mathbb{Z}^+$} \\ \Leftrightarrow \pi_n + p_a + p_b&\geqslant\sum_{i=1}^4x_i\tag{with equality $\Leftrightarrow n = 1$}\end{align}$$ (Developed this conjecture from here.)
Does anybody know how to prove /disprove this? I know that by Lagrange's Four-Square Theorem, the first equality is true. However, I am not particularly good at inequalities, strict and nonstrict. I know that every perfect number is of the form $2^{q-1}\left(2^q-1\right)$ for a prime $q$ and for all primes $2^q-1$, thus far. (It is not proven whether or not there exists an odd perfect number, which would mean that $2^{q-1}$ does not divide that, supposing it exists).
Thus, $\pi_n^{ \ \ 2} = 4^{q-1}(4^q - 2^{q+1}+1)$ but this does not really help me. So, I made a new substitution: $$\pi_n = (2^q-1)^2 - \sum_{i=1}^{2^{q-1}-1}(4k-1).\tag{provable by induction}$$ This looks much more appropriate to work with. Squaring this and simplifying, $$\begin{align}\pi_n^{ \ \ 2} &= \left((2^q-1)^2-\frac 13(3\cdot 2^q-4^q-2)\right)^2 \\ &=\cdots \tag{lots of working out}\\ &= 4^{q-1}(2^q-1)^2.\end{align}$$ But this is exactly what we had before (also proving that it is a perfect number).
What do I do in order to (dis)prove my conjecture?
Thank you in advance.
Your conjecture is not true. In general, there are large number of ways to represent $N$ as sum of four squares as $N$ gets larger ($O(N\sqrt N)$, see Jacobi's Four Square theorem for this. One can conjecture that, some of them will be sufficiently similar to each other and make the sum $\sum_{i=1}^4x_i$ big enough.
For example, Let $n=3$. $\pi_n=496$, $p_a=491$, $p_b=499$, and $LHS=736098$. With a help of computer, I could find$$\pi_n^2+p_a^2+p_b^2=445^2+441^2+434^2+394^2$$ and this is counterexample to your conjecture.
Edit: Also, there exists counterexample for $n=2$ and $n=1$. $$28^2+23^2+29^2=26^2+25^2+23^2+18^2$$ $$6^2+5^2+7^2=7^2+6^2+4^2+3^2$$ Your link only shows one of the numerous ways to represent $N$ as sum of four squares, which is probably computed by the way same as the proof of Lagrange's Four square theorem.