Uva 136

From Algorithmist
Jump to navigation Jump to search

UVa 136 - Ugly Numbers[edit]

Summary[edit]

UVa 136: Ugly Number, a trivial, but interesting UVa problem. The crux involves computing 1500th Ugly number, where a Ugly number is defined as a number whose prime factors are only 2, 3 or 5. Following illustrates a sequence of Ugly numbers: 1,2,3,4,5,6,8,9,10,12,15...

Explanation[edit]

Check numbers to see whether their prime factors are only 2, 3 or 5.

Input[edit]

No input.

Output[edit]

1500th Ugly Number

Solution[edit]