O(N) solution to this problem

every number in this sequence is 2, 3, or 5 times another number in this sequence