Definition :
The number whose only prime factor is 2,3 and 5 is known as a ugly
number.
1 is the smallest ugly number because -
1 = 2 the power 0 or 2
0
1 = 3 the power 0 or 3
0
1 = 5 the power 0 or 5
0
1 is the smallest ugly number and it's base case.