I noticed something with Mersenne numbers : you can write it with the form $a+b+c = 2^n-1$ and $a^2+b^2+c^2 = (4^n-1)/3$ when $n$ is a odd Mersenne exponent $(3, 5, 7, 13, \dotsc)$ or an exponent of a odd Mersenne exponent ($3^2, 5^4, 7^3,\dotsc $)


For example with Mersenne exponent :


* $4+2+1 = 7 = 2^3-1$ and $4^2+2^2+1^2 = 21 = (4^3-1)/3$
* $14+9+8 = 31 = 2^5-1$ and $14^2+9^2+8^2 = 341 = (4^5-1)/3$
* $2760+2761+2670 = 8191 = 2^{13}-1$ and $2760^2+2761^2+2670^2 = 22369621 = (4^{13}-1)/3$


And exponent of Mersenne exponent :


* $44732914+44738572+44746241 = 134217727 = 2^{27}-1$ and $44732914^2+44738572^2+44746241^2 = 6004799503160661 = (4^{27}-1)/3$
with $27 = 3^3$


You can notice there are each time two even numbers and one odd number for $a, b$ and $c$.


Another observation : it seems there are no integer solution for $a, b, c$ when $2^n-1$ a composite Mersenne numbers like $2^{11}-1$. Apparently, you can't write $a+b+c = 2^{11}-1$ and $a^2+b^2+c^2 = (4^{11}-1)/3$ for this case.


Is there a way to explain that ? I don't know how to start for proving it.



How to prove than $a+b+c = 2^n-1$ and $a^2+b^2+c^2 = (4^n-1)/3$ have integer solutions only with Mersenne exponent or exponents of Mersenne exponent?
Let $n\in\mathbb{N}$ be odd. The system of equations
$$a+b+c=2^n-1\qquad\text{and}\qquad a^2+b^2+c^2=\frac{4^n-1}{3}$$
is equivalent to
$$a+b+c=2^n-1\qquad\text{and}\qquad (a-b)^2+(b-c)^2+(c-a)^2=2^{n+1}-2.$$
It follows that any real solution $a,b,c\in\mathbb{R}$ satisfies
$$a,b,c\in\left[\frac{2^n-1}{3}-\sqrt{2^{n+1}-2},\frac{2^n-1}{3}+\sqrt{2^{n+1}-2}\right].$$
In particular, for $n\geq 5$, any real solution is automatically positive. So we don't have to worry about integral solution vs. positive integral solution.


Writing $x:=a-b$ and $y:=b-c$, the system becomes
$$3a=2x+y+2^n-1\qquad\text{and}\qquad x^2+xy+y^2=2^n-1.$$
Here $2^n-1\equiv 1\pmod{3}$, so the system is equivalent to
$$2x+y\equiv 2\pmod{3}\qquad\text{and}\qquad x^2+xy+y^2=2^n-1.$$
The first condition can be dropped. Indeed, if $x^2+xy+y^2=2^n-1$, then $x\not\equiv y\pmod{3}$, hence $2x+y\not\equiv 0\pmod{3}$. So replacing $(x,y)$ by $(-x,-y)$ if necessary, the first condition will be met along with the second one.


To summarize, an odd $n\in\mathbb{N}$ is a good exponent (for the original system of equations) if and only if $2^n-1$ can be written as $x^2+xy+y^2$ with $x,y\in\mathbb{Z}$. That is, if and only if every prime divisor $p\mid 2^n-1$ satisfying $p\equiv 2\pmod{3}$ has an even exponent in $2^n-1$. In particular, Mersenne exponents are good. Also, $11$ is not good, because $2^{11}-1=23\cdot 89$ does not satisfy the condition.


