UVa 443 - Humble Numbers

443 - Humble Numbers

 * http://acm.uva.es/problemset/v4/443.html

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

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

Gotchas

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

Implementations
C++: http://pastie.org/1236324

Optimizations
No optimizations required.

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

Output
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.