An author is writing a series of novels. The first book took k days, and the writing got slower with every book after that. To be precise, if the i-th book took ℓ days, the (i+1)-th book takes 2ℓ days.
The author dies d days after starting the first book. A book counts as finished if the day it is completed is not later than day d. What is the largest number of books the author can finish?