etymology of "do a number on"
Here is a web 1.5-ass blog on the subject, obviously the best kind of citation material. http://www.word-detective.com/2010/07/number-to-do-a/
It comes to the conclusion that it first appeared as African-American slang in the 1960s, though some of the comments (which were posted about a decade after the original post) also brought up the boxing sense of "number" as a possible contributor (which is what the Wiktionary article formerly stated, however unconvincingly).
There seem to be some other nuggets in the general search results, but others are just the definition with no history... And then there's the Quora page, which features a response quoting the uncited Wiktionary serction (while "citing" Wiktionary), and another copy-pasting an excerpt of the above blog post (with no citation or further comment). Classic.
the mastodon instance at cybre.space is retiring
see the end-of-life plan for details: https://cybre.space/~chr/cybre-space-eol