#包括“comb/ascent-nonflat-rgs.h”#包括“comb/word-stats.h”#包括“comb/comb print.h”#包括“fxtio.h”#包括“fxttypes.h”#包括“jjassert.h”#包括“nextarg.h”//%OEIS序列A218757://%没有包含k个零的平坦步长的长度为n的上升序列的数目。//有关上升序列的统计信息,请参阅comb/ascent-rgs-stats-demo.cc//对于没有平坦台阶的上升序列,请参阅comb/ascent-nonflat-rgs-demo.cc//对于所有上升序列,请参阅comb/ascent-rgs-demo.cc//#define TIMING//取消注释以禁用打印整数main(int argc,char**argv){ulong n=6;NXARG(n,“字符串长度”);ascent_nonflat_rgs A(n);ulong ct=0;单词状态S(A.数据(),n);乌龙街[64];对于(ulong k=0;k<=n;++k)st[k]=0;ulong j=n;{++ct;ulong t=S.num_zeros();//违约//ulong t=S.num_max_val();//ulong t=S.num_ascents();//ulong t=A.num_ascents();//ulong t=S.最大值();st[t]+=1;#如果!定义的计时cout<<setw(4)<<ct<<“:”;//打印RGS:print_vec(“”,A.数据(),n,true);//print_vec(“”,A.m_,n,true);//cout<<setw(4)<<A.num_ascents();//cout<<setw(4)<<j;cout<<“”<<t;cout<<endl;贾塞尔特(A.OK());#endif//计时}而((j=A.next()));对于(ulong k=0;k<=n;++k)cout<<st[k]<<“,”;cout<<endl;cout<<“ct=”<<ct;//OEIS序列A138265cout<<endl;返回0;}// -------------------------/*按零数(A218757):0: 1,1: 0, 1,2:0,1,0,3: 0, 1, 1, 0,4: 0, 2, 3, 0, 0,5: 0, 5, 9, 2, 0, 0,6: 0, 16, 32, 13, 0, 0, 0,7: 0, 61, 132, 72, 6, 0, 0, 0,8: 0, 271, 623, 409, 69, 0, 0, 0, 0,9: 0, 1372, 3314, 2480, 605, 24, 0, 0, 0, 0,10: 0, 7795, 19628, 16222, 5016, 432, 0, 0, 0, 0, 0,11: 0, 49093, 128126, 114594, 41955, 5498, 120, 0, 0, 0, 0, 0,12: 0, 339386, 914005, 872336, 363123, 62626, 3120, 0, 0, 0, 0, 0, 0,13: 0, 2554596, 7074517, 7132352, 3287492, 690935, 54370, 720, 0, 0, 0, 0, 0, 0,14: 0, 20794982, 59050739, 62408068, 31272370, 7644536, 814690, 25560, 0, 0, 0, 0, 0, 0, 0,15: 0, 182010945, 528741491, 582316795, 313016308, 86299772, 11464099, 584580, 5040, 0, 0, 0, 0, 0, 0, 0,行总和为A138265。第n行的总和是第n+1行的第一个元素:长度-(n+1)带有一个零的序列(必须位于初始位置)是通过增加长度n序列的每个数字而形成在前面加零。*////Emacs公司:///局部变量:///MyRelDir:“演示/序列”///makefile-dir:“../../”///make-target:“1demo DSRC=demo/seq/A218757-demo.cc”///make-target2:“1demo DSRC=demo/seq/A218757-demo.cc DEMOFLAGS=-DTIMING”///结束时间: