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 and in this way

We see that

and this can be demonstrated via induction.

Let the ordered pair of digits represent the condition that and

Then

, etc.

Since

It follows that

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

This follows easily since being perpetually less than 1 implies that .

(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.