找回密码
 欢迎注册
楼主: nyy

[原创] LaTeX盖楼帖

[复制链接]
 楼主| 发表于 2023-9-27 09:11:59 | 显示全部楼层
nyy 发表于 2023-9-27 08:45
右下角不断迭代:

  1. _{_{_{_{a}{b}}{c}}{d}}{e}
复制代码


\[_{_{_{_{a}{b}}{c}}{d}}{e}
\]

这个我再好好研究研究

\[_{_{_{_{5}{4}}{3}}{2}}{1}
\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 09:21:57 | 显示全部楼层
nyy 发表于 2023-9-27 09:11
\[_{_{_{_{a}{b}}{c}}{d}}{e}
\]

左下角不断迭代的输出结果
  1. \[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]
复制代码


\[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]

perl代码
  1. #左下角不断延伸角标
  2. #max=5时的输出结果:\[_{_{_{_{5}{4}}{3}}{2}}{1}\]
  3. $max=59;#最大的指数是$max
  4. $aa="";#初始值
  5. $bb="{1}";#初始值
  6. $i=2;#循环变量
  7. while($i<$max)
  8. {
  9.     $aa="$aa"."_{";
  10.     $bb="{$i}"."}"."$bb";
  11.     $i++;
  12. }
  13. $str=$aa."_{$max}".$bb;#拼成输出结果
  14. #输出结果
  15. open(FH,">>out2.txt");
  16. print FH "\\[$str\\]";#LaTeX输出
  17. print FH "\n";#换行
  18. close(FH);
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 09:25:38 | 显示全部楼层
nyy 发表于 2023-9-27 08:45
右下角不断迭代:

左上角不断迭代的结果

  1. \[^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]
复制代码


\[^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]

perl代码

  1. #左上角不断延伸角标
  2. #max=5时的输出结果:\[^{^{^{^{5}{4}}{3}}{2}}{1}\]
  3. $max=59;#最大的指数是$max
  4. $aa="";#初始值
  5. $bb="{1}";#初始值
  6. $i=2;#循环变量
  7. while($i<$max)
  8. {
  9.     $aa="$aa"."^{";
  10.     $bb="{$i}"."}"."$bb";
  11.     $i++;
  12. }
  13. $str=$aa."^{$max}".$bb;#拼成输出结果
  14. #输出结果
  15. open(FH,">>out2.txt");
  16. print FH "\\[$str\\]";#LaTeX输出
  17. print FH "\n";#换行
  18. close(FH);
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 12:08:38 | 显示全部楼层
nyy 发表于 2023-9-27 09:25
左上角不断迭代的结果

左下角与右上角同时开

  1. \[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{47}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1^{2^{3^{4^{5^{6^{7^{8^{9^{10^{11^{12^{13^{14^{15^{16^{17^{18^{19^{20^{21^{22^{23^{24^{25^{26^{27^{28^{29^{30^{31^{32^{33^{34^{35^{36^{37^{38^{39^{40^{41^{42^{43^{44^{45^{46^{47}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
复制代码


\[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{47}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1^{2^{3^{4^{5^{6^{7^{8^{9^{10^{11^{12^{13^{14^{15^{16^{17^{18^{19^{20^{21^{22^{23^{24^{25^{26^{27^{28^{29^{30^{31^{32^{33^{34^{35^{36^{37^{38^{39^{40^{41^{42^{43^{44^{45^{46^{47}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 12:11:02 | 显示全部楼层
本帖最后由 nyy 于 2023-9-27 12:12 编辑
nyy 发表于 2023-9-27 12:08
左下角与右上角同时开


左下角与左上角同时开

  1. \[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{47}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]
复制代码


\[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{47}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{59}{58}}{57}}{56}}{55}}{54}}{53}}{52}}{51}}{50}}{49}}{48}}{47}}{46}}{45}}{44}}{43}}{42}}{41}}{40}}{39}}{38}}{37}}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]

  1. \[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{37}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{37}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]
复制代码


\[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{37}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{37}{36}}{35}}{34}}{33}}{32}}{31}}{30}}{29}}{28}}{27}}{26}}{25}}{24}}{23}}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 12:15:30 | 显示全部楼层
nyy 发表于 2023-9-27 12:11
左下角与左上角同时开

四个方向同时开工!

  1. \[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{23}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{23}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1_{2_{3_{4_{5_{6_{7_{8_{9_{10_{11_{12_{13_{14_{15_{16_{17_{18_{19_{20_{21_{22_{23}}}}}}}}}}}}}}}}}}}}}}^{2^{3^{4^{5^{6^{7^{8^{9^{10^{11^{12^{13^{14^{15^{16^{17^{18^{19^{20^{21^{22^{23}}}}}}}}}}}}}}}}}}}}}}}\]
复制代码


\[_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{23}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{^{23}{22}}{21}}{20}}{19}}{18}}{17}}{16}}{15}}{14}}{13}}{12}}{11}}{10}}{9}}{8}}{7}}{6}}{5}}{4}}{3}}{2}}{1_{2_{3_{4_{5_{6_{7_{8_{9_{10_{11_{12_{13_{14_{15_{16_{17_{18_{19_{20_{21_{22_{23}}}}}}}}}}}}}}}}}}}}}}^{2^{3^{4^{5^{6^{7^{8^{9^{10^{11^{12^{13^{14^{15^{16^{17^{18^{19^{20^{21^{22^{23}}}}}}}}}}}}}}}}}}}}}}}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 14:36:57 | 显示全部楼层
nyy 发表于 2023-9-27 12:15
四个方向同时开工!

连分数金字塔
  1. \[\frac{1}{1+\frac{2}{1+\frac{3}{1+\frac{4}{1+\frac{5}{1+\frac{6}{1+\frac{7}{1+\frac{8}{1+\frac{9}{1+\frac{10}{1+\frac{11}{1+\frac{12}{1+\frac{13}{1+\frac{14}{1+\frac{15}{1+\frac{16}{1+\frac{17}{1+\frac{18}{1+\frac{19}{1+\frac{20}{1+\frac{21}{1+\frac{22}{1+\frac{23}{1+\frac{24}{1+\frac{25}{1+\frac{26}{1+\frac{27}{1+\frac{28}{1+\frac{29}{1+\frac{30}{1+\frac{31}{1+\frac{32}{1+\frac{33}{1+\frac{34}{1+\frac{35}{1+\frac{36}{1+\frac{37}{1+\frac{38}{1+\frac{39}{1+\frac{40}{1+\frac{41}{1+\frac{42}{1+\frac{43}{1+\frac{44}{1+\frac{45}{1+\frac{46}{1+\frac{47}{1+\frac{48}{1+\frac{49}{1+\frac{50}{1+\frac{51}{1+\frac{52}{1+\frac{53}{1+\frac{54}{1+\frac{55}{1+\frac{56}{1+\frac{57}{1+\frac{58}{1+59}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
复制代码


\[\frac{1}{1+\frac{2}{1+\frac{3}{1+\frac{4}{1+\frac{5}{1+\frac{6}{1+\frac{7}{1+\frac{8}{1+\frac{9}{1+\frac{10}{1+\frac{11}{1+\frac{12}{1+\frac{13}{1+\frac{14}{1+\frac{15}{1+\frac{16}{1+\frac{17}{1+\frac{18}{1+\frac{19}{1+\frac{20}{1+\frac{21}{1+\frac{22}{1+\frac{23}{1+\frac{24}{1+\frac{25}{1+\frac{26}{1+\frac{27}{1+\frac{28}{1+\frac{29}{1+\frac{30}{1+\frac{31}{1+\frac{32}{1+\frac{33}{1+\frac{34}{1+\frac{35}{1+\frac{36}{1+\frac{37}{1+\frac{38}{1+\frac{39}{1+\frac{40}{1+\frac{41}{1+\frac{42}{1+\frac{43}{1+\frac{44}{1+\frac{45}{1+\frac{46}{1+\frac{47}{1+\frac{48}{1+\frac{49}{1+\frac{50}{1+\frac{51}{1+\frac{52}{1+\frac{53}{1+\frac{54}{1+\frac{55}{1+\frac{56}{1+\frac{57}{1+\frac{58}{1+59}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]

代码perl
  1. #连分数金字塔,分母金字塔
  2. #max=5时的输出结果:\[\frac{1}{1+\frac{2}{1+\frac{3}{1+\frac{4}{1+5}}}}\]
  3. $max=59;#最大的指数是$max
  4. $aa="\\frac{1}";#初始值
  5. $bb="";#初始值
  6. $i=2;#循环变量
  7. while($i<$max)
  8. {
  9.     $aa="$aa"."{1+"."\\frac{$i}";
  10.     $bb="$bb"."}";
  11.     $i++;
  12. }
  13. $str=$aa."{1+$max}".$bb;#拼成输出结果
  14. #输出结果
  15. open(FH,">>out2.txt");
  16. print FH "连分数金字塔\n";
  17. print FH "\\[$str\\]";#LaTeX输出
  18. print FH "\n";#换行
  19. close(FH);
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-9-27 14:44:28 | 显示全部楼层
  1. \[\frac{1}{1+\frac{1}{2+\frac{1}{3+\frac{1}{4+\frac{1}{5+\frac{1}{6+\frac{1}{7+\frac{1}{8+\frac{1}{9+\frac{1}{10+\frac{1}{11+\frac{1}{12+\frac{1}{13+\frac{1}{14+\frac{1}{15+\frac{1}{16+\frac{1}{17+\frac{1}{18+\frac{1}{19+\frac{1}{20+\frac{1}{21+\frac{1}{22+\frac{1}{23+\frac{1}{24+\frac{1}{25+\frac{1}{26+\frac{1}{27+\frac{1}{28+\frac{1}{29+\frac{1}{30+\frac{1}{31+\frac{1}{32+\frac{1}{33+\frac{1}{34+\frac{1}{35+\frac{1}{36+\frac{1}{37+\frac{1}{38+\frac{1}{39+\frac{1}{40+\frac{1}{41+\frac{1}{42+\frac{1}{43+\frac{1}{44+\frac{1}{45+\frac{1}{46+\frac{1}{47+\frac{1}{48+\frac{1}{49+\frac{1}{50+\frac{1}{51+\frac{1}{52+\frac{1}{53+\frac{1}{54+\frac{1}{55+\frac{1}{56+\frac{1}{57+\frac{1}{58+\frac{1}{59+\frac{1}{60+\frac{1}{61+\frac{1}{62+\frac{1}{63+\frac{1}{64+\frac{1}{65+\frac{1}{66+\frac{1}{67+1}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
复制代码


连分数金字塔2

\[\frac{1}{1+\frac{1}{2+\frac{1}{3+\frac{1}{4+\frac{1}{5+\frac{1}{6+\frac{1}{7+\frac{1}{8+\frac{1}{9+\frac{1}{10+\frac{1}{11+\frac{1}{12+\frac{1}{13+\frac{1}{14+\frac{1}{15+\frac{1}{16+\frac{1}{17+\frac{1}{18+\frac{1}{19+\frac{1}{20+\frac{1}{21+\frac{1}{22+\frac{1}{23+\frac{1}{24+\frac{1}{25+\frac{1}{26+\frac{1}{27+\frac{1}{28+\frac{1}{29+\frac{1}{30+\frac{1}{31+\frac{1}{32+\frac{1}{33+\frac{1}{34+\frac{1}{35+\frac{1}{36+\frac{1}{37+\frac{1}{38+\frac{1}{39+\frac{1}{40+\frac{1}{41+\frac{1}{42+\frac{1}{43+\frac{1}{44+\frac{1}{45+\frac{1}{46+\frac{1}{47+\frac{1}{48+\frac{1}{49+\frac{1}{50+\frac{1}{51+\frac{1}{52+\frac{1}{53+\frac{1}{54+\frac{1}{55+\frac{1}{56+\frac{1}{57+\frac{1}{58+\frac{1}{59+\frac{1}{60+\frac{1}{61+\frac{1}{62+\frac{1}{63+\frac{1}{64+\frac{1}{65+\frac{1}{66+\frac{1}{67+1}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]

perl代码
  1. #连分数金字塔2,分母金字塔
  2. #max=5时的输出结果:\[\frac{1}{1+\frac{1}{2+\frac{1}{3+\frac{1}{4+\frac{1}{5+1}}}}}\]
  3. $max=67;#最大的指数是$max
  4. $aa="\\frac{1}";#初始值
  5. $bb="";#初始值
  6. $i=1;#循环变量
  7. while($i<$max)
  8. {
  9.     $aa="$aa"."{$i"."+\\frac{1}";
  10.     $bb="$bb"."}";
  11.     $i++;
  12. }
  13. $str=$aa."{$max+1}".$bb;#拼成输出结果
  14. #输出结果
  15. open(FH,">>out2.txt");
  16. print FH "连分数金字塔2\n";
  17. print FH "\\[$str\\]";#LaTeX输出
  18. print FH "\n";#换行
  19. close(FH);
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-10-7 07:53:46 | 显示全部楼层
  1. \[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代码
  1. #连分数金字塔3,分母金字塔
  2. #max=5时的输出结果:\[a_{0}+\frac{1}{a_{1}+\frac{1}{a_{2}+\frac{1}{a_{3}+\frac{1}{a_{4}+\frac{1}{a_{5}}}}}}\]
  3. $max=79;#最大的指数是$max
  4. $aa="a_{0}+\\frac{1}";#初始值
  5. $bb="";#初始值
  6. $i=1;#循环变量
  7. while($i<$max)
  8. {
  9.     $aa="$aa"."{a_{$i}"."+\\frac{1}";
  10.     $bb="$bb"."}";
  11.     $i++;
  12. }
  13. $str=$aa."{a_{$max}}".$bb;#拼成输出结果
  14. #输出结果
  15. open(FH,">>out2.txt");
  16. print FH "连分数金字塔3\n";
  17. print FH "\\[$str\\]";#LaTeX输出
  18. print FH "\n";#换行
  19. 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}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-10-8 11:49:41 | 显示全部楼层
  1. \[\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{1}{2}}{3}}{4}}{5}}{6}}{7}}{8}}{9}}{10}}{11}}{12}}{13}}{14}}{15}}{16}}{17}}{18}}{19}}{20}}{21}}{22}}{23}}{24}}{25}}{26}}{27}}{28}}{29}}{30}}{31}}{32}}{33}}{34}}{35}}{36}}{37}}{38}}{39}}{40}}{41}}{42}}{43}}{44}}{45}}{46}}{47}}{48}}{49}}{50}}{51}}{52}}{53}}{54}}{55}}{56}}{57}}{58}}{59}}{60}}{61}}{62}}{63}}{64}}{65}}{66}}{67}}{68}}{69}}{70}}{71}}{72}}{73}}{74}}{75}}{76}}{77}}{78}}{79}}{80}}{81}\]
复制代码


  1. #正金字塔(上小下大)
  2. #max=5时的输出结果:\[\frac{\frac{\frac{\frac{1}{2}}{3}}{4}}{5}\]
  3. $max=81;#最大的是$max
  4. $aa="1";#初始值
  5. $i=2;#循环变量
  6. while($i<=$max)
  7. {
  8.     $aa="\\frac{$aa}{$i}";
  9.     $i++;
  10. }
  11. $str=$aa;#拼成输出结果
  12. #输出结果
  13. open(FH,">>out2.txt");
  14. print FH "正金字塔(上小下大)\n";
  15. print FH "\\[$str\\]";#LaTeX输出
  16. print FH "\n";#换行
  17. close(FH);
复制代码


\[\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{\frac{1}{2}}{3}}{4}}{5}}{6}}{7}}{8}}{9}}{10}}{11}}{12}}{13}}{14}}{15}}{16}}{17}}{18}}{19}}{20}}{21}}{22}}{23}}{24}}{25}}{26}}{27}}{28}}{29}}{30}}{31}}{32}}{33}}{34}}{35}}{36}}{37}}{38}}{39}}{40}}{41}}{42}}{43}}{44}}{45}}{46}}{47}}{48}}{49}}{50}}{51}}{52}}{53}}{54}}{55}}{56}}{57}}{58}}{59}}{60}}{61}}{62}}{63}}{64}}{65}}{66}}{67}}{68}}{69}}{70}}{71}}{72}}{73}}{74}}{75}}{76}}{77}}{78}}{79}}{80}}{81}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-11-21 21:09 , Processed in 0.025292 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表