Let the middle book cost x dollars. The book to the left costs x-2 and the one to the right costs x+2. The last book, 15 to right of the middle, costs x + 30 dollars. Let's consider two cases:
Case 1: The last book costs the same as the middle book and one to its right. Then
x + (x+2) = x + 30
x = 28
However, this means the leftmost book costs x-30 = -2 dollars, which is unlikely.
Case 2: The last book costs the same as the middle book and one to its left. Then
x + (x-2) = x + 30
x = 32
In this case, the costs of the books are
$2, $4, $62.
The nth book costs 2n dollars.