How to determine the likelihood a random number generator is using a uniform distribution? Let's say I have a blackbox function generate_number() that generates a random number between 1-N; and assume N is known. Each function call is independent from each other and carries no state.
I use this to generate X numbers; let's say these numbers are not stored anywhere so i can't build an exact list of them.
I also have another blackbox function num_seen_numbers() that tells me Y which is how many unique numbers of the N numbers have been generated.
For example. Let's say N = 100 (given), and I call generate_number() 40 times (X = 40). Then I call num_unseen_numbers() and it says out of the total N = 100 possible numbers, it has only generated 15 unique ones (Y = 15).
Is there a way to to determine the likelihood that generate_number() has an underlying uniform probability distribution for it's generation?

This is the birthday problem in another form.
With $d$ equally likely days and $n$ independent draws, the expected number of distinct days drawn is $d(1-(1-\frac1d)^n)$ which in your case of $d=100$ and $n=40$ is about $33.1$, rather more than $15$.
The probability of $x$ distinct days drawn is $\dfrac{d! \, S_2(n,x)}{(d-x)!\, d^n}$ where $S_2(n,x)$ is a Stirling number of the second kind.
In your case of $d=100$ and $n=40$ and $x=15$ this probability is about $9.47\times 10^{-17}$ and for $x \le 15$ is about $9.61\times 10^{-17}$, both of which are extremely small.  By contrast, the probability for $29 \le x \le 38$ is about $0.9765$.
You can use this as a possible test that the draws are uniform and independent.
