login
Triangle read by rows: first column: top entry is 1, then powers of 2; rest of triangle is Pascal's triangle A007318.
3

%I #10 Sep 08 2022 08:45:58

%S 1,1,1,2,1,1,4,1,2,1,8,1,3,3,1,16,1,4,6,4,1,32,1,5,10,10,5,1,64,1,6,

%T 15,20,15,6,1,128,1,7,21,35,35,21,7,1,256,1,8,28,56,70,56,28,8,1,512,

%U 1,9,36,84,126,126,84,36,9,1,1024,1,10,45,120,210,252,210,120,45,10,1,2048,1,11,55,165,330,462,462,330,165,55,11,1

%N Triangle read by rows: first column: top entry is 1, then powers of 2; rest of triangle is Pascal's triangle A007318.

%C The original definition of A135233 made no sense. In fact A135233 is the binomial transform of the present sequence.

%H G. C. Greubel, <a href="/A193554/b193554.txt">Rows n = 0..100 of triangle, flattened</a>

%e Triangle begins:

%e 1;

%e 1, 1;

%e 2, 1, 1;

%e 4, 1, 2, 1;

%e 8, 1, 3, 3, 1;

%e 16, 1, 4, 6, 4, 1;

%e 32, 1, 5, 10, 10, 5, 1;

%e 64, 1, 6, 15, 20, 15, 6, 1;

%e ...

%p T:= proc(n, k) option remember;

%p if k=n then 1

%p elif k=0 then 2^(n-1)

%p else binomial(n-1,k-1)

%p fi; end:

%p seq(seq(T(n, k), k=0..n), n=0..12); # _G. C. Greubel_, Nov 20 2019

%t T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 2^(n-1), Binomial[n-1, k-1]]];

%t Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* _G. C. Greubel_, Nov 20 2019 *)

%o (PARI) T(n,k) = if(k==n, 1, if(k==0, 2^(n-1), binomial(n-1, k-1) )); \\ _G. C. Greubel_, Nov 20 2019

%o (Magma)

%o function T(n,k)

%o if k eq n then return 1;

%o elif k eq 0 then return 2^(n-1);

%o else return Binomial(n-1, k-1);

%o end if; return T; end function;

%o [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Nov 20 2019

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k==n): return 1

%o elif (k==0): return 2^(n-1)

%o else: return binomial(n-1, k-1)

%o [[T(n, k) for k in (0..n)] for n in (0..12)] # _G. C. Greubel_, Nov 20 2019

%Y Cf. A000079 (row sums)

%Y Cf. A007318, A135233.

%K nonn,tabl

%O 0,4

%A _N. J. A. Sloane_, Jul 30 2011