From the infinite triangular array of positive integers, suppose we repeatedly select all numbers at Euclidean distance of \$\sqrt{3}\$, starting from 1:
$$ \underline{1} \\ \;2\; \quad \;3\; \\ \;4\; \quad \;\underline{5}\; \quad \;6\; \\ \;\underline{7}\; \quad \;8\; \quad \;9\; \quad \underline{10} \\ 11 \quad 12 \quad \underline{13} \quad 14 \quad 15 \\ 16 \quad \underline{17} \quad 18 \quad 19 \quad \underline{20} \quad 21 \\ \underline{22} \quad 23 \quad 24 \quad \underline{25} \quad 26 \quad 27 \quad \underline{28} \\ \cdots $$
Alternatively, you may think of it as "leave centers of a honeycomb pattern and cross out boundaries".
The resulting sequence (not yet on OEIS, unlike the polkadot numbers) is as follows:
1, 5, 7, 10, 13, 17, 20, 22, 25, 28, 31, 34, 38, 41, 44, 46, 49, 52, 55, 58, 61, 64,
68, 71, 74, 77, 79, 82, 85, 88, 91, 94, 97, 100, 103, 107, 110, 113, 116, 119,
121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 155, 158, 161, 164, 167, 170,
172, 175, 178, 181, 184, 187, 190, ...
The task is to output this sequence.
sequence I/O rules apply. You can choose to implement one of the following:
- Given the index \$n\$ (0- or 1-based), output the \$n\$th term of the sequence.
- Given a positive integer \$n\$, output the first \$n\$ terms of the sequence.
- Take no input and output the entire sequence by
- printing infinitely or
- returning a lazy list or a generator.
Standard code-golf rules apply. The shortest code in bytes wins.