# Find the value of a fraction

#### anemone

##### MHB POTW Director
Staff member
Problem:

Find the value of $\displaystyle \frac{1^4+2007^4+2008^4}{1^2+2007^2+2008^2}$.

My Attempt:

For the numerator, I expand them using the Binomial Theorem and get:

$\displaystyle 1^4+2007^4+2008^4$

$\displaystyle=1+(2000+7)^4+(2000+8)^4$

$\displaystyle =1+2000^4+4(2000)^3(7)^1+6(2000)^2(7)^2+4(2000)^1(7)^3+7^4$

$\displaystyle +2000^4+4(2000)^3(8)^1+6(2000)^2(8)^2+4(2000)^1(8)^3+8^4$

$\displaystyle =2(2000^4)+60(2000)^3+678(2000)^2+3420(2000)+6498$

I do the same for the denominator and get:

$\displaystyle 1^2+2007^2+2008^2$

$\displaystyle=1+(2000+7)^2+(2000+8)^2$

$\displaystyle=1+(2000)^2+14(2000)+49+(2000)^2+16(2000)+64$

$\displaystyle=2(2000^2)+30(2000)+114$

I noticed that if I square the denominator, I get twice the value as the numerator, let's see...

$\displaystyle (1^2+2007^2+2008^2)^2$

$\displaystyle =4(2000^4)+120(2000)^3+1356(2000)^2+6840(2000)+12996$

$\displaystyle =2(2(2000^4)+60(2000)^3+678(2000)^2+3420(2000)+6498)$

So, we can say that
$\displaystyle \frac{1^4+2007^4+2008^4}{(1^2+2007^2+2008^2)^2}= \frac{1}{2}$

Therefore,
$\displaystyle \frac{1^4+2007^4+2008^4}{1^2+2007^2+2008^2}=\frac{1}{2}(1^2+2007^2+2008^2)=\frac{1}{2} (2(2000^2)+30(2000)+114)=4,030,057$

My question is, are there any other approaches to solve this problem?

#### chisigma

##### Well-known member
You can use the well known relations...

$\displaystyle \sum_{k=1}^{n} k^{2} = \frac{n\ (n+1)}{2}\ \frac{2 n +1}{3}$ (1)

$\displaystyle \sum_{k=1}^{n} k^{4} = \frac{n\ (n+1)}{2}\ \frac{2 n +1}{3}\ \frac{3 n^{2} + 3 n -1}{5}$ (2)

... but I doubt that that is a more comfortable way respect to direct computation...

Kind regards

$\chi$ $\sigma$

#### Bacterius

##### Well-known member
MHB Math Helper
If you know in advance that the fraction is an integer, you can use the following approach.

--------​

Let $f$ be the fraction we want to evaluate. Select $n = 2007$. Then:

$$1^4 + 2007^4 + 2008^4 \equiv 1^4 + 0^4 + 1^4 \equiv 2 \pmod{2007}$$
$$1^2 + 2007^2 + 2008^2 \equiv 1^2 + 0^2 + 1^2 \equiv 2 \pmod{2007}$$
Therefore:

$$f \equiv 1 \pmod{2007} \tag{1}$$
Now use $n = 2008$. We get:

$$1^4 + 2007^4 + 2008^4 \equiv 1^4 + (-1)^4 + 0^4 \equiv 2 \pmod{2008}$$
$$1^2 + 2007^2 + 2008^2 \equiv 1^2 + (-1)^2 + 0^2 \equiv 2 \pmod{2008}$$
And therefore:

$$f \equiv 1 \pmod{2008} \tag{2}$$
And we note that $\gcd{(2007, 2008)} = 1$, and so, using the CRT on (1) and (2):

$$f \equiv 1 \pmod{2007 \times 2008} ~ ~ \implies ~ ~ f \equiv 1 \pmod{4030056} \tag{3}$$
And now, observe that we can write:

$$\frac{1^4 + 2007^4 + 2008^4}{1^2 + 2007^2 + 2008^2} \approx \frac{2 \cdot 2000^4}{2 \cdot 2000^2} \approx 2000^2 \approx 4000000 \tag{4}$$
Which shows that the correct solution must be $f = 4030057$. To be absolutely rigorous, it is enough to prove that:

$$\text{The approximation error is less than the distance between two possible solutions}$$
$$\therefore$$
$$\left | \frac{1^4 + 2007^4 + 2008^4}{1^2 + 2007^2 + 2008^2} - \frac{2 \cdot 2000^4}{2 \cdot 2000^2} \right | < 4030056$$
--------​

