A student returned 4 overdue books to the library. The fine for each overdue book is $0.35 for the first day, $0.40 for each of the next 3 days, and $0.45 for each day after that. The total fine was $13.40. How many days overdue were the books?

Let d be the number of days overdue the books were.

The total fine for the first day is 0.35 * 1 = $<<0.35*1=0.35>>0.35
The total fine for the next 3 days is 0.40 * 3 = $<<0.40*3=1.20>>1.20
The fine for each day after that is 0.45 * (d - 4) = 0.45d - 1.8.
The total fine is 0.35 + 1.20 + 0.45d - 1.8 = $13.40
Combining like terms gives 0.45d - 0.25 = 0.45d = 13.4
Subtracting 0.45d and adding 0.25 we get -0.25 = 13.4
Adding 0.25 to both sides gives 13.4 - 0.25 = 13.15
Thus the books were 13 days overdue. Answer: \boxed{13}.