OFFSET
1,2
PROG
(PARI) {a(n, q=3)=local(M=matrix(n+1, n+1)); for(r=1, n+1, for(c=1, r, M[r, c]=if(r==c, 1, if(c>1, (M^q)[r-1, c-1])+(M^q)[r-1, c]))); return(if(n<1, 0, (M^n)[n, 1]))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Oct 14 2005
STATUS
approved