Favourite Numbers
View as PDFOut of all the numbers that exist, only likes some specific numbers. The only numbers that he like are numbers, if prime factorized, only contain the numbers 2 or 3. However, since really likes to be number 1 (even though that never happens), the smallest number that he likes is the number 1.
Out of all these numbers, would like for you to write a solution that finds the smallest number that he likes.
Note that your answer may exceed a 32-bit integer.
Input Specification
One Integer
, the
number that he is looking for.
Output Specification
One Value, the smallest number in the list of numbers that likes.
Sample Input 1
5
Sample Output 1
6
Explanation for Sample Output 1
The first 5 numbers that likes are . Thus, the 5th one is
, the one he is looking for.
Sample Input 2
8
Sample Output 2
12
Explanation for Sample Output 2
The next 3 numbers are , so
is the answer.
Sample Input 3
50
Sample Output 3
2304
Comments