Question 18

Let $$p, q$$ be two-digit numbers neither of which are divisible by $$10$$. Let $$r$$ be the four-digit number by putting the digits of $$p$$ followed by the digits of $$q$$ (in order). As $$p, q$$ vary, a computer prints $$r$$ on the screen if $$\gcd(p,q)=1$$ and $$p+q$$ divides $$r$$. Suppose that the largest number that is printed by the computer is $$N$$. Determine the number formed by the last two digits of $$N$$ (in the same order).


Correct Answer: 13

Let the two-digit numbers be written in decimal form as
$$p = 10a + b,\qquad q = 10c + d$$
with digits $$a,b,c,d \in \{0,1,\dots ,9\}$$, where $$a,c \neq 0$$ because $$p,q$$ have two digits and $$b,d \neq 0$$ because they are not divisible by $$10$$.

When the computer writes the four-digit number $$r$$ by appending the digits of $$p$$ followed by those of $$q$$, we obtain
$$r = 100p + q\;.\quad -(1)$$

The conditions given are

1. $$\gcd(p,q)=1$$,

2. $$p+q$$ divides $$r$$.

Denote $$s = p+q$$. Using $$(1)$$, the divisibility requirement is

$$s \mid (100p + q).$$

Because $$q = s-p$$, substitute to get

$$100p + q \;=\; 100p + (s-p) \;=\; 99p + s.$$ Thus
$$s \mid (99p + s)\;\Longrightarrow\; s \mid 99p.$$

Now, $$\gcd(p,s)=\gcd\bigl(p,p+q\bigr)=\gcd(p,q)=1$$ by condition 1. Since $$p$$ is coprime to $$s$$ and $$s\mid 99p$$, we must have

$$s \mid 99.\quad -(2)$$

The positive divisors of $$99$$ are $$1,3,9,11,33,99$$. But $$s=p+q$$ is the sum of two two-digit numbers, so $$20 \le s \le 198$$. Hence, from (2), the only possibilities are

$$s = 33 \quad \text{or} \quad s = 99.$$

Case 1: $$p+q = 99$$

Here $$q = 99 - p$$. To keep $$q$$ two-digit we need $$10 \le q \le 89\;\Longrightarrow\; 10 \le p \le 89$$.

The four-digit number equals
$$r = 100p + q = 100p + (99-p) = 99p + 99.$$
Because the coefficient of $$p$$ is positive, $$r$$ increases with $$p$$, so we search downward from the largest admissible $$p=89$$ until all conditions are met.

pq=99-pUnits digitsgcd(p,q)Admissible?
8910q ends in 0—No
8811ok11No
8712ok3No
8613ok1Yes

The first admissible value is $$p=86,\;q=13$$, giving
$$r = 100\,(86)+13 = 8613.$$ Any smaller $$p$$ yields a smaller $$r$$, so this is the largest $$r$$ in Case 1.

Case 2: $$p+q = 33$$

Now $$q = 33 - p$$ with $$10 \le p \le 23$$ to keep both two-digit. Here
$$r = 100p + q = 99p + 33,$$ again increasing with $$p$$. Testing downwards:

pq=33-pUnits digitsgcd(p,q)Admissible?
2310q ends in 0—No
2211ok11No
2112ok3No
2013p ends in 0—No
1914ok1Yes

This gives $$r = 100\,(19)+14 = 1914,$$ which is far smaller than $$8613$$ from Case 1.

Therefore the largest four-digit number printed by the computer is $$N = 8613.$$ The last two digits of $$N$$ are $$\boxed{13}$$.

Get AI Help

Book Free CAT Mentorship

Get personalized CAT strategy from a 99%iler

500+ students mentored
CAT mentor
banner

banner

50,000+ JEE Students Trusted Our Score Calculator

Predict your JEE Main percentile, rank & performance in seconds

Ask AI