login
Irregular table read by rows; the first row is [1]; to obtain the next row, replace each odd-indexed term u with (u, u), and each even-indexed term v with (2*v).
1

%I #13 Mar 30 2024 23:08:07

%S 1,1,1,1,1,2,1,1,2,2,2,1,1,2,2,2,4,2,2,1,1,2,2,2,4,2,2,8,2,2,4,1,1,2,

%T 2,2,4,2,2,8,2,2,4,8,8,4,2,2,8,1,1,2,2,2,4,2,2,8,2,2,4,8,8,4,2,2,8,8,

%U 8,16,4,4,4,2,2,16,1,1,2,2,2,4,2,2,8,2,2,4,8,8,4,2,2,8,8,8,16,4,4,4,2,2,16,8,8,16,16,16,8,4,4,8,2,2,4,16,16

%N Irregular table read by rows; the first row is [1]; to obtain the next row, replace each odd-indexed term u with (u, u), and each even-indexed term v with (2*v).

%C Sequence A061419 and A343857 gives row lengths and partial sums, respectively.

%C The n-th row sums to 2^(n-1).

%C This sequence has fractal features.

%C As with Jim Conant's iterative dissection of a square (A328078), at each iteration, we split in two odd-indexed elements.

%C This sequence has similarities with A205592: in A205592:

%C - we start with A205592(1) = 1,

%C - for k = 1, 2, ...:

%C if k is odd: append two copies of A205592(k),

%C if k is even: append 2*A205592(k).

%e Table begins:

%e 1: [1]

%e 2: [1, 1]

%e 3: [1, 1, 2]

%e 4: [1, 1, 2, 2, 2]

%e 5: [1, 1, 2, 2, 2, 4, 2, 2]

%e 6: [1, 1, 2, 2, 2, 4, 2, 2, 8, 2, 2, 4]

%e 7: [1, 1, 2, 2, 2, 4, 2, 2, 8, 2, 2, 4, 8, 8, 4, 2, 2, 8]

%o (PARI) { a = r = [1]; for (n=1, 8, i = 0; a=concat(a, r = concat(apply (v -> if (i++%2, [v,v], [2*v]), r)))); print (a) }

%o (Python)

%o def auptorow(rows):

%o alst, row, newrow = [1], [1], []

%o for r in range(2, rows+1):

%o for i, v in enumerate(row, start=1): newrow += [v, v] if i%2 else [2*v]

%o alst, row, newrow = alst + newrow, newrow, []

%o return alst

%o print(auptorow(9)) # _Michael S. Branicky_, May 04 2021

%Y Cf. A061419, A205592, A328078, A343857.

%K nonn,tabf

%O 1,6

%A _Rémy Sigrist_, May 01 2021