daj95376 wrote:This is similar to a problem I was presented in the stone age while in high school.

The first worm eats diagonally through the front cover of the first book and the back cover of the last book.

The other two worms eat through the same covers ... plus the covers and pages of the remaining volumes ... using different routes to get to the same destination.

Requiring integral inches in the solution seems to force right triangles with integer dimensions. Thus, only integer dimensions to (a**2 + b**2 = c**2) will work.

the problem here is that there is no integer value combination that solves X^2 + Y^2 == 121.

So let's assume that I'm wrong about that bit of the puzzle, and work on the rest.

2*X^2 + Y^2 = 121 can be solved with 7*6*6. Since height and width must be the same, that makes the books 6*6. Since there are 2 books, the worm traveled through 3.5 inches of each book. Since the book's thickness must be odd, this leaves us with 1.5 inches of cover that the worm didn't travel through, for a total book thickness of 5 inches. Edit: This could also be 3.5 inches of cover for a book thickness of 7 inches if you allow 0 page thickness. Since book thickness must be odd, these are the only solutions. However, this solution doesn't change the situation below.

Now B (distance of worm 3) - A (distance of worm 2) == 4, but B^2 - A^2 == 36. This has no integer solution.

Edit: my reasoning for A and B:

A^2 = X^2 + (N * M - 3)^2

B^2 = X^2 + X^2 + (N * M - 3)^2

where M is the thickness of the books. Since the difference between these equations is the second X^2 term, and we know X to be 6 (from the above step), then B^2 - A^2 == 36.

So the solution, at least for the height and width of the books, must not be an integer.