本帖最后由 dlpg070 于 2019-9-26 12:06 编辑
只要子序列有规律,递推关系就一定存在
只不过因增加了条件,地推关系将复杂一点
原数列的递推公式比通项公式简单得多
子数列递推公式是条件表达式不如下面的代码简单
{利用原递推,例4增加新的递推}
下面对你的5个例子给出代码,几乎与原数列一样简单
- (* ===数列和5个特殊字数列 =========================*)
- Clear["Global`*"];
- a[1]=1;
- a[2]=5;
- a[n_]:=a[n-2]+a[n-1]*(4n-2)
- t=Table[{"n="<>ToString[n]<>" ",a[n],"\n"},{n,1,31}](* 31 *)
- Print["计算结果1 譬如:a(1),a(3),a(5),a(07),a(09),a(11),a(13),........ +2 "]
- t1=Table[a[n],{n,1,13,2}]
- Print["计算结果2 譬如:a(2),a(4),a(6),a(08),a(10),a(12),a(14),........ +2 "]
- t2=Table[a[n],{n,2,11,2}]
- Print["计算结果3 譬如:a(3),a(6),a(9),a(12),a(15),a(18),a(21),........ +3 "]
- t3=Table[a[n],{n,3,21,3}]
- Print["计算结果4 譬如:a(1),a(2),a(3),a(05),a(08),a(13),a(21),........下标递推:后一项=前2项之和"]
-
- i4[1]=1;
- i4[2]=2;
- i4[n_]:=i4[n-2]+i4[n-1]
- ti=Table[i4[n],{n,1,7,1}];
- t4=Table[a[ti[[n]]],{n,1,7,1}]
- Print["计算结果5 譬如:a(1),a(4),a(9),a(16),a(25),a(36),a(49),........ 大数计算很慢"]
- t5=Table[a[n^2],{n,1,5,1}]
复制代码
- Out[242]= {{n=1 ,1,
- },{n=2 ,5,
- },{n=3 ,51,
- },{n=4 ,719,
- },{n=5 ,12993,
- },{n=6 ,286565,
- },{n=7 ,7463683,
- },{n=8 ,224197055,
- },{n=9 ,7630163553,
- },{n=10 ,290170412069,
- },{n=11 ,12194787470451,
- },{n=12 ,561250394052815,
- },{n=13 ,28074714490111201,
- },{n=14 ,1516595832860057669,
- },{n=15 ,87990633020373456003,
- },{n=16 ,5456935843096014329855,
- },{n=17 ,360245756277357319226433,
- },{n=18 ,25222659875258108360180165,
- },{n=19 ,1866837076525377375972558643,
- },{n=20 ,145638514628854693434219754319,
- },{n=21 ,11944225036642610238981992412801,
- },{n=22 ,1027348991665893335245885567255205,
- },{n=23 ,92473353474967042782368683045381251,
- },{n=24 ,8693522575638567914877902091833092799,
- },{n=25 ,852057685766054622700816773682688475553,
- },{n=26 ,86918577470713210083398188817726057599205,
- },{n=27 ,9214221269581366323462908831452644793991283,
- },{n=28 ,1013651258231421008791003369648608653396640335,
- },{n=29 ,115565457659651576368497847048772839132010989473,
- },{n=30 ,13637737655097117432491536955124843626230693398149,
- },{n=31 ,1663919559379507978340336006372279695239276605563651,
- }}
- 计算结果1 譬如:a(1),a(3),a(5),a(07),a(09),a(11),a(13),........ +2
- Out[244]= {1,51,12993,7463683,7630163553,12194787470451,28074714490111201}
- 计算结果2 譬如:a(2),a(4),a(6),a(08),a(10),a(12),a(14),........ +2
- Out[246]= {5,719,286565,224197055,290170412069}
- 计算结果3 譬如:a(3),a(6),a(9),a(12),a(15),a(18),a(21),........ +3
- Out[248]= {51,286565,7630163553,561250394052815,87990633020373456003,25222659875258108360180165,11944225036642610238981992412801}
- 计算结果4 譬如:a(1),a(2),a(3),a(05),a(08),a(13),a(21),........下标递推:后一项=前2项之和
- Out[254]= {1,5,51,12993,224197055,28074714490111201,11944225036642610238981992412801}
- 计算结果5 譬如:a(1),a(4),a(9),a(16),a(25),a(36),a(49),........ 大数计算很慢
- Out[256]= {1,719,7630163553,5456935843096014329855,852057685766054622700816773682688475553}
- ======================
复制代码 |