Why is 5 the answer to this question?

Looking through unanswered posts on Yahoo! Answers, while trying to find one that had compelling interest, I found this one:

**Find the digit that appears immediately before the decimal point in: (8 + sq root(59))^(2013!)?**

Was trying to figure this out the whole night. Please help!

- 4 days ago
- - 12 hours left to answer.

Find the digit that appears immediately before the decimal point in: (8 + sq root(59))^(2013!)? - Yahoo! Answers

Like the OP I have been scratching my head on this one. Can anybody help?

Re: Why is 5 the answer to this question?

I posted the same question in the Drexel Math Forum, and got this result (reply to that post) by Ara M Jamboulian:

Ara's *Idea* expanded goes like this:

(1) Let a = 8 + sqrt(59) and b = 8 - sqrt(59)

(2) Prove by induction that a^k + b^k is congruent to 6 mod 10 for any integer k >= 2.

Defining $\displaystyle c_k$ and $\displaystyle d_k$ in this way

$\displaystyle a^k=c_k+d_k\sqrt{59}\hspace{8}and\hspace{8}b^k=c_k-d_k\sqrt{59}$

We see that

$\displaystyle c_{k+1}=8c_k+59d_k\hspace{8}and\hspace{8}d_{k+1}=8 d_k+c_k$

and this can be demonstrated via induction.

Let the ordered pair of digits $\displaystyle (c,d)_k$ represent the condition that $\displaystyle c_k\hspace{4}mod\hspace{4}10\equiv c$ and $\displaystyle d_k\hspace{4}mod\hspace{4}10 \equiv d$

Then

$\displaystyle (8,1)_1 \rightarrow (3,6)_2 \rightarrow (8,1)_3$, etc.

Since

$\displaystyle \hspace{8}a^k+b^k=2c_k$

It follows that

$\displaystyle \hspace{8}a^k+b^k\equiv\6\hspace{4}mod\hspace{4}10 \hspace{8}(8\rightarrow 6\hspace{8}and\hspace{8}3\rightarrow 6)$

(3) Also prove that floor[a^k]=a^k + b^k - 1

This follows easily since $\displaystyle b^k$ being perpetually less than 1 implies that $\displaystyle floor[a^k] = 2c_k -1 = a^k+b^k - 1$.

(4) It follows that floor[a^k] is congruent to 5 mod 10.

(Thanks to both the OP and Ara for this interesting problem and help towards its solution.)

I wondered if the numbers 8 and 59 had any special significance. There seems to be none. Some numbers cause the last digit to oscillate through a series of digits. Perhaps there are some surprises in the more general situation, but intuitively I think not.