# $\exists a, b \in \mathbb{Z}$ such that $a^2 + b^2 = 5^k$

I saw this problem recently and found an elegant solution to it, and was curious to see if anybody would think of something else. Nice solutions to nice problems are fun to see!

Problem: Prove that, for all non-negative integers $$k$$, there exist integers $$a$$, $$b$$ such that $$a^2+b^2=5^k$$.

Bonus: Prove that there exist such $$a$$ and $$b$$ that furthermore satisfy $$(a,b)=1$$.

At heart, $$a^2+b^2$$ can be seen as the square of the distance of $$a+bi$$ to $$0$$ in the complex numbers. And if $$w,z$$ are complex numbers, then $$|wz|=|w|\cdot |z|$$, so $$|wz|^2 = |w|^2\cdot |z|^2$$.

That means that if $$a+bi = (2+i)^n$$ then $$a^2+b^2 = |a+bi|^2 = \left(|2+i|^2\right)^n = 5^n$$.

This approach gets you $$a,b$$ relatively prime and non-zero.

The other way is just to take the case of $$n=2m$$ even first:

$$5^{2m} = \left(5^m\right)^2 +0^2$$

For $$n=2m+1$$ odd, you get:

$$5^{2m+1} = \left(2\cdot 5^m\right)^2 + \left(1\cdot 5^m\right)^2$$

There is another way, closely associated with the complex answer, using determinants of matrices of the form:

$$\begin{pmatrix}x&y\\-y&x\end{pmatrix}$$

Such matrices are closed under multiplication, and the determinant is $$x^2+y^2$$.

Since the product of determinants is the determinant of the product, you only need to find a solution of $$x^2+y^2=5$$ and raise that matrix to the $$n$$th power.

This gives you exactly the same answer(s) as my first approach, since the ring of matrices of this form is "isomorphic" to the complex numbers. But the determinant is in some ways an "algebraic" answer, compared to the distance property.

• Yes, this is essentially the approach I used to obtain $(a,b)=1$. Aug 20 '13 at 18:11
• Which? I've listed three approaches. :) Aug 20 '13 at 18:11
• Oh, derp. I didn't finish reading when I posted that. The first one, where you say "this approach gets you $a,b$ relatively prime and non-zero". My approach was more along the lines of the Binomial theorem, but your approach boils down to the same thing. Aug 20 '13 at 18:12

HINT:

Using induction:

$5^1=2^2+1^2$

Let $5^k=a^2+b^2$

$5^{k+1}=(a^2+b^2)(2^2+1^2)=(2a\pm b)^2+(2b\mp a)^2$ (Brahmagupta–Fibonacci identity)

This invites a little generalization: as we which numbers are expressible as the sum of two squares.

• Yes, this is what I did. I posted the question, though for people to post their full solutions, so as to discuss, not because I wanted a hint. I solved this problem already. :) Aug 20 '13 at 17:58
• @Ahaan You should have written your solution. Aug 20 '13 at 17:59
• It's essentially the same as Lab's solution. Aug 20 '13 at 17:59
• The most simplest! Jun 24 '14 at 12:16

Take the ring $\mathbb{Z}[i]$ and the norm function $$N(x+iy) = x^2 + y^2$$ Then $N(z_1z_2) = N(z_1)N(z_2)$. So just take $$z = (2+i)^k = a+bi$$ Then $a^2+b^2 = N(z) = N(2+i)^k = 5^k$

• Agh! I was posted this as an answer when I got the update that you posted this. Yes, this is exactly what I did. It's the same idea as Lab's solution but your solution mirrors mine. I've added a bonus to the OP. Aug 20 '13 at 18:03
{"ft_lang_label":"__label__en","ft_lang_prob":0.85653067,"math_prob":0.9998209,"size":1172,"snap":"2021-31-2021-39","text_gpt3_token_len":397,"char_repetition_ratio":0.11986301,"word_repetition_ratio":0.0,"special_character_ratio":0.33361775,"punctuation_ratio":0.08745247,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.000005,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-24T06:21:00Z\",\"WARC-Record-ID\":\"<urn:uuid:c7d99e66-cf7d-44e4-94b9-6b9d6e374d0b>\",\"Content-Length\":\"192260\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a2476743-a699-4b61-a89b-893787fa13ee>\",\"WARC-Concurrent-To\":\"<urn:uuid:e33fb09c-dfa8-41c9-b918-1ac7f9220ab1>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/472192/exists-a-b-in-mathbbz-such-that-a2-b2-5k\",\"WARC-Payload-Digest\":\"sha1:KEJJZW4WOXKO5BMDTMWVIDQLH4YMHSGK\",\"WARC-Block-Digest\":\"sha1:3W4KLATC2AZ422F3VDGXPKO66BQMP7GK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057504.60_warc_CC-MAIN-20210924050055-20210924080055-00653.warc.gz\"}"}