Question 30

Let $$d(m)$$ denote the number of positive integer divisors of a positive integer $$m$$. If $$r$$ is the number of integers $$n\le 2023$$ for which $$\sum_{i=1}^{n}d(i)$$ is odd, find the sum of the digits of $$r$$.


Correct Answer: 18

Write the running divisor-sum in parity (odd/even) form:

For any integer $$m$$, the divisor count $$d(m)$$ is odd ⇔ $$m$$ is a perfect square.
Reason: divisors come in pairs $$a,\;m/a$$; a divisor is unpaired only when $$a=m/a$$, i.e. when $$a^2=m$$.

Hence for every $$i$$,

$$d(i)\equiv\begin{cases}1 &\text{(mod 2) if } i \text{ is a square}\\ 0 &\text{(mod 2) otherwise}\end{cases}$$

Consider the partial sum

$$S(n)=\sum_{i=1}^{n}d(i)\pmod{2}.$$

Its parity equals the number of perfect squares ≤ $$n$$, counted modulo 2. The count of squares ≤ $$n$$ is $$\lfloor\sqrt{n}\rfloor$$, so

$$S(n)\text{ is odd}\;\Longleftrightarrow\;\lfloor\sqrt{n}\rfloor\text{ is odd}.$$(1)

Let $$k=\lfloor\sqrt{n}\rfloor$$. For each odd $$k$$, condition (1) holds for every $$n$$ in the block

$$k^2\le n\le (k+1)^2-1.$$

The length of this block is

$$(k+1)^2-k^2=(2k+1).$$(2)

All $$n$$ under consideration satisfy $$n\le2023$$. Since $$44^2=1936\lt2023$$ and $$45^2=2025\gt2023$$, we have $$\lfloor\sqrt{n}\rfloor\le44.$$ Thus $$k$$ runs over the odd integers

$$1,\,3,\,5,\dots,\,43.$$

There are $$\dfrac{43+1}{2}=22$$ such values. Using (2), the required count is

$$r=\sum_{\substack{k=1\\k\text{ odd}}}^{43}(2k+1).$$(3)

Write $$k=2j-1\;(j=1\text{ to }22)$$. Then

$$2k+1=2(2j-1)+1=4j-1,$$

and (3) becomes

$$r=\sum_{j=1}^{22}(4j-1)=4\sum_{j=1}^{22}j-\sum_{j=1}^{22}1.$$

Compute the two sums:

$$\sum_{j=1}^{22}j=\frac{22\cdot23}{2}=253,$$

$$\sum_{j=1}^{22}1=22.$$

Therefore

$$r=4(253)-22=1012-22=990.$$

The problem asks for the sum of the digits of $$r$$:

$$9+9+0=18.$$

Answer: 18

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