Let be a real or complex number satisfying , where is a natural number. Show that has the value if is divisible by and has the value 0 otherwise.

Slightly annoying that I cannot prove this. The case is divisible by is obvious. I can only prove the sum is equal to 0 when ...