I want to make a question having an answer as follows:
5 is the third prime number.
The bold part is the answer. How to phrase the question?
FX's answer is an excellent option (and has my vote).
One other technique that is sometimes used in math or science questions is to give an example response as part of the question:
The number two is the first prime number. In the sequence of prime numbers, what is the position of the number five?
This is particularly effective for a verbal question, where using a variable 'n' may be more confusing than it is in print (depending on the audience). One disadvantage is the relative verbosity of this form, but it is mathematically unambiguous while expressly stating the desired form of the answer.
Why not simply use the term ordinal directly? For example:
What ordinal number reflects the position of the number five in the set of prime numbers?
or more succinctly:
What is the ordinality of five in the set of prime numbers?
Ordinality might be a bit of a neologism, but the meaning should be clear to anyone familiar with the root, I think.
There is no single, definite, one or two-word answer to that. There is some usage, mostly oral, of constructs like “5 is the how manyth prime number?”, but it is definitely not Standard English.
So, the answer to your question will be to reformulate it. For example, if it were a question to a math test, I would say:
For the sentence “5 is the nth prime number” to be correct, what should be the value of n?
5 is the nth prime number. What is the correct value of n?
You could use sequentially, as in
Sequentially, which prime is 5?
However, the term is not completely unambiguous: "Sequentially, which president was Abraham Lincoln?" could legitimately be answered with "Well, he was the one after James Buchanan and before Andrew Johnson"; similarly, as a prime, five is "preceded by 3 and succeeded by 7".
In getting an ordinal response from our kids on quizzes we ask "what is the number-[thing]?", pronounced almost as if it were hyphenated "what number-president is G. W. Bush?". In writing I would be very specific, usually with leading example: "In terms of land area Alaska is first; what is Rhode Island?"
The phrase n...nth is conventionally used for cases like this. In one sentence, the question can concisely be phrased thus:
For what value of n is five the nth prime number?
If you wanted to use words that are not coined by math, you could use a slightly more ambiguous question:
Which term is five on the series of prime numbers?
The answer nobody gave is because they assume the answer must be given as a sentence. You will want to ask a question that fills in the blank.
The question is usually posed in tests as:
Foo is the ____(st/nd/rd/th) bar.
Either you want the ordinal or you want what the ordinal counts. You can't (effectively) ask for both things without some context. There are many answers to 5 is __. There's only one answer for 5 is the _(st/nd/rd/th) prime number