UVa 443

From Algorithmist
Jump to navigation Jump to search

443 - Humble Numbers[edit]

Summary[edit]

The solution answers the question: "How to generate 7-smooth numbers?".

Explanation[edit]

Humble Numbers are 7-smooth numbers. See UVa 136 problem for the explanation of the similar 5-smooth numbers generation.

Gotchas[edit]

  • You must be careful for the endings "st", "nd", "rd", "th".

Implementations[edit]

Optimizations[edit]

No optimizations required.

Input[edit]

1
2
3
4
11
12
13
21
22
23
100
1000
5842
0

Output[edit]

The 1st humble number is 1.
The 2nd humble number is 2.
The 3rd humble number is 3.
The 4th humble number is 4.
The 11th humble number is 12.
The 12th humble number is 14.
The 13th humble number is 15.
The 21st humble number is 28.
The 22nd humble number is 30.
The 23rd humble number is 32.
The 100th humble number is 450.
The 1000th humble number is 385875.
The 5842nd humble number is 2000000000.