Why "ben ik" and not "ik ben"?
English is an SVO language whereas Dutch is a V2 language.
In English the word order of statements (not questions) is Subject Verb Object. "Thanks to him, I[s] am[v] mayor[o]". The dependant clause "Thanks to him" is ignored in this structure.
In Dutch statements, the verb always occupies the second position. "Dankzij hem, ben[2,v] ik[3,s] burgemeester[4,o]". The dependant clause "Dankzij hem" is counted as the first position. If you remove it from this sentence, you have to move "ik" to the first position, thereby keeping the verb in the second position.
Please read CJ Dennis's post, he has explained it very clearly.
Also, for in the future: please do try and read previous comments, it's a very healthy habit that helps avoiding duplicate questions.
What is wrong with this sentence? I've tried writing it with een burgemeester and without een and both showed me the other option x.x am I going paranoid?
Both are accepted, without your full answer it's hard to judge why it was rejected.
What's wrong? I cannot see the difference between my sentence and the right answer!
Unless you post your exanct answer, nobody will be able to help you, since we cannot check where the mistake was.
Because the sentence begins with a subordinate clause.
Whenever a sentence begins with something other than the subject, subject-verb inversion occurs, because Dutch (as German) is a V2 language.
In the future, please do read all the previous comments, as it helps avoiding duplicate entries. Thia had already been brilliantly explained by CJ Dennis right at the beginning.
Hope this helps.