Sum of powers of zero [duplicate]

I would like to calculate the following sum

Sum[0^(k-a), {k, 0, Nin}]

for a positive integer $$a$$.

With considering $$0^0=1$$, my expected answer of the sum is $$1$$, which is obtained for $$k=a$$, while ignoring the other terms for $$k\neq a$$.

Can this be made in Mathematica somehow?

• Mathematica considers 0^0 to be indeterminate. – bill s Jun 14 at 13:33
• Since you want to arbitrarily equate the sum to 1 just use Sum[0^(k - a), {k, 0, Nin}] /. _ -> 1 – Bob Hanlon Jun 14 at 13:41
• 0^-1 is ComplexInfinity. – user64494 Jun 14 at 14:08
• – user76284 Jun 15 at 2:41

Use KroneckerDelta[n] or DiscreteDelta[n] instead of 0^n.