Do a number on stage means perform a number, where number means:
14. a single or distinct performance within a show, as a song or dance: The comic routine followed the dance number.
The etymology of this usage of number is (Etymonline):
The meaning "musical selection" is from vaudeville theater programs, where acts were marked by a number.
Imagine a program for an evening's entertainment:
I: An Evening in Venice
II: Gondola Suites
Etc, etc, etc
If you were on Gondola Suites, you would refer to Maria as "the next number".
As the question was initially unclear as to which idiom was meant, my original answer had to do with the idiom do a number on. I kept the original, in case it's interesting:
Ngrams shows that the expression to do a number on something (meaning to act with destructive force or impact; to criticize or humiliate - OED) probably began to arise around 1970 (I turned smoothing to zero on purpose):
Here's an example:
Our politicians, as you know, can really do a number on each other.
I checked the context of the pre-1976 occurrences, and the 1900s hump is a fluke. I also don't know about that 1950 bit, but by the contexts cited, I'd say it arose in the late 1960s.
As to the evolution of the phrase, dictionaries and references are chary of suggestions, either not including the phrase, not including any etymology, or saying origin unknown. Yahoo Answers sports some brazen and insupportable speculation, as is its wont; there isn't much to see.
Here's my speculation: do a number means perform a song or dance. The Synonym Finder (1978, Google books) lists do a number on as a synonym for mock:
On would be in the sense of:
12. with respect or regard to (used to indicate the object of an action directed against or toward): Let's play a joke on him. Write a critical essay on Shakespeare.
So doing a number on someone means performing an act based on someone - mocking someone.
From mocking someone the meaning morphed to humiliating someone, and then, more generally, to hurting someone and even destroying something (as in you're really doing a number on that sandwich!).