A base ten number formed by writing the digit seven precisely 2011 times is denoted by N. That is:

N = 77……77 (2011 times).

Let us denote x = [N/9], y = [x/9] and, z = [y/9]

Determine the

**digital root** of z.

__Note__: [P] denotes the greatest integer ≤ P

**** For an extra challenge, solve this puzzle without using a computer program.

This problem is equivalent to converting N to base 9 and reading the digits; specifically we need the fourth base 9 digit from the right (least significant digits).

N can be expressed as 7*(10^2011-1)/9. Then 9*N is 7*(10^2011-1), which is without fractions. Finding 10^2011 mod 9^5 is the intermediate goal.

By binomial expansion 10^2011 = (9 + 1)^2011 = 9^2011 + .... + 2011C4*9^4 + 2011C3*9^3 + 2011C2*9^2 + 2011*9 + 1

The last five terms are the only terms which are not multiples of 9^5.

2011C4 mod 9 = 4, then 2011C4*9^4 mod 9^5 = 4*9^4

2011C3 mod 9 = 34, then 2011C3*9^3 mod 9^5 = 34*9^3

2011C2 mod 9 = 267, then 2011C2*9^2 mod 9^5 = 267*9^2

Then 10^2011 = (4*9^4 + 34*9^3 + 267*9^2 + 2011*9 + 1) mod 9^5, which simplifies to 10^2011 = 31708 mod 9^5.

Then 9*N = 7*31707 mod 9^5 = 44802. 44802 converted to base 9 is 67410.

From this the last four digits of N in base 9 are 6741. The answer to this puzzle is **6**. As a check these digits agree with Charlie's direct calculation.