The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228196 A triangle formed like Pascal's triangle, but with n^2 on the left border and 2^n on the right border instead of 1. 32

%I #73 Aug 07 2022 16:00:36

%S 0,1,2,4,3,4,9,7,7,8,16,16,14,15,16,25,32,30,29,31,32,36,57,62,59,60,

%T 63,64,49,93,119,121,119,123,127,128,64,142,212,240,240,242,250,255,

%U 256,81,206,354,452,480,482,492,505,511,512,100,287,560,806,932,962,974,997,1016,1023,1024

%N A triangle formed like Pascal's triangle, but with n^2 on the left border and 2^n on the right border instead of 1.

%C The third row is (n^4 - n^2 + 24*n + 24)/12.

%C For a closed-form formula for generalized Pascal's triangle see A228576. - _Boris Putievskiy_, Sep 04 2013

%H Boris Putievskiy, <a href="/A228196/b228196.txt">Rows n = 1..140 of triangle, flattened</a>

%H Rely Pellicer and David Alvo, <a href="http://www.academia.edu/956605/Modi_ed_Pascal_Triangle_and_Pascal_Surfaces">Modified Pascal Triangle and Pascal Surfaces</a> p.4

%H <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>

%F T(n,0) = n^2, n>0; T(0,k) = 2^k; T(n, k) = T(n-1, k-1) + T(n-1, k) for n,k >0. [corrected by G. C. Greubel, Nov 12 2019]

%F Closed-form formula for general case. Let L(m) and R(m) be the left border and the right border of Pascal like triangle, respectively. We denote binomial(n,k) by C(n,k).

%F As table read by antidiagonals T(n,k) = Sum_{m1=1..n} R(m1)*C(n+k-m1-1, n-m1) + Sum_{m2=1..k} L(m2)*C(n+k-m2-1, k-m2); n,k >=0.

%F As linear sequence a(n) = Sum_{m1=1..i} R(m1)*C(i+j-m1-1, i-m1) + Sum_{m2=1..j} L(m2)*C(i+j-m2-1, j-m2), where i=n-t*(t+1)/2-1, j=(t*t+3*t+4)/2-n-1, t=floor((-1+sqrt(8*n-7))/2); n>0.

%F Some special cases. If L(m)={b,b,b...} b*A000012, then the second sum takes form b*C(n+k-1,j). If L(m) is {0,b,2b,...} b*A001477, then the second sum takes form b*C(n+k,n-1). Similarly for R(m) and the first sum.

%F For this sequence L(m)=m^2 and R(m)=2^m.

%F As table read by antidiagonals T(n,k) = Sum_{m1=1..n} (2^m1)*C(n+k-m1-1, n-m1) + Sum_{m2=1..k} (m2^2)*C(n+k-m2-1, k-m2); n,k >=0.

%F As linear sequence a(n) = Sum_{m1=1..i} (2^m1)*C(i+j-m1-1, i-m1) + Sum_{m2=1..j} (m2^2)*C(i+j-m2-1, j-m2), where i=n-t*(t+1)/2-1, j=(t*t+3*t+4)/2-n-1, t=floor((-1+sqrt(8*n-7))/2).

%F As a triangular array read by rows, T(n,k) = Sum_{i=1..n-k} i^2*C(n-1-i, n-k-i) + Sum_{i=1..k} 2^i*C(n-1-i, k-i); n,k >=0. - _Greg Dresden_, Aug 06 2022

%e The start of the sequence as a triangular array read by rows:

%e 0;

%e 1, 2;

%e 4, 3, 4;

%e 9, 7, 7, 8;

%e 16, 16, 14, 15, 16;

%e 25, 32, 30, 29, 31, 32;

%e 36, 57, 62, 59, 60, 63, 64;

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

%p if k=0 then n^2

%p elif k=n then 2^k

%p else T(n-1, k-1) + T(n-1, k)

%p fi

%p end:

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

%t T[n_, k_]:= T[n, k] = If[k==0, n^2, If[k==n, 2^k, T[n-1, k-1] + T[n-1, k]]]; Table[T[n, k], {n,0,10}, {k,0,n}]//Flatten (* _G. C. Greubel_, Nov 12 2019 *)

%t Flatten[Table[Sum[i^2 Binomial[n-1-i, n-k-i], {i,1,n-k}] + Sum[2^i Binomial[n-1-i, k-i], {i,1,k}], {n,0,10}, {k,0,n}]] (* _Greg Dresden_, Aug 06 2022 *)

%o (Python)

%o def funcL(n):

%o q = n**2

%o return q

%o def funcR(n):

%o q = 2**n

%o return q

%o for n in range (1,9871):

%o t=int((math.sqrt(8*n-7) - 1)/ 2)

%o i=n-t*(t+1)/2-1

%o j=(t*t+3*t+4)/2-n-1

%o sum1=0

%o sum2=0

%o for m1 in range (1,i+1):

%o sum1=sum1+funcR(m1)*binomial(i+j-m1-1,i-m1)

%o for m2 in range (1,j+1):

%o sum2=sum2+funcL(m2)*binomial(i+j-m2-1,j-m2)

%o sum=sum1+sum2

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

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k==0): return n^2

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

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

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

%o (GAP)

%o T:= function(n,k)

%o if k=0 then return n^2;

%o elif k=n then return 2^n;

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

%o fi;

%o end;

%o Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # _G. C. Greubel_, Nov 12 2019

%Y Cf. We denote Pascal-like triangle with L(n) on the left border and R(n) on the right border by (L(n),R(n)). A007318 (1,1), A008949 (1,2^n), A029600 (2,3), A029618 (3,2), A029635 (1,2), A029653 (2,1), A037027 (Fibonacci(n),1), A051601 (n,n) n>=0, A051597 (n,n) n>0, A051666 (n^2,n^2), A071919 (1,0), A074829 (Fibonacci(n), Fibonacci(n)), A074909 (1,n), A093560 (3,1), A093561 (4,1), A093562 (5,1), A093563 (6,1), A093564 (7,1), A093565 (8,1), A093644 (9,1), A093645 (10,1), A095660 (1,3), A095666 (1,4), A096940 (1,5), A096956 (1,6), A106516 (3^n,1), A108561(1,(-1)^n), A132200 (4,4), A134636 (2n+1,2n+1), A137688 (2^n,2^n), A160760 (3^(n-1),1), A164844(1,10^n), A164847 (100^n,1), A164855 (101*100^n,1), A164866 (101^n,1), A172171 (1,9), A172185 (9,11), A172283 (-9,11), A177954 (int(n/2),1), A193820 (1,2^n), A214292 (n,-n), A227074 (4^n,4^n), A227075 (3^n,3^n), A227076 (5^n,5^n), A227550 (n!,n!), A228053 ((-1)^n,(-1)^n), A228074 (Fibonacci(n), n).

%Y Cf. A000290 (row 1), A153056 (row 2), A000079 (column 1), A000225 (column 2), A132753 (column 3), A118885 (row sums of triangle array + 1), A228576 (generalized Pascal's triangle).

%K nonn,tabl

%O 1,3

%A _Boris Putievskiy_, Aug 15 2013

%E Cross-references corrected and extended by _Philippe Deléham_, Dec 27 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 19:00 EDT 2024. Contains 372720 sequences. (Running on oeis4.)