I am thinking of a fifty-digit number divisible by 239, of which, each digit is the same, except the ones digit. What is the ones digit?

(In reply to

Answer by K Sengupta)

At the outset, let us denote:

111...11 (repeated x times) by f(x).

Now, we observe that:

f(7) = 1,111,111 = 239*4649

Thus, f(7) is divisible by 239.

It is easy to prove by induction that f(7n) will be divisible by n, whenever n is a positive integer.

Substituting n=7, we observe that f(49) is divisible by 239.

Let the 50 digit number be B(say), whose repeated digit is s(say) and the ones digit be t(say).

Then,

B = 10*s*f(49) + t, whenever 1<= s<=9, and 0<= t<=9

Since f(49) is divisible by 49, it follows that 10*s*f(49) must be divisible by 239.

If 1<=t<= 9 in that situation, we observe that B will never be divisible by 239, since gcd(t, 239) = 1 for 1 <=t< = 9.

Accordingly, t = 0, and consequently, the required ones digit is 0.