Query regarding max number to be checked in this case

What should be the largest number that should be checked if it divisible by 2,3 or 5. Or to say what should be the value of n=10000th number output for this question ?

@Ekram,
The value would be 288325195312500000

How could we reach this number and using which datatype?

Out of memory error is being shown when executing such a big number

@Ekram,
You can use BigInteger. But the test cases can be solved using double or long

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.