3 is the greatest number of book shelves Andy can use. I solved this by finding the greatest comment factor of 9 and 6, which turned out to be 3.
6/3=2(reading books per shelf)
9/3=3(math books per shelf)
Every shelf there are two reading books and 3 math books