# A simple number theory problem that drives me insane

#### PapaKurke

##### New member
So this problem is listed as an 8th grade problem and yet i can’t solve it. Honestly it makes me feel dumb. It goes like this : ”Find all odd natural numbers so that 2^n + 3^n + 4^n is a perfect square.” I’ve tried proving that it’s between two integer squares, tried checking if it’s divisible by nine since it’s always by 3 but all failed. Please help!

#### Jomo

##### Elite Member
Hi,
What have you tried? If you show us your work then we will know how to guide you.
Have you noticed that n=1 works?
Why do you think that it is always divisible by 3?

• PapaKurke and topsquark

#### pka

##### Elite Member
So this problem is listed as an 8th grade problem and yet i can’t solve it. Honestly it makes me feel dumb. It goes like this : ”Find all odd natural numbers so that 2^n + 3^n + 4^n is a perfect square.” I’ve tried proving that it’s between two integer squares, tried checking if it’s divisible by nine since it’s always by 3 but all failed. Please help!
There is no reason for you to think of yourself as dumb!
As Jomo points out $$\displaystyle n=1$$ does work. So you should have tried that.
But I cannot see this as an eighth grade question. look at this.
None of the next 49 odd powers work. If I were you, I would go to the authority of eight grader and demand to know why this question was given. I would happily give my assessment of this question.

• PapaKurke, topsquark and JeffM

#### JeffM

##### Elite Member
Problems in number theory are seldom easy, and I have no reason to think that it is useful to pose such problems to 8th graders. For example, your result that any such number is divisible by 3 is very nice. By the binomial theorem,

$$\displaystyle 2^n + 3^n + 4^n = (3 - 1)^n + 3^n + (3 + 1)^n =$$

is certainly divisible by 3 because

$$\displaystyle (-\ 1)^{(2k-1)} * \dbinom{2k-1}{0} * 3^0 * 1^{(2k-1)} + \dbinom{2k-1}{0} * 3^0 * 1^{(2k-1)} = 0.$$

Well done. Unfortunately, few 8th graders know the binomial theorem so I doubt that was a possible approach that they were intended to explore.

One possibility is that n = 1 is the only answer. Shades of Fermat's Last Theorem seem to lurk. My suggestion is to use a computer to check whether any n works in the range of numbers reachable by your computer. If one does, think about mathematical induction.

EDIT: Check to see whether a bound was placed on n in the original problem. That makes the problem rather foolish, but THEN it certainly is within the capabilities of someone in eighth grade.

Last edited:
• PapaKurke and topsquark

#### PapaKurke

##### New member
Thank you all for your replies. No, there is no bound on n, and no, this is definitely not a simple problem. I have managed, however, to solve it. The answer came to me, surprisingly enough, in my sleep.

Suppose n>1 , then 4|(2^n) and 4|(4^n) . Since n is odd and 3 = (-1) mod 4 then it holds 3^n = (-1) mod 4. We have therefore proven that for all n>1 the expression gives a remainder of 3 when diving by 4.

Looking at any perfect square at all we see that they all give a remainder of either 0 or 1 with 4:
(0)^2 = 0 mod 4
(1)^2 = 1 mod 4
(2)^2 = 0 mod 4
(3)^2 = 1 mod 4.
Which means that for n>1 the given expression is not a perfect square.

We therefore only need to check n=1 which, conveniently, is a solution, so the only solution is n=1.

I once again thank you for all your replies and exclaim once more how flawed our educational system is giving this to 8th graders. I am a 10th grader and could barely come up with this. Perhaps there is a more elegant solution I am simply failing to see?

Edit #1: Commenting further on the problem. For even n there are, I would at least believe, more solutions as the given expression gives a remainder of 1 with 4 bringing the possibility of the expression being a perfect square back.

Edit #2: Giving the problem for even n another good look we see that the expression is (-1)^2n + (0)^2n + (1)^2n = 2 mod 3 , and since no squares give a remainder of 2 when divided by 3 (easily proven similarly to how no squares give a remainder of 3 with 4) there are no such even numbers n.

Last edited:
• topsquark

#### Dr.Peterson

##### Elite Member
What educational system assigned this problem? What do 8th graders there learn about number theory? Is this a problem all of them are expected to do, or is it a contest problem for only those with special training? We can't really judge it without knowing the context.

#### JeffM

##### Elite Member
It is only divisible by 3 for odd values of n
Note that 3 does not divide (2^2 + 3^2 + 4^2) =29
Can n be even and we get the desired results?
Yes, but the original problem restricted n to odd integers.

• Jomo

#### PapaKurke

##### New member
What educational system assigned this problem? What do 8th graders there learn about number theory? Is this a problem all of them are expected to do, or is it a contest problem for only those with special training? We can't really judge it without knowing the context.
The problem was given to 8th graders as a preparation for the local city competition along with other banal problems such as solving a system of linear equations and solving the absolute simplest of geometry problems (such as proving a quadrilateral is a parallelogram if its opposing angles are equal and a single pair of its sides are parallel). This one definitely stuck out, as there is no business for congruencies to be something 8th graders should worry about at this level. Formally, they should appear only at national junior olympiad level.