proposed
approved
proposed
approved
editing
proposed
iterA342991[i_]:=10Flatten[Array[{1, PadRight[{}, 4#], 1, 0, PadRight[{}, 2+4#, 1], 0}&, i, 0]]; (* Each iteration adds six runs of values *)
Flatten[Array[{1, PadRight[{}, 4#], 1, 0, PadRight[{}, 2+4#, 1], 0}&, iter, 0]] (* Paolo Xausa, Nov 20 2022 *)
A342991[10] (* Paolo Xausa, Nov 20 2022 *)
A342991(iter) =10 concat(vector(iter, i, concat([1, vector((i-1)<<2), 1, 0, vector(2+(i-1)<<2, x, 1), 0]))); \\ Each iteration adds six runs of values
concat(vector(iter, i, concat([1, vector((i-1)<<2), 1, 0, vector(2+(i-1)<<2, x, 1), 0]))) \\ Paolo Xausa, Nov 24 2022
A342991(10) \\ Paolo Xausa, Nov 24 2022
iter=10; (* Each iteration adds six runs of values *)
iter=10; (* Each iteration adds six runs of values *)
A342991[iter_]:=Module[{v=0}, Flatten[Array[{1-v, , PadRight[{}, 4#], 1, 0, PadRight[{}, 2+4#, v], v=1-v], 0}&, iter, 0]]]; (* Each iteration adds three runs of values _Paolo Xausa_, Nov 20 2022 *)
A342991[10] (* Paolo Xausa, Nov 20 2022 *)
iter=10; \\ Each iteration adds six runs of values
blockconcat(i)=myvector(v=iter, i%2); , concat([1-v, , vector((i-1)<<2), 1, 0, vector(2+(i-1, )<<2, x, v), 1-v), 0]); )) \\ _Paolo Xausa_, Nov 24 2022
A342991(iter)=concat(vector(iter, i, block(i-1))); \\ Each iteration adds three runs of values
A342991(10) \\ Paolo Xausa, Nov 24 2022
proposed
editing
editing
proposed
proposed
editing
editing
proposed
(PARI) a(n) = my(r, s=sqrtint(n-1, &r)); bitand(s + (r<s-1 || r==s), 1); \\ Kevin Ryde, Nov 24 2022
(PARI)
A342991(iter) = my(a=List(), v=0); for(i=0, iter-1, listput(a, concat([1-v, vector(i<<1, x, v), v=1-v]))); concat(Vec(a)); \\ Each iteration adds three runs of values
A342991(10) \\ Paolo Xausa, Nov 24 2022
(PARI)
A342991(iter) = my(a=List(), v=0); for(i=0, iter-1, listput(a, concat([1-v, vector(i<<1, x, v), v=1-v]))); concat(Vec(a)); \\ Each iteration adds three runs of values
A342991(10) \\ Paolo Xausa, Nov 24 2022
proposed
editing