Answer:
P(n) = P(n - 1) + P(n - 2) where P(1) = 1 and P(2) = 2, 1, 2, 3, 5, 8, 13, 21, 34, ...
Step-by-step explanation:
If we suppose that the order of which they are bought matters, then we either buy candy or an ice cream last. In other words, we have (n - 1) or (n - 2) left on previous days to spend.
Therefore,
P(n) = P(n - 1) + P(n - 2)
Where P(1) = 1 and P(2) = 2,
1, 2, 3, 5, 8, 13, 21, 34, ...