"1 to n. I want to choose m integers withiut replacement p times out of these integers, "
What does the above mean, precisely? IFF n > m*p, then
is without replacement for the full process; if it is p samples of m from the initial N, that's without replacement for each sample but with replacement across samples.
It's ambiguous which is meant for sure. To do the latter is a loop in one fashion or another; randperm isn't vectorized internally and the randi and other PRGs are pseudo-random, they don't do without replacement.