Source: https://courses.engr.illinois.edu/cs573/fa2010/notes/99-recurrences.pdf