%I #34 Jan 04 2023 10:34:08
%S 1,2,4,5,7,12,14,15,16,17,18,19,21,30,32,33,34,35,36,37,38,39,40,41,
%T 43,56,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,90,92,93,94,95,96,
%U 97,98,99,100,101,102,103,104,105,106,107,108,109,111,132,134
%N Positions of ones in A342991.
%H Paolo Xausa, <a href="/A358511/b358511.txt">Table of n, a(n) for n = 1..10000</a>
%t 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 *)
%t A358511[10]
%o (PARI)
%o 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
%o A358511[10]
%o (Python)
%o def A358511(i): # i-th iteration adds 4*i terms
%o a, pos = [], 0
%o for j in range(0, i):
%o a.extend([pos := pos + 1, pos := pos + (j<<2) + 1])
%o a.extend(range(pos := pos + 2, pos := pos + (j<<2) + 2))
%o return a
%o print(A358511(10))
%Y Cf. A342991, A358510 (complement).
%K nonn,easy
%O 1,2
%A _Paolo Xausa_, Nov 20 2022