The Golomb sequence is uniquely defined by the following rules:
Write a function that returns the first n terms of the Golomb sequence as a list.
golomb(1) ➞ [1]
golomb(8) ➞ [1, 2, 2, 3, 3, 4, 4, 4]
golomb(10) ➞ [1, 2, 2, 3, 3, 4, 4, 4, 5, 5]
1 appears once; 2 appears twice; 3 appears twice; 4 appears 3 times; 5 will appear 3 times in the full sequence, etc.