This probabilistic approach may be overkill for the problem and is perhaps not what you were looking for, but I thought this was worth posting to illustrate a different -albeit number-theoretical - point of view.

Last edited:

#### anemone

##### MHB POTW Director
Staff member
If you know in advance that the fraction is an integer, you can use the following approach.

--------​

Let $f$ be the fraction we want to evaluate. Select $n = 2007$. Then:

$$1^4 + 2007^4 + 2008^4 \equiv 1^4 + 0^4 + 1^4 \equiv 2 \pmod{2007}$$
$$1^2 + 2007^2 + 2008^2 \equiv 1^2 + 0^2 + 1^2 \equiv 2 \pmod{2007}$$
Therefore:

$$f \equiv 1 \pmod{2007} \tag{1}$$
Now use $n = 2008$. We get:

$$1^4 + 2007^4 + 2008^4 \equiv 1^4 + (-1)^4 + 0^4 \equiv 2 \pmod{2008}$$
$$1^2 + 2007^2 + 2008^2 \equiv 1^2 + (-1)^2 + 0^2 \equiv 2 \pmod{2008}$$
And therefore:

$$f \equiv 1 \pmod{2008} \tag{2}$$
And we note that $\gcd{(2007, 2008)} = 1$, and so, using the CRT on (1) and (2):

$$f \equiv 1 \pmod{2007 \times 2008} ~ ~ \implies ~ ~ f \equiv 1 \pmod{4030056} \tag{3}$$
And now, observe that we can write:

$$\frac{1^4 + 2007^4 + 2008^4}{1^2 + 2007^2 + 2008^2} \approx \frac{2 \cdot 2000^4}{2 \cdot 2000^2} \approx 2000^2 \approx 4000000 \tag{4}$$
Which shows that the correct solution must be $f = 4030057$, as the approximation is more than sufficient:

$$\left | \frac{1^4 + 2007^4 + 2008^4}{1^2 + 2007^2 + 2008^2} - \frac{2 \cdot 2000^4}{2 \cdot 2000^2} \right | < 4030056$$
--------​

This probabilistic approach may be overkill for the problem and is perhaps not what you were looking for, but I thought this was worth posting to illustrate a different -albeit number-theoretical - point of view.

Thanks, Bacterius, as you may have already noticed, it's all Greek to me. But I enjoy reading it very much...

#### anemone

##### MHB POTW Director
Staff member
You can use the well known relations...

$\displaystyle \sum_{k=1}^{n} k^{2} = \frac{n\ (n+1)}{2}\ \frac{2 n +1}{3}$ (1)

$\displaystyle \sum_{k=1}^{n} k^{4} = \frac{n\ (n+1)}{2}\ \frac{2 n +1}{3}\ \frac{3 n^{2} + 3 n -1}{5}$ (2)

... but I doubt that that is a more comfortable way respect to direct computation...

Kind regards

$\chi$ $\sigma$
Thanks, chisigma...what you've suggested has certainly given me food for thought, but I've got to run now, I will work with it to check if your suggestion could be simplified out neatly and that we don't have to deal with bigger figures too.

#### Opalg

##### MHB Oldtimer
Staff member
Problem:

Find the value of $\displaystyle \frac{1^4+2007^4+2008^4}{1^2+2007^2+2008^2}$.

My Attempt:

For the numerator, I expand them using the Binomial Theorem and get:

$\displaystyle 1^4+2007^4+2008^4$

$\displaystyle=1+(2000+7)^4+(2000+8)^4$

$\displaystyle =1+2000^4+4(2000)^3(7)^1+6(2000)^2(7)^2+4(2000)^1(7)^3+7^4$

$\displaystyle +2000^4+4(2000)^3(8)^1+6(2000)^2(8)^2+4(2000)^1(8)^3+8^4$

$\displaystyle =2(2000^4)+60(2000)^3+678(2000)^2+3420(2000)+6498$

I do the same for the denominator and get:

$\displaystyle 1^2+2007^2+2008^2$

$\displaystyle=1+(2000+7)^2+(2000+8)^2$

$\displaystyle=1+(2000)^2+14(2000)+49+(2000)^2+16(2000)+64$

$\displaystyle=2(2000^2)+30(2000)+114$

I noticed that if I square the denominator, I get twice the value as the numerator, let's see...

$\displaystyle (1^2+2007^2+2008^2)^2$

$\displaystyle =4(2000^4)+120(2000)^3+1356(2000)^2+6840(2000)+12996$

