Yes both are correct. That happens because .
Lets use it and prove that:
Now put t = n - k, the k varies from 0 to n, t varies from n to 0(thats the same as 0 to n).
But het t is just a variable we introduced to count the powers of a, its a dummy variable. Lets replace it with k.