As seen in this challenge and this one in the sandbox, some questions ask for pseudorandom numbers to be applied in a mathematical operation. Frequently, these questions are trivial mathematical operations for which the only difference is the operations use a pseudorandom number. Should generation of pseudorandom numbers be allowed as a requirement for a challenge?
Varies by the question.
Some questions use psuedorandom numbers, and theres a random tag for that.
Since there is no rules which restricts them, it will be allowed.
However, Trivial ones, like what you posted, are discouraged, and will most likely be disliked or flagged. (by any reason, most likely duplicates or not clear)
If they don't violate other rules, questions containing psuedorandom numbers are fine.