Answer:
Let total non-fiction books = 3x
And total fiction books = 5x
After reading 6 non-fiction books, remaining non-fiction books = 3x-6
After reading 13 fiction books, total fiction books remaining fiction books = 5x-13
(3x-6)/(5x-13) = 3/4
Solving for x, we get x = 5
So total non-fiction books = 15 and fiction books=25
So total number of books bought = 40