Thursday, February 16, 2012

Ant's travel in a grid

Problem:  There is an ant which can walk around on a planar grid. The ant can move one space at a time left, right, up or down. That is, from (x, y) the ant can go to (x+1, y), (x-1, y), (x, y+1), and (x, y-1). Points where the sum of the digits of the x coordinate plus the sum of the digits of the y coordinate are greater than 25 are inaccessible to the ant. Example For example, the point (59, 79) is inaccessible because 5 + 9 +...