You need two base cases:
for any .
(optional, but avoids one extra call). The second base case is not strictly necessary since . But adding it makes the code slightly faster. Either way works. Base cases are where the recursion stops. They handle the simplest possible inputs directly, without making recursive calls. Every recursive function needs at least one base case, or it will recurse forever and crash.