Solution 1
(k−21)2=k2−k+41 and (k+21)2=k2+k+41. Therefore b(p)=k if and only if p is in this range, or k2−k.Thereare2knumbersinthisrange,sothesumofb(p)overthisrangeis(2k)k=2k^2.44<\sqrt{2007}<45,soallnumbers1to44havetheirfullrange.Summingthisupwiththeformulaforthesumofthefirstnsquares(\frac{n(n+1)(2n+1)}{6}),weget\sum_{k=1}^{44}2k^2=2\frac{44(44+1)(2*44+1)}{6}=58740.Weneedonlyconsiderthe740becauseweareworkingwithmodulo1000$.
Now consider the range of numbers such that b(p)=45. These numbers are ⌈2442+452⌉=1981 to 2007. There are 2007−1981+1=27 (1 to be inclusive) of them. 27∗45=1215, and 215+740=955, the answer.
Solution 2
Let p be in the range of a2≤p<(a+1)2. Then, we need to find the point where the value of b(p) flips from k to k+1. This will happen when p exceeds (a+21)2 or a(a+1)+41. Thus, if a2≤p≤a(a+1) then b(p)=a. For a(a+1)<p<(a+1)2, then b(p)=a+1. There are a+1 terms in the first set of p, and a terms in the second set. Thus, the sum of b(p) from a2≤p<(a+1)2 is 2a(a+1) or 4⋅(2a+1). For the time being, consider that S=∑p=1442−1b(p). Then, the sum of the values of b(p) is 4(22)+4(23)+⋯+4(244)=4((22)+(23)+⋯+(244)). We can collapse this to 4(345)=56760. Now, we have to consider p from 442≤p<2007. Considering p from just 442≤p≤1980, we see that all of these values have b(p)=44. Because there are 45 values of p in that range, the sum of b(p) in that range is 45⋅44=1980. Adding this to 56760 we get 58740 or 740 mod 1000. Now, take the range 1980<p≤2007. There are 27 values of p in this range, and each has b(p)=45. Thus, that contributes 27∗45=1215 or 215 to the sum. Finally, adding 740 and 215 we get 740+215=955.
~firebolt360
Video Solution
2007 AIME I #11
MathProblemSolvingSkills.com