This is a programming question on my homework for one of my courses. I haven't programmed in a couple years and I wasn't that great to begin with. I'm currently going through tutorials to get back up to speed, but it will take some time. If you guys can help me out with this problem, I would really appreciate it.
Constraints:
Each term of this sequence is a positive integer of the form 2^i*3^j*5^k
, for all non-negative integers i, j, and k
with
i + j + k >= 1.
Can't use arrays. The algorithm to solving this problem must involve the repeated creation and merger of lists. Specifically 5 lists; a final list, temp list, and three term lists
.
"The final list grows by being merged with the current temp list. The temp list, in turn, is replaced by the merger of the three term lists. New term lists are generated by multiplying the new temp list by 2, 3, and 5 respectively
"
The desired sequence would go as follows: 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, . . .