/* Pari/GP script */ /* Joerg Arndt, Feb 13 2011 */ {T186084=[ [1], [0,1], [0,0,1], [0,0,1,1], [0,0,0,2,1], [0,0,0,1,3,1], [0,0,0,0,3,4,1], [0,0,0,0,1,6,5,1], [0,0,0,0,1,4,10,6,1], [0,0,0,0,0,3,10,15,7,1], [0,0,0,0,0,2,8,20,21,8,1], [0,0,0,0,0,1,7,19,35,28,9,1], [0,0,0,0,0,0,5,18,40,56,36,10,1], [0,0,0,0,0,0,3,16,41,76,84,45,11,1], [0,0,0,0,0,0,1,12,41,86,133,120,55,12,1], [0,0,0,0,0,0,1,8,36,93,168,218,165,66,13,1], [0,0,0,0,0,0,0,6,29,92,195,308,339,220,78,14,1], [0,0,0,0,0,0,0,3,23,83,211,385,534,505,286,91,15,1], [0,0,0,0,0,0,0,2,18,72,209,448,722,882,726,364,105,16,1], [0,0,0,0,0,0,0,1,12,62,196,481,897,1293,1397,1013,455,120,17,1], [0,0,0,0,0,0,0,0,9,50,180,484,1033,1712,2221,2134,1378,560,136,18,1], [0,0,0,0,0,0,0,0,5,40,160,471,1110,2099,3135,3674,3159,1834,680,153,19,1], [0,0,0,0,0,0,0,0,3,30,137,446,1141,2398,4074,5532,5875,4550,2395,816,171,20,1], [0,0,0,0,0,0,0,0,1,22,117,408,1138,2599,4928,7603,9438,9113,6398,3076,969,190,21,1], [0,0,0,0,0,0,0,0,1,14,94,368,1100,2718,5623,9704,13706,15612,13755,8808,3893,1140,210,22,1], [0,0,0,0,0,0,0,0,0,10,74,323,1039,2755,6153,11638,18412,23948,25103,20259,11900,4863,1330,231,23,1], [0,0,0,0,0,0,0,0,0,6,57,276,964,2718,6512,13310,23169,33804,40664,39328,29188,15810,6004,1540,253,24,1], [0,0,0,0,0,0,0,0,0,3,43,231,872,2630,6693,14673,27671,44560,60253,67250,60163,41225,20691,7335,1771,276,25,1], [0,0,0,0,0,0,0,0,0,2,29,192,777,2492,6724,15676,31731,55530,83086,104534,108532,90048,57189,26714,8876,2024,300,26,1], [0,0,0,0,0,0,0,0,0,1,22,152,681,2319,6622,16320,35179,66182,107946,150630,176897,171226,132107,78052,34069,10648,2300,325,27,1], [0,0,0,0,0,0,0,0,0,0,14,120,588,2128,6398,16634,37907,76052,133632,203854,266152,292510,264503,190284,104957,42966,12673,2600,351,28,1], [0,0,0,0,0,0,0,0,0,0,9,93,495,1928,6091,16626,39902,84739,159037,261992,374909,459243,473363,400674,269496,139237,53636,14974,2925,378,29,1], [0,0,0,0,0,0,0,0,0,0,5,70,416,1714,5723,16346,41152,92018,183093,322732,499965,672866,775135,750738,596011,375804,182435,66332,17575,3276,406,30,1], [0,0,0,0,0,0,0,0,0,0,3,50,341,1513,5304,15851,41685,97755,204961,383662,637189,930614,1180593,1281629,1168365,871721,516603,236325,81330,20501,3654,435,31,1], [0,0,0,0,0,0,0,0,0,0,1,36,275,1318,4856,15172,41595,101866,224057,442520,781804,1226620,1692614,2028186,2078508,1786400,1255091,700832,302934,98930,23778,4060,465,32,1], [0,0,0,0,0,0,0,0,0,0,1,24,216,1130,4412,14345,40951,104412,239923,497466,928717,1552729,2306530,3012900,3416118,3310122,2686378,1780823,939205,384565,119457,27433,4495,496,33,1] ];} default(echo,1); n=#T186084 \\ number of rows M=matrix(n,n); for(r=1,n,for(c=1,#T186084[r],M[r,c]=T186084[r][c])); \\ as matrix A186085=vector(n,r,sum(c=1,n,M[r,c])) \\ sand piles by weight m=1; while(M[n,m]==0,m+=1); m \\ only rows ending in zero A001006=vector(m,r,sum(c=1,n,M[c,r])) \\ Motzkin numbers /* diagonals, with offset: */ for(t=1,n,print1(M[t,t],", ")); /* const == 1 */ for(t=2,n,print1(M[t,t-1],", ")); /* n */ for(t=3,n,print1(M[t,t-2],", ")); /* A000217 n*(n+1)/2 */ for(t=4,n,print1(M[t,t-3],", ")); /* A000292 n*(n+1)*(n+2)/6 */ for(t=5,n,print1(M[t,t-4],", ")); /* not on OEIS */ f(t)=binomial(t,4)+t-2 vector(n,t,f(t)) /* same (with offset) */ quit /* ++++++++++++++++++++++++++ */