k-th number with only small factors
A "smooth" number here is a positive whole number whose only prime factors are 2, 3 or 5:
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, .... Write kth_smooth(k) that returns the k-th one.
kth_smooth(1) -> 1
kth_smooth(7) -> 8
kth_smooth(10) -> 12
The point is to practise generating values in order with a heap and a set to avoid repeats: each popped number spawns three candidates.
def kth_smooth(k):
...