A man visits a pastry shop each morning. During each visit he buys either one of two types of pastry costing one dollar each or one of three types of pastry costing two dollars each. Find and solve a recurrence relation for the number of ways to spend n dollars at the pastry shop (the order of the purchases matters).
I know this problem has to do with recurrence . In this particular problem I'm not sure how to find the recurrence relation of n dollars.