OFFSET
0
COMMENTS
For n >= 2, the n-th row contains 2^(n - 1) terms and their sum equals to 2^(n - 2).
EXAMPLE
Table begins:
0,
0,
0, 1,
0, 1, 0, 1,
0, 1, 0, 0, 0, 1, 1, 1,
...
For n = 4:
- the terms in rows 0..3 are: 0, 0, 0, 1, 0, 1, 0, 1,
- we have 0's at positions 0 mod 2 = 0, 1 mod 2 = 1, 2 mod 2 = 0, 4 mod 2 = 0, 6 mod 2 = 0,
- we have 1's at positions 3 mod 2 = 1, 5 mod 2 = 1, 7 mod 2 = 1,
- so row 4 is: 0, 1, 0, 0, 0, 1, 1, 1.
MATHEMATICA
row[0] = {0}; row[n_] := row[n] = Module[{t = Flatten@ Table[row[i], {i, 0, n-1}], p}, Join@@ (Mod[-1 + If[(p = Position[t, #]) == {}, {}, Flatten[p]], 2]& /@ {0, 1})]; Table[row[i], {i, 0, 7}] // Flatten (* Amiram Eldar, Mar 15 2023 *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Ctibor O. Zizka, Mar 14 2023
STATUS
approved