Difference between revisions of "2005 AIME I Problems/Problem 12"

m
Line 3: Line 3:
  
 
== Solution ==
 
== Solution ==
{{solution}}
+
It is well-known that <math>\tau(n)</math> is odd if and only if <math>n</math> is a [[perfect square]].  (Otherwise, we can group [[divisor]]s into pairs whose product is <math>n</math>.)  Thus, <math>S(n)</math> is odd if and only if there are an odd number of perfect squares less than <math>n</math>.  So <math>S(1), S(2)</math> and <math>S(3)</math> are odd, while <math>S(4), S(5), \ldots, S(8)</math> are even, and <math>S(9), \ldots, S(15)</math> are odd, and so on.
 +
 
 +
So, for a given <math>n</math>, if we choose the positive integer <math>m</math> such that <math>m^2 \leq n < (m + 1)^2</math> we see that <math>S(n)</math> has the same parity as <math>m</math>. 
 +
 
 +
 
 +
It follows that the numbers between <math>1^2</math> and <math>2^2</math>, between <math>3^2</math> and <math>4^2</math>, and so on, all the way up to the numbers between <math>43^2</math> and <math>44^2 = 1936</math> have <math>S(n)</math> odd, and that these are the only such numbers less than <math>2007</math> (because <math>45^2 = 2025 > 2007</math>).
 +
 
 +
Thus <math>a = (2^2 - 1^2) + (4^2 - 3^2) + \ldots + (44^2 - 43^2)</math>.
 +
 
 +
Similarly, <math>b = (3^2 - 2^2) + (5^2 - 4^2) + \ldots + (45^2 - 44^2) - 17</math>, where the <math>-17</math> accounts for those numbers between <math>2007</math> and <math>2024</math>.
 +
 
 +
Then <math>|a - b| = |2(2^2 + 4^2 + \ldots + 44^2) - 2(1^2 + 3^2 + 5^2 + \ldots 43^2) + 1^2 - 45^2 + 17|</math>.
 +
 
 +
 
 +
We must now apply the formula <math>1^2 + 2^2 + \ldots + n^2 = \frac{n(n + 1)(2n + 1)}{6}</math>.  From this formula, it follows that <math>2^2 + 4^2 + \ldots + (2n)^2 = \frac{2n(n + 1)(2n + 1)}{3}</math> and so that <math>1^2 + 3^2 + \ldots +(2n + 1)^2 = (1^2 + 2^2 + \ldots +(2n + 1)^2) - (2^2 + 4^2 + \ldots + (2n)^2) = \frac{(2n + 1)(2n + 2)(4n + 3)}{6} - \frac{2n(n + 1)(2n + 1)}{3} = \frac{(n + 1)(2n + 1)(2n + 3)}{3}</math>.  Thus,
 +
 
 +
<math>|a - b| = \left| 2\cdot \frac{44\cdot23\cdot45}{3} - 2\cdot \frac{22 \cdot 43 \cdot 45}{3} - 45^2 + 18\right| = |-27| = 027</math>.
  
 
== See also ==
 
== See also ==

Revision as of 12:58, 17 January 2007

Problem

For positive integers $n,$ let $\tau (n)$ denote the number of positive integer divisors of $n,$ including 1 and $n.$ For example, $\tau (1)=1$ and $\tau(6) =4.$ Define $S(n)$ by $S(n)=\tau(1)+ \tau(2) + \cdots + \tau(n).$ Let $a$ denote the number of positive integers $n \leq 2005$ with $S(n)$ odd, and let $b$ denote the number of positive integers $n \leq 2005$ with $S(n)$ even. Find $|a-b|.$

Solution

It is well-known that $\tau(n)$ is odd if and only if $n$ is a perfect square. (Otherwise, we can group divisors into pairs whose product is $n$.) Thus, $S(n)$ is odd if and only if there are an odd number of perfect squares less than $n$. So $S(1), S(2)$ and $S(3)$ are odd, while $S(4), S(5), \ldots, S(8)$ are even, and $S(9), \ldots, S(15)$ are odd, and so on.

So, for a given $n$, if we choose the positive integer $m$ such that $m^2 \leq n < (m + 1)^2$ we see that $S(n)$ has the same parity as $m$.


It follows that the numbers between $1^2$ and $2^2$, between $3^2$ and $4^2$, and so on, all the way up to the numbers between $43^2$ and $44^2 = 1936$ have $S(n)$ odd, and that these are the only such numbers less than $2007$ (because $45^2 = 2025 > 2007$).

Thus $a = (2^2 - 1^2) + (4^2 - 3^2) + \ldots + (44^2 - 43^2)$.

Similarly, $b = (3^2 - 2^2) + (5^2 - 4^2) + \ldots + (45^2 - 44^2) - 17$, where the $-17$ accounts for those numbers between $2007$ and $2024$.

Then $|a - b| = |2(2^2 + 4^2 + \ldots + 44^2) - 2(1^2 + 3^2 + 5^2 + \ldots 43^2) + 1^2 - 45^2 + 17|$.


We must now apply the formula $1^2 + 2^2 + \ldots + n^2 = \frac{n(n + 1)(2n + 1)}{6}$. From this formula, it follows that $2^2 + 4^2 + \ldots + (2n)^2 = \frac{2n(n + 1)(2n + 1)}{3}$ and so that $1^2 + 3^2 + \ldots +(2n + 1)^2 = (1^2 + 2^2 + \ldots +(2n + 1)^2) - (2^2 + 4^2 + \ldots + (2n)^2) = \frac{(2n + 1)(2n + 2)(4n + 3)}{6} - \frac{2n(n + 1)(2n + 1)}{3} = \frac{(n + 1)(2n + 1)(2n + 3)}{3}$. Thus,

$|a - b| = \left| 2\cdot \frac{44\cdot23\cdot45}{3} - 2\cdot \frac{22 \cdot 43 \cdot 45}{3} - 45^2 + 18\right| = |-27| = 027$.

See also