# What are the solutions to $a^2+ab+b^2$ $=$ $3^n$?

What are all known integer solutions ($a, b, n$) to $a^2+ab+b^2$ $=$ $3^n$ besides ($1, 1, 1$) and ($-2, 1, 1$)? Do any others even exist?

This question comes from the identity that ($a^3±b^3$)/($a±b$) $=$ $0, 1$ $\pmod 3$. If ($a^3±b^3$)/($a±b$) $=$ $0$ $\pmod 3$, then let $3^n$ be highest power of $3$ dividing ($a^3±b^3$)/($a±b$). ($a^3±b^3$)/(($a±b$)$*3^n$) $=$ $1$ $\pmod 3$. When does ($a^3±b^3$)/(($a±b$)$*3^n$) $=$ $1$?

• Formatting tip:$\pm$ is written as $\text{\pm}$ and $\mp$ as $\text{\mp}$,which I guess you mean by $+-$ – kingW3 Feb 9 '17 at 4:34
• $(1,1,1)$ and $(1,0,0)$. – David Feb 9 '17 at 4:36

The set of solutions to $$x^2 + xy + y^2 = 1$$ in integers is finite (6).

 x = 1, y = 0 target 1
x = -1, y = 0 target 1
x = 1, y = -1 target 1
x = -1, y = 1 target 1
x = 0, y = 1 target 1
x = 0, y = -1 target 1


The set of solutions to $$x^2 + xy + y^2 = 3$$ in integers is finite(6).

 x = 2, y = -1 target 3
x = -2, y = 1 target 3
x = 1, y = 1 target 3
x = -1, y = -1 target 3
x = 1, y = -2 target 3
x = -1, y = 2 target 3


If $$x^2 + xy + y^2 \equiv 0 \pmod 9$$ then both $x,y$ are divisible by $3.$

This means that all solutions to your $3^n$ thing are $3^w$ times the items in the first two (finite) sets.

• So you are concluding that there are finitely many solutions to $x^2+xy+y^2$ $=$ $3^n$ with $x, y$ $>$ $0$? – J. Linne Feb 9 '17 at 4:40
• @J.Linne not at all. There are finitely many solutions with $\gcd(x,y) = 1$ – Will Jagy Feb 9 '17 at 4:41
• alpertron.com.ar/QUAD.HTM – miracle173 Feb 9 '17 at 5:06

Let $a=u+v$ and $b=u-v$. It follows: $$a^2+ab+b^2=(u+v)^2+(u^2-v^2)+(u-v)^2$$ Hence $$3u^2+v^2=3^n$$ If $n=0$, then, $u=0$ and $v=\pm 1$

If $n=1$, then $v^2=3(1-u)(1+u)$ $\implies$ $(u,v)=(\pm 1,0),(\pm 1, \pm 1 )$

If $n>1$, then $u,v$ are both divisible by 3.

• Actually $u,v$ are both divisible by $3$ trivially since either $u=0$ or $v=0$. – kingW3 Feb 9 '17 at 4:53
• "f n>1, then u,v are both divisible by 3" Inductively that would imply u and v are both powers of three, correct? – fleablood Feb 9 '17 at 7:37