Solution
When (k−21)4≤n<(k+21)4, f(n)=k. Thus there are ⌊(k+21)4−(k−21)4⌋ values of n for which f(n)=k. Expanding using the binomial theorem,
(k+21)4−(k−21)4=(k4+2k3+23k2+21k+161)−(k4−2k3+23k2−21k+161)=4k3+k.
Thus, k1 appears in the summation 4k3+k times, and the sum for each k is then (4k3+k)⋅k1=4k2+1. From k=1 to k=6, we get ∑k=164k2+1=364+6=370 (either adding or using the sum of consecutive squares formula).
But this only accounts for ∑k=16(4k3+k)=4(26(6+1))2+26(6+1)=1764+21=1785 terms, so we still have 1995−1785=210 terms with f(n)=7. This adds 210⋅71=30 to our summation, giving 400.
Solution 2
This is a pretty easy problem just to bash. Since the max number we can get is 7, we just need to test n values for 1.5,2.5,3.5,4.5,5.5 and 6.5. Then just do how many numbers there are times ⌊n⌋1, which should be 5+17+37+65+101+145+30=400