Tribute to a very special woman...

The following was written by one of my daughters. It expresses what each of
us feels every day after six years...
A little boy walks by alone on the sidewa...
1 month ago
The answer is 24800.
ReplyDeleteInteger solutions correspond to lattice points inside the right triangle with vertices (0,0), (250,0), and (0,200), together with the points on the hypotenuse, but excluding (250,0) and (0,200).
We start with the rectangle with corners (0,0), (250,0), (0,200), and (250,200). The rectangle contains 251*201 = 50451 lattice points.
The diagonal from (250,0) to (0,200) contains 51 lattice points. Of the remaining 50400 lattice points, half of them (or 25200) lie below the diagonal.
To get the final answer, we add back the lattice points on the diagonal, and then subtract the lattice points on the axes.
So the answer is 25200 + 51  200  250  1 = 24800.
;; Brute forced in scheme:
ReplyDelete(define (potd x c) (if (> 1001 (* 5 x)) (potd (+ 1 x) (+ c (floor (/ ( 1000 (* 5 x)) 4)))) c))
(potd 1 0)