|
|
A024996
|
|
Triangular array, read by rows: second differences in n,n direction of trinomial array A027907.
|
|
18
|
|
|
1, 1, 0, 1, 1, 0, 2, 0, 1, 1, 1, 3, 2, 3, 1, 1, 1, 2, 5, 6, 8, 6, 5, 2, 1, 1, 3, 8, 13, 19, 20, 19, 13, 8, 3, 1, 1, 4, 12, 24, 40, 52, 58, 52, 40, 24, 12, 4, 1, 1, 5, 17, 40, 76, 116, 150, 162, 150, 116, 76, 40, 17, 5, 1, 1, 6, 23, 62, 133, 232, 342, 428, 462, 428, 342, 232, 133, 62, 23, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,7
|
|
COMMENTS
|
For n>2, T(n,k) = number of integer strings s(0),...,s(n) such that s(n)=n-k, s(0)=0, |s(i)-s(i-1)|=1 for i=1,2 and <=1 for i >= 3.
|
|
LINKS
|
G. C. Greubel, Table of n, a(n) for the first 50 rows, flattened
|
|
FORMULA
|
T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), starting with [1], [1, 0, 1], [1, 0, 2, 0, 1].
G.f.: (1-yz)^2 / [1-z(1+y+y^2)]. - Ralf Stephan, Jan 09 2005
|
|
EXAMPLE
|
.............1
..........1..0..1
.......1..0..2..0..1
.....1.1..3..2..3..1..1
...1.2.5..6..8..6..5..2.1
.1.3.8.13.19.20.19.13.8.3.1
|
|
MAPLE
|
A024996 := proc(n, k)
option remember;
if n < 0 or k < 0 or k > 2*n then
0 ;
elif n <= 2 then
if k = 2*n or k = 0 then
1;
elif k = 2*n-1 or k = 1 then
0;
elif k =2 then
2;
end if;
else
procname(n-1, k-1)+procname(n-1, k-2)+procname(n-1, k) ;
end if;
end proc: # R. J. Mathar, Jun 23 2013
|
|
MATHEMATICA
|
CoefficientList[CoefficientList[Series[(1 - y*x)^2/(1 - x*(1 + y + y^2)), {x, 0, 10}, {y, 0, 10}], x], y] // Flatten (* G. C. Greubel, May 22 2017 *)
|
|
PROG
|
(PARI) T(n, k)=if(n<0||k<0||k>2*n, 0, if(n==0, 1, if(n==1, [1, 0, 1][k+1], if(n==2, [1, 0, 2, 0, 1][k+1], T(n-1, k-2)+T(n-1, k-1)+T(n-1, k)))))
|
|
CROSSREFS
|
First differences in n, n direction of array A025177.
Central column is essentially A024997, other columns are A024998, A026069, A026070, A026071. Row sums are in A025579. Cf. A024072.
Sequence in context: A029394 A035467 A254045 * A187596 A263863 A134655
Adjacent sequences: A024993 A024994 A024995 * A024997 A024998 A024999
|
|
KEYWORD
|
nonn,tabf,easy
|
|
AUTHOR
|
Clark Kimberling
|
|
EXTENSIONS
|
Edited by Ralf Stephan, Jan 09 2004
Offset corrected by R. J. Mathar, Jun 23 2013
|
|
STATUS
|
approved
|
|
|
|