It’s also broken ;-)

Your code is checking 401 years (between the year 0 and the year 400, inclusive)

Changing 0..400 to 0…400 would do the right thing.