This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A025177 #43 May 27 2025 12:21:17 %S A025177 1,1,0,1,1,1,2,1,1,1,2,4,4,4,2,1,1,3,7,10,12,10,7,3,1,1,4,11,20,29,32, %T A025177 29,20,11,4,1,1,5,16,35,60,81,90,81,60,35,16,5,1,1,6,22,56,111,176, %U A025177 231,252,231,176,111,56,22,6,1,1,7,29,84,189,343,518,659,714,659,518,343 %N A025177 Triangular array, read by rows: first differences in n,n direction of trinomial array A027907. %C A025177 The Motzkin transforms of the rows starting (1, 2), (1, 3) and (1, 4), extended by zeros after their last element, are apparently in A026134, A026109 and A026110. - _R. J. Mathar_, Dec 11 2008 %H A025177 Georg Fischer, <a href="/A025177/b025177.txt">Table of n, a(n) for n = 0..2499</a> [rows 0..49; first 676 terms from _G. C. Greubel_] %F A025177 T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), starting with [1], [1, 0, 1]. %F A025177 G.f.: (1-y*z)/[1-z*(1+y+y^2)]. %e A025177 1 %e A025177 1 0 1 %e A025177 1 1 2 1 1 %e A025177 1 2 4 4 4 2 1 %e A025177 1 3 7 10 12 10 7 3 1 %e A025177 1 4 11 20 29 32 29 20 11 4 1 %p A025177 A025177 := proc(n,k) %p A025177 option remember; %p A025177 if k < 0 or k > 2*n then %p A025177 0; %p A025177 elif n = 0 then %p A025177 1 ; %p A025177 elif n = 1 then %p A025177 op(k+1,[1,0,1]) ; %p A025177 else %p A025177 procname(n-1,k-2)+procname(n-1,k-1)+procname(n-1,k) ; %p A025177 end if; %p A025177 end proc: %p A025177 seq(seq(A025177(n,k),k=0..2*n),n=0..20) ; # _R. J. Mathar_, Feb 25 2015 %t A025177 nmax = 10; CoefficientList[CoefficientList[Series[(1 - y*x)/(1 - x*(1 + y + y^2)), {x, 0, nmax}, {y, 0, 2*nmax}], x], y] // Flatten (* _G. C. Greubel_, May 22 2017; amended by _Georg Fischer_, Jun 24 2020 *) %o A025177 (PARI) {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, if( n==1, [1,0,1][k+1], if( n==2, [1,1,2,1,1][k+1], T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)))))}; %o A025177 (PARI) T(n,k)=polcoeff(Ser(polcoeff(Ser((1-y*z)/(1-z*(1+y+y^2)),y),k,y),z),n,z) %o A025177 (PARI) {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, polcoeff( (1 + x + x^2)^n, k) - polcoeff( (1 + x + x^2)^(n-1), k-1)))}; %o A025177 (PARI) g=matrix(33,65); %o A025177 for(n=0,32,for(k=0,2*n,g[n+1,k+1]=0)); %o A025177 g[1,1]=1; %o A025177 g[2,1]=1;g[2,2]=0;g[2,3]=1; %o A025177 g[3,1]=1;g[3,2]=1;g[3,3]=2;g[3,4]=1;g[3,5]=1; %o A025177 for(n=0,2,for(k=0,2*n,print(n," ",k," ",g[n+1,k+1]))) %o A025177 for(n=3,32,g[n+1,1]=1;print(n," 1 1");g[n+1,2]=n-1;print(n," 2 ",n-1);for(k=2,2*n,g[n+1,k+1]=g[n,k-1]+g[n,k]+g[n,k+1];print(n," ",k," ",g[n+1,k+1]))) %o A025177 \\ _Michael B. Porter_, Feb 02 2010 %Y A025177 Columns include A025178, A025179, A025180, A025181, A025182. %Y A025177 Cf. A024996, A025192 (row sums). %K A025177 nonn,tabf,easy %O A025177 0,7 %A A025177 _Clark Kimberling_ %E A025177 Edited by _Ralf Stephan_, Jan 09 2005 %E A025177 Offset corrected by _R. J. Mathar_, Feb 25 2015