Big-O notation for the given function whose runtime complexity grows faster than the input
If you express the runtime relative to the input value, it is O(f(n)). But often we describe the runtime relative to the input size; for k bit input it is $O(f(2^k-1))$.

Now  I guess the m-th ugly number is greater than $2^{m^{1/3}}$,  so this grows quite quickly. It would grow so fast that divisibility by 2,3 and 5 only cannot be checked in constant time. 

Since others will be interested in an efficient solution: an ugly number is either 1 or a smaller ugly number multiplied by 2, 3 or 5. Algorithm:

Create a priority queue q. 
Add 1 to the queue q. 
For k = 1 to m
    Extract the smallest number u from the queue q. 
    u is the k-th ugly number. 
    Add 2u, 3u and 5u to the queue q. 


This takes O(m log m) time And O(m) space. Time and space can be greatly reduced by finding a good lower and upper bound for u(m), counting the ugly numbers less than the upper bound in a double loop, and only adding numbers less than the upper bound to the priority queue. 

PS You can’t classify a number as ugly in constant time. 

PPS. Finding the first n ugly numbers can be done in O(n) operations except that the numbers involved might get large by merging arrays 2k, 3k and 5k in some range. Finding the n-th ugly number might be possible faster than O(n), but that’s tricky.