Problem:
For an integer , let denote the number of pairs of integers such that . Compute the sum
Write your answer in the form , where is an integer and is a decimal number.
If your answer is written in this form, your score will be , where is your answer to this problem and is the actual answer. Otherwise, your score will be zero.
HMMT February
Solution
Solution:
Answer:
Rewrite the sum as
where the sum is over all pairs of integers with . We can find a crude upper bound for this sum by noting that
so each term of this sum has . Similarly, . Therefore, the number of terms in the sum is at most
(We are throwing away "small" factors like in the approximation.) Furthermore, each term in the sum is at most , so the total sum is less than about . The answer would unfortunately still get a score of 0.
For a better answer, we can approximate the sum by an integral:
Performing the change of variables and then switching to polar coordinates yields
This is approximately , which is much closer to the actual answer. (An answer of is good enough for full credit.)
The answer can also be computed exactly by the Common Lisp code:
```
(defconstant +MAX+ 1e6)
(defvar +lower+ -2000)
(defvar +upper+ 2000)
(princ
(loop for x from +lower+ to +upper+ sum
(loop for y from +lower+ to +upper+
sum
(let ((S (+ ( x x) ( x y) (* y y))))
(if (and (<= S +MAX+) (> S 0)) S 0))))
```