It is not entirely clear what the problem is, so I will make an interpretation that I hope is the one you intend. Out of habit, I will use $n$ instead of $X$.
We have a pool of $n$ distinct natural numbers, or indeed any $n$ distinct objects. We suppose that $A$ is one of these objects.
We pick from this pool $30$ times, each time replacing the object that we picked, so that the composition of the pool does not change. The probability that in $30$ trials, we never pick $A$, is $0.003$. We want to know the number $n$ of objects in the pool.
The probability that, on any individual pick, we get the object $A$, is $\dfrac{1}{n}$. So the probability that we don't get $A$ is $1-\dfrac{1}{n}$. The probability that this happens $30$ times in a row is $\left(1-\frac{1}{n}\right)^{30}.\qquad\qquad (\ast)$ So we want to solve the equation $\left(1-\frac{1}{n}\right)^{30}=0.003.$ This equation can be solved in various ways, including "trial and error." In our particular situation, trial and error is a very good way. If we play with the calculator a bit, using the formula $(\ast)$, we find that if $n=5$, the probability of never getting $A$ is about $0.0012379$, while if $n=6$, the probability is about $0.0042127$. There is no integer $n$ such that the probability is exactly $0.003$. We get closest with $n=6$.
We now describe a more systematic way of solving our equation. Take the logarithm of both sides. I will use logarithm to the base $10$, though I would prefer the natural logarithm (base $e$). We obtain $30\log\left(1-\frac{1}{n}\right)=\log(0.003).$ Calculate. We get $\log\left(1-\frac{1}{n}\right)\approx -0.084096.$ Recall that if $y=\log x$ then $x=10^y$. We conclude that $\left(1-\frac{1}{n}\right)\approx 0.823956,$ which gives $n=5.6803994$. Of course, that is not right, $n$ must be an integer. If we let $n=5$, the probability we never get $A$ is quite a bit less than $0.003$, while if $n=6$, the probability we never get $A$ is greater than $0.003$.
Remark: You might be interested in numbers other than your special $30$ and $0.003$. More generally, suppose that we pick $k$ times, and we want the probability of never getting $A$ to be $p$. Then we need to solve the equation $\left(1-\frac{1}{n}\right)^{k}=p.$ Like in our concrete case, we can find the appropriate value of $n$ by using logarithms. In general, like in our concrete case, there will not be an integer $n$ that gives probability exactly $p$. Again, we use logarithms to the base $10$, though any base will do. We get $k\log\left(1-\frac{1}{n}\right)=\log p,$ and therefore $\log\left(1-\frac{1}{n}\right)=\frac{\log p}{k},$ and therefore $1-\frac{1}{n}=10^{\frac{\log p}{k}}.$ Solving for $n$, we obtain $n=\frac{1}{1-10^{\frac{\log p}{k}}}.$
Suppose that instead of your $0.003$, we let $p=0.95$. Let $k=30$. Using the above formula, we get $n\approx 585.4$. This could have taken some time to reach by trial and error.