Editing an answer several times doesn't inhibit reputation from that answer. The problem is that the answer you posted on Mathematics SE was made a Community Wiki by you when you posted it for the first time. It may have been a mistake from your side as you do not seem to be aware of this feature. However, an essential characteristic of Community Wiki posts is that they belong to the community as a whole, that is, they can be edited freely by most people to improve them. Thus, the reputation earned from Community Wiki posts goes to no one (except in the case of bounties, in which case, a bounty is awarded to the original poster).
Note: Only a moderator can remove Community Wiki status from a post. Since you had mistakenly made your answer a Community Wiki, you may flag it as "in need of moderator intervention" explaining your case. A moderator may revoke the Community Wiki status causing an automatic recalculation of your reputation as if the post was never a wiki. However, it is entirely a decision of the moderators.