login
A358511
Positions of ones in A342991.
3
1, 2, 4, 5, 7, 12, 14, 15, 16, 17, 18, 19, 21, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 90, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 132, 134
OFFSET
1,2
MATHEMATICA
A358511[i_]:=Module[{pos=-1}, Flatten[Array[{pos+=2, pos+=4#+1, Range[pos+=2, pos+=4#+1]}&, i, 0]]]; (* i-th iteration adds 4*i terms *)
PROG
(PARI)
A358511(i)=my(a=List(), pos=-1, r); for(j=0, i-1, r=j<<2; listput(a, [pos+=2, pos+=r+1]); pos++; listput(a, vector(r+2, x, x+pos)); pos+=r+2); concat(Vec(a)); \\ i-th iteration adds 4*i terms
(Python)
def A358511(i): # i-th iteration adds 4*i terms
a, pos = [], 0
for j in range(0, i):
a.extend([pos := pos + 1, pos := pos + (j<<2) + 1])
a.extend(range(pos := pos + 2, pos := pos + (j<<2) + 2))
return a
print(A358511(10))
CROSSREFS
Cf. A342991, A358510 (complement).
Sequence in context: A039674 A090649 A154686 * A165196 A007062 A121817
KEYWORD
nonn,easy
AUTHOR
Paolo Xausa, Nov 20 2022
STATUS
approved