A327549
Number T(n,k) of compositions of partitions of n with exactly k compositions; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 4, 2, 1, 0, 8, 8, 2, 1, 0, 16, 16, 8, 2, 1, 0, 32, 48, 24, 8, 2, 1, 0, 64, 96, 64, 24, 8, 2, 1, 0, 128, 256, 160, 80, 24, 8, 2, 1, 0, 256, 512, 448, 192, 80, 24, 8, 2, 1, 0, 512, 1280, 1024, 576, 224, 80, 24, 8, 2, 1
Offset: 0
T(3,1) = 4: 3, 21, 12, 111.
T(3,2) = 2: 2|1, 11|1.
T(3,3) = 1: 1|1|1.
Triangle T(n,k) begins:
1;
0, 1;
0, 2, 1;
0, 4, 2, 1;
0, 8, 8, 2, 1;
0, 16, 16, 8, 2, 1;
0, 32, 48, 24, 8, 2, 1;
0, 64, 96, 64, 24, 8, 2, 1;
0, 128, 256, 160, 80, 24, 8, 2, 1;
0, 256, 512, 448, 192, 80, 24, 8, 2, 1;
0, 512, 1280, 1024, 576, 224, 80, 24, 8, 2, 1;
...
-
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1)+expand(2^(i-1)*x*b(n-i, min(n-i, i)))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2)):
seq(T(n), n=0..12);
-
b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + 2^(i-1) x b[n-i, Min[n-i, i]]]];
T[n_] := CoefficientList[b[n, n], x];
T /@ Range[0, 12] // Flatten (* Jean-François Alcover, Dec 17 2020, after Alois P. Heinz *)
A274497
Sum of the degrees of asymmetry of all binary words of length n.
Original entry on oeis.org
0, 0, 2, 4, 16, 32, 96, 192, 512, 1024, 2560, 5120, 12288, 24576, 57344, 114688, 262144, 524288, 1179648, 2359296, 5242880, 10485760, 23068672, 46137344, 100663296, 201326592, 436207616, 872415232, 1879048192, 3758096384, 8053063680
Offset: 0
a(3) = 4 because the binary words 000, 001, 010, 100, 011, 101, 110, 111 have degrees of asymmetry 0, 1, 0, 1, 1, 0, 1, 0, respectively.
-
a:= proc(n) options operator, arrow: (1/8)*(2*n-1+(-1)^n)*2^n end proc: seq(a(n), n = 0 .. 30);
-
LinearRecurrence[{2, 4, -8}, {0, 0, 2}, 31] (* Jean-François Alcover, Nov 16 2022 *)
-
a(n)=(2*n-1+(-1)^n)*2^n/8 \\ Charles R Greathouse IV, Jul 08 2024
Original entry on oeis.org
1, 0, 2, 4, 0, 4, 0, 8, 0, 8, 16, 0, 16, 0, 16, 0, 32, 0, 32, 0, 32, 64, 0, 64, 0, 64, 0, 64, 0, 128, 0, 128, 0, 128, 0, 128, 256, 0, 256, 0, 256, 0, 256, 0, 256, 0, 512, 0, 512, 0, 512, 0, 512, 0, 512
Offset: 0
First few rows of the triangle:
1;
0, 2;
4, 0, 4;
0, 8, 0, 8;
16, 0, 16, 0, 16;
0, 32, 0, 32, 0, 32;
...
A140787
Expansion of 1 / ( (1+x)*(2*x+1)*(-1+2*x)^2 ).
Original entry on oeis.org
1, 1, 7, 9, 39, 57, 199, 313, 967, 1593, 4551, 7737, 20935, 36409, 94663, 167481, 422343, 757305, 1864135, 3378745, 8155591, 14913081, 35418567, 65244729, 152859079, 283348537, 656175559, 1222872633, 2803659207, 5249404473
Offset: 0
-
[2^n*(n/3+11/18) + (-1)^n* (2^(n-1)-1/9): n in [0..40]]; // Vincenzo Librandi, Aug 08 2011
-
max = 40; j[n_] := (2^n-(-1)^n)/3; jj = Table[{j[n], -j[n]}, {n, 0, max+2, 2}] // Flatten; a[0] = 1; a[n_] := a[n] = 2*a[n-1] + jj[[n+3]]; Table[a[n], {n, 0, max}] (* Jean-François Alcover, Sep 30 2013 *)
A368043
Triangle read by rows: T(n, k) = 2^(n + k).
Original entry on oeis.org
1, 2, 4, 4, 8, 16, 8, 16, 32, 64, 16, 32, 64, 128, 256, 32, 64, 128, 256, 512, 1024, 64, 128, 256, 512, 1024, 2048, 4096, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144
Offset: 0
[0] [ 1]
[1] [ 2, 4]
[2] [ 4, 8, 16]
[3] [ 8, 16, 32, 64]
[4] [ 16, 32, 64, 128, 256]
[5] [ 32, 64, 128, 256, 512, 1024]
[6] [ 64, 128, 256, 512, 1024, 2048, 4096]
[7] [128, 256, 512, 1024, 2048, 4096, 8192, 16384]
[8] [256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536]
Cf.
A000079 (T(n,0)),
A004171 (T(n,n-1)),
A000302 (T(n,n)),
A171476 (row sums),
A003683 (alternating row sums),
A134353 (antidiagonal sums),
A001018 (T(2n, n)),
A094014 (T(n, n/2)),
A002697.
-
Array[2^Range[#,2#]&,10,0] (* Paolo Xausa, Dec 09 2023 *)
-
from functools import cache
@cache
def T_row(n: int) -> list[int]:
if n == 0: return [1]
row = T_row(n - 1) + [0]
for k in range(n): row[k] *= 2
row[n] = row[n - 1] * 2
return row
for n in range(11): print(T_row(n))
Showing 1-5 of 5 results.
Comments