Picking any one of the two books there are five shelves to put it on - which makes five ways to place it and for each of those five ways there are four shelves the other book could go such that the two books are not on the same shelf. That's four ways to place a second book for each of the five ways to place the first. That's a total of 20 ways.
After every month's withdrawals, 4/5 of the original amount at the start of the month will remain. The amount at the start of every month will change. Thus: an = 4/5 (an-1) ; where a1 = 500.