A047089 Array T read by antidiagonals: T(h,k)=number of paths consisting of steps from (0,0) to (h,k) such that each step has length 1 directed up or right and touches the line y=x/2 only at lattice points.
1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 4, 3, 1, 1, 4, 7, 4, 4, 1, 1, 5, 11, 11, 8, 5, 1, 1, 6, 16, 22, 19, 13, 6, 1, 1, 7, 22, 38, 41, 19, 19, 7, 1, 1, 8, 29, 60, 79, 60, 38, 26, 8, 1, 1, 9, 37, 89, 139, 139, 98, 64, 34, 9, 1, 1, 10, 46, 126, 228, 278, 237, 98, 98, 43, 10, 1, 1, 11, 56, 172
Offset: 0
Examples
Diagonals (beginning on row 0): {1}; {1,1}; {1,1,1}; {1,2,2,1};...
Crossrefs
See also the related array A107027.
Programs
-
PARI
{T(n, k) = local(v); if( k<0 || k>n, 0, for(i=1, n+1, v=vector(i, j, if( j<2 || j>i-1, 1, v[j-1] + if( i%3 || i!=j+i\3, v[j])))); v[k+1])}; /* Michael Somos, Jan 28 2004 */
-
PARI
{T(n, k) = if( k<0 || k>n, 0, if( n==0 && k==0, 1, T(n-1, k-1) + if( (n+1)%3 || n!=k+(n+1)\3, T(n-1, k))))}; /* Michael Somos, Jan 28 2004 */
Extensions
"Diagonals" in definition changed to "antidiagonals" by Michael Somos, Aug 19 2007
Comments