Seems to me like you would just need to randomly generate your question values then you would have to code your solution so it knows what the answer is.

For your example, get a random number...