Try:
vals = Iterators.flatten( ((i-1)*4+1, i*4) for i in 1:N÷4)
This generates an iterator so will work with huge N
values.
If you want the actual values use collect
, here is for N=16
:
julia> collect(vals)
8-element Vector{Int64}:
1
4
5
8
9
12
13
16
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…