# Positive integer solutions of $x^2+21y^2=z^4$

Can one find all positive integer solutions of $$x^2+21y^2=z^4 ?$$

I am not sure if this is possible. I just saw this problem and this problem came to my mind.

-
The LHS is the norm of the value $x+y\sqrt{-21}$ in the number field $\mathbb{Q}(\sqrt{-21})$. I don't know how to compute this but apparently it has class number 4. www2.wolframalpha.com/input/?i=class+number%28-21%29 this might be relevant or might not. – quanta Apr 14 '11 at 15:18
The composition of forms is $(x^2+21y^2)(u^2+21v^2)=(xu-21yv)^2+21(xv+yu)^2$. Given en.wikipedia.org/wiki/Brahmagupta%E2%80%93Fibonacci_identity – quanta Apr 14 '11 at 15:42
The biggest difficulty I have with this problem is that while the norm of $(a+b\sqrt{-21})^4$ is a fourth power we do not (necessarily) have the converse. – quanta Apr 14 '11 at 15:51
Quadratic reciprocity suggests that a prime number is represented uniquely by this form iff it equals 1,9,25,37,49,57 or 81 (mod 4*21). A computer search confirms this form primes $\le$ 177889. I don't know how/if the class number comes into this. – quanta Apr 14 '11 at 15:52
Since there are lots of solutions to $(xu-21yv)^2+21(xv+yu)^2 = m^4$ I have to agree that this problem seems really difficult.. – quanta Apr 14 '11 at 15:56

I seem to keep making dumb mistakes; both comments I made on this problem (now deleted) are wrong. To make up for it, here is a complete solution.

Note that, given an integer solution to $x^2+21 y^2 = z^4$, we get a rational solution to $X^2 + 21 Y^2 =1$, by $(X,Y) = (x/z^2, y/z^2)$. Conversely, given a rational $(X,Y)$ obeying $X^2 + 21 Y^2=1$, we can always get back to an integer solution $(Xz^2, Yz^2, z)$ by taking appropriate $z$. (And, by taking multiples of that $z$, we get infinitely many solutions.) So I'll concentrate on finding rationals $(X,Y)$ obeying this conic equation.

Once you have one rational point on a conic, there is a standard method for parameterizing the others. In our example, the one point will be $(-1,0)$. Consider a line through this point with rational slope $\mu$. Explicitly, the equation of this line is $Y=\mu(X+1)$. One of the intersections of this line with the conic is $(-1,0)$. The other one must also be rational.

Explicitly, that other point is found by solving $X^2 + 21 \mu^2 (X+1)^2 =1$ or $21 \mu^2 (X+1)^2 = (1+X)(1-X)$. Dividing out the solution $X=-1$, which is the point we already know, we get $21 \mu^2 (X+1) = 1-X$ or $$X = \frac{1-21 \mu^2}{1+21 \mu^2}.$$ Using $Y=\mu(X+1)$, we get $$Y = \frac{2 \mu}{1+21 \mu^2}$$

It might be worth saying a little bit about how to unpack this back to integers. Let $\mu=p/q$, for some relatively prime $(p,q)$. Our solutions are of the form $$(z^2 \frac{q^2 - 21 p^2}{q^2+21 p^2}, z^2 \frac{2 pq}{q^2 + 21 p^2}, z)$$ for any $z$ for which the first two terms are integers.

One should probably be able to simplify this a little more: For example, I'm pretty sure that, up to factors of $2$, $3$ and $7$, the least common denominator of $X$ and $Y$ is $p^2 + 21 q^2$. I'll leave for that for those who are interested.

-

This is an old post, but I believe a clarification to the other answer might be useful. The equation,

$$x^2+dy^2 = z^k\tag{1}$$

for $k = 2$ has a complete solution in terms of the single formula,

$$((p^2-dq^2)u)^2+d(2pqu)^2=((p^2+dq^2)u)^2\tag{2}$$

where $u$ is a scaling factor. However, the situation when $k>2$ is different. One can factor $(1)$ over $\sqrt{-d}$ and find formulas for all positive integer $k$. For example,

$$\big((p^3-3dpq^2)u^3\big)^2 + d((3p^2q-dq^3)u^3\big)^2 = ((p^2+dq^2)u^2)^3\tag{3}$$

But Pepin found that additional solutions can be given, like,

$$(13u^3+60u^2v-168uv^2-144v^3)^2 + 47(u^3-12u^2v-24uv^2+16v^3)^2 = 2^3(3u^2+2uv+16v^2)^3\tag{4}$$

not covered by $(3)$. For $k=4$, the impulse is to apply the complete formula $(2)$ onto itself,

$$p = (r^2-ds^2)v$$ $$q = (2rs)v$$

to get,

$$\big((r^4 - 6 d r^2 s^2 + d^2 s^4) u v^2\big)^2 + d\big(4 r s (r^2 - d s^2) u v^2\big)^2 = (r^2 + d s^2)^4 u^2 v^4\tag{5}$$

For the RHS to be a 4th power, one has to make the assumption that $u$ in the original triple $(2)$ is a square, hence it loses its generality. For example, for $d=21$, there is no rational ${r,s,u,v}$ that yields,

$$170^2 + 21\cdot51^2 = 17^4\\ 17^2\big(10^2 +21\cdot3^2 = 17^2\big) \tag{6}$$

$$\big((p^2 - d q^2) u^2 z\big)^2 + d\big(2 p q u^2 z\big)^2 = (u z)^4\tag{7}$$
where $z = p^2 + d q^2$. Notice that the terms of $(5)$ can be co-prime if $u=v=1$, but $(7)$ is never co-prime.
In summary, I am not sure if $(5)$ and $(7)$ cover all cases of $k=4$. (Compare it to $k = 2$, which has only one formula whether terms are co-prime or not.)