A127452 Triangle, read by rows of n*(n+1)/2 + 1 terms, generated by the recurrence: start with a single '1' in row 0; row n+1 is generated from row n by first inserting zeros at positions {(m+1)*(m+2)/2 - 1, m>=0} in row n and then taking the partial sums in reverse order.
1, 1, 1, 2, 2, 1, 1, 6, 6, 4, 4, 2, 1, 1, 24, 24, 18, 18, 12, 8, 8, 4, 2, 1, 1, 120, 120, 96, 96, 72, 54, 54, 36, 24, 16, 16, 8, 4, 2, 1, 1, 720, 720, 600, 600, 480, 384, 384, 288, 216, 162, 162, 108, 72, 48, 32, 32, 16, 8, 4, 2, 1, 1
Offset: 0
Examples
The triangle begins: 1; 1, 1; 2, 2, 1, 1; 6, 6, 4, 4, 2, 1, 1; 24, 24, 18, 18, 12, 8, 8, 4, 2, 1, 1; 120, 120, 96, 96, 72, 54, 54, 36, 24, 16, 16, 8, 4, 2, 1, 1; 720, 720, 600, 600, 480, 384, 384, 288, 216, 162, 162, 108, 72, 48, 32, 32, 16, 8, 4, 2, 1, 1; ... The recurrence is illustrated by the following examples. Start with a single '1' in row 0. To get row 1, insert 0 in row 0 at position 0, and take partial sums in reverse order: 0,_1; 1,_1; To get row 2, insert 0 in row 1 at positions [0,2], and take partial sums in reverse order: 0,_1,_0,_1; 2,_2,_1,_1; To get row 3, insert 0 in row 2 at positions [0,2,5], and take partial sums in reverse order: 0,_2,_0,_2,_1,_0,_1; 6,_6,_4,_4,_2,_1,_1; To get row 4, insert 0 in row 3 at positions [0,2,5,9], and take partial sums in reverse order: _0,__6,__0,__6,__4,_0,_4,_2,_1,_0,_1; 24,_24,_18,_18,_12,_8,_8,_4,_2,_1,_1; etc. Continuing in this way generates the factorials in the first column.
Links
- Paul D. Hanna, Rows n = 0..30, flattened.
Programs
-
PARI
T(n,k)=if(n<0 || k<0,0,if(n==0 && k==0,1, if(k==0, n!, if(issquare(8*k+1),T(n,k-1),T(n,k-1)-T(n-1,k-(sqrtint(8*k+1)+1)\2)))))
-
PARI
T(n,k)=local(t=(sqrtint(8*k+1)-1)\2);(n-t)!*(n-t)^(k-t*(t+1)/2)*(n-t+1)^(t-k+t*(t+1)/2)
Comments