Question 17

For a positive integer $$n>1$$, let $$g(n)$$ denote the largest positive proper divisor of $$n$$ and $$f(n)=n-g(n)$$. For example, $$g(10)=5$$, $$f(10)=5$$ and $$g(13)=1$$, $$f(13)=12$$. Let $$N$$ be the smallest positive integer such that $$f(f(f(N)))=97$$. Find the largest integer not exceeding $$\sqrt{N}$$.


Correct Answer: 19

For every integer $$n\gt 1$$ the largest proper divisor is obtained by dividing $$n$$ by its smallest prime factor.
If the smallest prime factor is $$p$$, then

$$g(n)=\frac{n}{p},\qquad f(n)=n-g(n)=n-\frac{n}{p}=n\left(1-\frac1p\right)=n\frac{p-1}{p}\;.$$

Conversely, to solve $$f(n)=k$$ we may write

$$k=n\frac{p-1}{p}\;\Longrightarrow\; n=k\frac{p}{p-1}\;,$$

where $$p$$ is the smallest prime factor of $$n$$ and therefore satisfies $$p-1\mid k$$.

We must find the smallest $$N$$ such that $$f(f(f(N)))=97$$. Work backwards:

Case 1: Solve $$f(n_3)=97$$.

With the above reverse formula and $$k=97$$, the requirement $$p-1\mid 97$$ gives $$p-1=1$$ (since 97 is prime). Hence $$p=2$$ and

$$n_3 = 97\frac{2}{1}=194\;.$$

Case 2: Solve $$f(n_2)=n_3=194$$.

Now $$p-1\mid 194=2\cdot 97$$ gives $$p-1\in\{1,2,97,194\}$$. The admissible primes are

$$p=2\;(p-1=1):\; n_2=194\frac{2}{1}=388,$$ $$p=3\;(p-1=2):\; n_2=194\frac{3}{2}=291\;.$$

Thus the only possibilities are $$n_2\in\{388,291\}$$.

Case 3: Solve $$f(N)=n_2$$ for each candidate. (i) For $$n_2=291$$

Factor $$291=3\cdot 97$$. With $$p-1\mid 291$$ we have $$p-1=1$$ (the other divisors lead to non-primes). Thus $$p=2$$ and

$$N=291\frac{2}{1}=582,$$

whose smallest prime factor is indeed $$2$$.

(ii) For $$n_2=388$$

Factor $$388=2^2\cdot 97$$. Here $$p-1\mid 388$$ allows

$$p=2:\; N=388\frac{2}{1}=776,$$ $$p=5\;(p-1=4):\; N=388\frac{5}{4}=485,$$ $$p=389\;(p-1=388):\; N=388\frac{389}{388}=389.$$

(The choice $$p=3$$ fails because the resulting $$N=582$$ has smallest prime factor $$2\neq 3$$.)

Collecting all admissible values,

$$N\in\{776,582,485,389\}\;.$$

The smallest of these is $$N=389$$.

Verification: $$f(389)=388,\; f(388)=194,\; f(194)=97,$$ so $$f(f(f(389)))=97$$ as desired.

The question asks for $$\left\lfloor\sqrt{N}\right\rfloor$$. Since

$$19^2=361\lt 389\lt 400=20^2,$$

we have $$\sqrt{389}$$ between $$19$$ and $$20$$, and therefore

$$\left\lfloor\sqrt{N}\right\rfloor=\boxed{19}\;.$$

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