$\displaystyle =2(2(2000^4)+60(2000)^3+678(2000)^2+3420(2000)+6498)$

So, we can say that
$\displaystyle \frac{1^4+2007^4+2008^4}{(1^2+2007^2+2008^2)^2}= \frac{1}{2}$

Therefore,
$\displaystyle \frac{1^4+2007^4+2008^4}{1^2+2007^2+2008^2}=\frac{1}{2}(1^2+2007^2+2008^2)=\frac{1}{2} (2(2000^2)+30(2000)+114)=4,030,057$

My question is, are there any other approaches to solve this problem?

I think that the OP's solution is as good as you can get. My approach was to calculate $1+x^4+(x+1)^4 = 2(x^4+2x^3+3x^2 + 2x+1) = 2(x^2+x+1)^2$, and $1+x^2+(x+1)^2 = 2(x^2+x+1)$, so that $$\frac{1+x^4+(x+1)^4}{1+x^2+(x+1)^2} = \frac{2(x^2+x+1)^2}{2(x^2+x+1)} = x^2+x+1.$$ That is the same as what anemone did for $x=2007$. Then when you use the fact that $2007 = 2000 + 7$, you easily get the answer $4030057$.

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
I think that the OP's solution is as good as you can get. My approach was to calculate $1+x^4+(x+1)^4 = 2(x^4+2x^3+3x^2 + 2x+1) = 2(x^2+x+1)^2$, and $1+x^2+(x+1)^2 = 2(x^2+x+1)$, so that $$\frac{1+x^4+(x+1)^4}{1+x^2+(x+1)^2} = \frac{2(x^2+x+1)^2}{2(x^2+x+1)} = x^2+x+1.$$ That is the same as what anemone did for $x=2007$. Then when you use the fact that $2007 = 2000 + 7$, you easily get the answer $4030057$.
I was trying to post this , but the browser just crashed ...

#### anemone

##### MHB POTW Director
Staff member
I think that the OP's solution is as good as you can get. My approach was to calculate $1+x^4+(x+1)^4 = 2(x^4+2x^3+3x^2 + 2x+1) = 2(x^2+x+1)^2$, and $1+x^2+(x+1)^2 = 2(x^2+x+1)$, so that $$\frac{1+x^4+(x+1)^4}{1+x^2+(x+1)^2} = \frac{2(x^2+x+1)^2}{2(x^2+x+1)} = x^2+x+1.$$ That is the same as what anemone did for $x=2007$. Then when you use the fact that $2007 = 2000 + 7$, you easily get the answer $4030057$.
Hi Opalg, your approach is much more better than mine because I didn't think of $2(x^4+2x^3+3x^2 + 2x+1)$ could be factorized as $2(x^2+x+1)^2$, thanks for giving me a lot of inspirations (both in the past and now) on how to tackle a maths problem more effectively.

Thanks!

#### soroban

##### Well-known member
Hello, anemone

I have a different approach.
I wouldn't claim that it is "better".

$\text{Evaluate: }\:N \;=\;\dfrac{2008^4+2007^4 + 1^4}{2008^2 + 2007^2+1^2}$

Let $u \:=\:2008$

We have: .$N \;=\;\dfrac{u^4 + (u-1)^4 + 1}{u^2 + (u-1)^2 + 1} \;=\;\dfrac{u^4+u^4-4u^3+6u^2-4u+1+1}{u^2+u^2-2u+1+1}$

. . . . . . . . . .$=\; \dfrac{2u^4-4u^3 + 6u^2 - 4u + 2}{2u^2-2u+2} \;=\;\dfrac{2(u^4-2u^3+3u^2 - 2u + 1)}{2(u^2-u+1)}$

. . . . . . . . . .$=\;\dfrac{u^4-2u^3 + 3u^2 - 2u + 1}{u^2-u+1} \;=\;\dfrac{(u^2-u+1)(u^2-u+1)}{u^2-u+1}$

. . . . . . . . . .$=\;u^2-u+1$

Back-substitute: .$N \;=\;2008^2 - 2008 + 1 \;=\;4,\!030,\!057$

#### ZaidAlyafey

##### Well-known member
MHB Math Helper

$=\;\dfrac{u^4-2u^3 + 3u^2 - 2u + 1}{u^2-u+1} \;=\;\dfrac{(u^2-u+1)(u^2-u+1)}{u^2-u+1}$

. . . . . . . . . .$=\;u^2-u+1$

Just in case factorizing isn't clear , long division will do the task ...