- 注册时间
- 2021-11-19
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 8641
- 在线时间
- 小时
|
楼主 |
发表于 2023-10-7 07:53:46
|
显示全部楼层
- \[a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{a_{3}+\frac{1}{a_{4}+\frac{1}{a_{5}+\frac{1}{a_{6}+\frac{1}{a_{7}+\frac{1}{a_{8}+\frac{1}{a_{9}+\frac{1}{a_{10}+\frac{1}{a_{11}+\frac{1}{a_{12}+\frac{1}{a_{13}+\frac{1}{a_{14}+\frac{1}{a_{15}+\frac{1}{a_{16}+\frac{1}{a_{17}+\frac{1}{a_{18}+\frac{1}{a_{19}+\frac{1}{a_{20}+\frac{1}{a_{21}+\frac{1}{a_{22}+\frac{1}{a_{23}+\frac{1}{a_{24}+\frac{1}{a_{25}+\frac{1}{a_{26}+\frac{1}{a_{27}+\frac{1}{a_{28}+\frac{1}{a_{29}+\frac{1}{a_{30}+\frac{1}{a_{31}+\frac{1}{a_{32}+\frac{1}{a_{33}+\frac{1}{a_{34}+\frac{1}{a_{35}+\frac{1}{a_{36}+\frac{1}{a_{37}+\frac{1}{a_{38}+\frac{1}{a_{39}+\frac{1}{a_{40}+\frac{1}{a_{41}+\frac{1}{a_{42}+\frac{1}{a_{43}+\frac{1}{a_{44}+\frac{1}{a_{45}+\frac{1}{a_{46}+\frac{1}{a_{47}+\frac{1}{a_{48}+\frac{1}{a_{49}+\frac{1}{a_{50}+\frac{1}{a_{51}+\frac{1}{a_{52}+\frac{1}{a_{53}+\frac{1}{a_{54}+\frac{1}{a_{55}+\frac{1}{a_{56}+\frac{1}{a_{57}+\frac{1}{a_{58}+\frac{1}{a_{59}+\frac{1}{a_{60}+\frac{1}{a_{61}+\frac{1}{a_{62}+\frac{1}{a_{63}+\frac{1}{a_{64}+\frac{1}{a_{65}+\frac{1}{a_{66}+\frac{1}{a_{67}+\frac{1}{a_{68}+\frac{1}{a_{69}+\frac{1}{a_{70}+\frac{1}{a_{71}+\frac{1}{a_{72}+\frac{1}{a_{73}+\frac{1}{a_{74}+\frac{1}{a_{75}+\frac{1}{a_{76}+\frac{1}{a_{77}+\frac{1}{a_{78}+\frac{1}{a_{79}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
复制代码
代码如上
perl代码
- #连分数金字塔3,分母金字塔
- #max=5时的输出结果:\[a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{a_{3}+\frac{1}{a_{4}+\frac{1}{a_{5}}}}}}\]
- $max=79;#最大的指数是$max
- $aa="a_{0}+\\frac{1}";#初始值
- $bb="";#初始值
- $i=1;#循环变量
- while($i<$max)
- {
- $aa="$aa"."{a_{$i}"."+\\frac{1}";
- $bb="$bb"."}";
- $i++;
- }
- $str=$aa."{a_{$max}}".$bb;#拼成输出结果
- #输出结果
- open(FH,">>out2.txt");
- print FH "连分数金字塔3\n";
- print FH "\\[$str\\]";#LaTeX输出
- print FH "\n";#换行
- close(FH);
复制代码
\[a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{a_{3}+\frac{1}{a_{4}+\frac{1}{a_{5}+\frac{1}{a_{6}+\frac{1}{a_{7}+\frac{1}{a_{8}+\frac{1}{a_{9}+\frac{1}{a_{10}+\frac{1}{a_{11}+\frac{1}{a_{12}+\frac{1}{a_{13}+\frac{1}{a_{14}+\frac{1}{a_{15}+\frac{1}{a_{16}+\frac{1}{a_{17}+\frac{1}{a_{18}+\frac{1}{a_{19}+\frac{1}{a_{20}+\frac{1}{a_{21}+\frac{1}{a_{22}+\frac{1}{a_{23}+\frac{1}{a_{24}+\frac{1}{a_{25}+\frac{1}{a_{26}+\frac{1}{a_{27}+\frac{1}{a_{28}+\frac{1}{a_{29}+\frac{1}{a_{30}+\frac{1}{a_{31}+\frac{1}{a_{32}+\frac{1}{a_{33}+\frac{1}{a_{34}+\frac{1}{a_{35}+\frac{1}{a_{36}+\frac{1}{a_{37}+\frac{1}{a_{38}+\frac{1}{a_{39}+\frac{1}{a_{40}+\frac{1}{a_{41}+\frac{1}{a_{42}+\frac{1}{a_{43}+\frac{1}{a_{44}+\frac{1}{a_{45}+\frac{1}{a_{46}+\frac{1}{a_{47}+\frac{1}{a_{48}+\frac{1}{a_{49}+\frac{1}{a_{50}+\frac{1}{a_{51}+\frac{1}{a_{52}+\frac{1}{a_{53}+\frac{1}{a_{54}+\frac{1}{a_{55}+\frac{1}{a_{56}+\frac{1}{a_{57}+\frac{1}{a_{58}+\frac{1}{a_{59}+\frac{1}{a_{60}+\frac{1}{a_{61}+\frac{1}{a_{62}+\frac{1}{a_{63}+\frac{1}{a_{64}+\frac{1}{a_{65}+\frac{1}{a_{66}+\frac{1}{a_{67}+\frac{1}{a_{68}+\frac{1}{a_{69}+\frac{1}{a_{70}+\frac{1}{a_{71}+\frac{1}{a_{72}+\frac{1}{a_{73}+\frac{1}{a_{74}+\frac{1}{a_{75}+\frac{1}{a_{76}+\frac{1}{a_{77}+\frac{1}{a_{78}+\frac{1}{a_{79}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
|
|