UVa 136 - Ugly Numbers

dynamic programming, compute the sequence recursively. One catch in programming is potential overflow, you may need type long long to get 64bit integer