GeometryDifficulty 5.5AIME, harderFind the answerUnited States
Problem: For an integer n, let f(n) denote the number of pairs (x,y) of integers such that x2+xy+y2=n. Compute the sum n=1∑106nf(n) Write your answer in the form a⋅10b, where b is an integer and 1≤a<10 is a decimal number. If your answer is written in this form, your score will be max{0,25−⌊100∣log10(A/N)∣⌋}, where N=a⋅10b is your answer to this problem and A is the actual answer. Otherwise, your score will be zero.
A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.
Solution
Solution: Answer: 1.813759629294⋅1012
Rewrite the sum as x2+xy+y2≤106∑(x2+xy+y2), where the sum is over all pairs (x,y) of integers with x2+xy+y2≤106. We can find a crude upper bound for this sum by noting that x2+xy+y2=43x2+(2x+y)2≥43x2 so each term of this sum has ∣x∣≤32103. Similarly, ∣y∣≤32103. Therefore, the number of terms in the sum is at most (34103+1)2≈106 (We are throwing away "small" factors like 316 in the approximation.) Furthermore, each term in the sum is at most 106, so the total sum is less than about 1012. The answer 1⋅1012 would unfortunately still get a score of 0.
For a better answer, we can approximate the sum by an integral: x2+xy+y2≤106∑(x2+xy+y2)≈∬x2+xy+y2≤106(x2+xy+y2)dydx Performing the change of variables (u,v)=(23x,21x+y) and then switching to polar coordinates (r,θ)=(u2+v2,tan−1(v/u)) yields ∬x2+xy+y2≤106(x2+xy+y2)dydx=32∬u2+v2≤106(u2+v2)dvdu=32∫02π∫0103r3drdθ=34π∫0103r3dr=3π⋅1012 This is approximately 1.8138⋅1012, which is much closer to the actual answer. (An answer of 1.8⋅1012 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)))) ```
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement reproduced verbatim; metadata (topic, difficulty) added by this project.