------
## 最终结论
```python
def nth_ugly_number(n):
    ugly_numbers = [0] * n
    ugly_numbers[0] = 1  # The first ugly number is 1

    i2 = i3 = i5 = 0  # Initialize pointers for 2, 3, and 5

    for i in range(1, n):
        next_ugly = min(ugly_numbers[i2] * 2, ugly_numbers[i3] * 3, ugly_numbers[i5] * 5)
        ugly_numbers[i] = next_ugly

        if next_ugly == ugly_numbers[i2] * 2:
            i2 += 1
        if next_ugly == ugly_numbers[i3] * 3:
            i3 += 1
        if next_ugly == ugly_numbers[i5] * 5:
            i5 += 1

    return ugly_numbers[-1]

# Example usage
n = 10
print(nth_ugly_number(n))
```