Sorry I have missed out something really important about the question.

All the numbers in one bucket are larger than that of the previous bucket.

So ALL numbers of bucket 3 will be bigger than ANY number of the bucket 2 and so on.

The number given to the function may or may not be in the array.

If the number is in a the array, of course the it's in a bucket, right? Perhaps the question is in what bucket? 1st, 2nd,...?