LaTeX盖楼帖
LaTeX代码:\color{red}{\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{做}{个}}{笔}}{记}}{:}}{p}}{a}}{r}}{i}}{/}}{G}}{P}}{可}}{以}}{用}}{d}}{e}}{f}}{a}}{u}}{l}}{t}}{(}}{r}}{e}}{a}}{l}}{b}}{i}}{t}}{p}}{r}}{e}}{c}}{i}}{s}}{i}}{o}}{n}}{,}}{ }}{1}}{0}}{2}}{4}}{)}}{增}}{加}}{精}}{度}}{(}}{经}}{@}}{无}}{心}}{人}}{提}}{醒}}{,}}{可}}{以}}{用}}{p}}{ }}{1}}{0}}{2}}{4}}{设}}{定}}{精}}{度}}{)}}
原本内容:
做个笔记:pari/GP可以用default(realbitprecision, 1024)增加精度(经@无心人提醒,可以用\p 1024设定精度)
\[\color{red}{\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{做}{个}}{笔}}{记}}{:}}{p}}{a}}{r}}{i}}{/}}{G}}{P}}{可}}{以}}{用}}{d}}{e}}{f}}{a}}{u}}{l}}{t}}{(}}{r}}{e}}{a}}{l}}{b}}{i}}{t}}{p}}{r}}{e}}{c}}{i}}{s}}{i}}{o}}{n}}{,}}{ }}{1}}{0}}{2}}{4}}{)}}{增}}{加}}{精}}{度}}{(}}{经}}{@}}{无}}{心}}{人}}{提}}{醒}}{,}}{可}}{以}}{用}}{p}}{ }}{1}}{0}}{2}}{4}}{设}}{定}}{精}}{度}}{)}}\]
本帖最后由 nyy 于 2023-9-25 14:34 编辑
\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{\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{\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}}{82}}{83}}{84}}{85}}{86}}{87}}{88}}{89}}{90}}{91}}{92}}{93}}{94}}{95}}{96}}{97}}{98}}{99}}{100}}{101}}{102}}{103}}{104}}{105}}{106}}{107}}{108}}{109}}{110}}{111}}{112}}{113}}{114}}{115}}{116}}{117}}{118}}{119}}{120}}{121}}{122}}{123}}{124}}{125}}{126}}{127}}{128}}{129}}{130}}{131}}{132}}{133}}{134}}{135}}{136}}{137}}{138}}{139}}{140}}{141}}{142}}{143}}{144}}{145}}{146}}{147}}{148}}{149}}{150}}{151}}{152}}{153}}{154}}{155}}{156}}{157}}{158}}{159}}{160}}{161}}{162}}{163}}{164}}{165}}{166}}{167}}{168}}{169}}{170}}{171}}{172}}{173}}{174}}{175}}{176}}{177}}{178}}{179}}{180}}{181}}{182}}{183}}{184}}{185}}{186}}{187}}{188}}{189}}{190}}{191}}{192}}{193}}{194}}{195}}{196}}{197}}{198}}{199}}{200}
从上到下,依次是1到200(在QQ浏览器上,显示1到200会崩溃,但是火狐浏览器不会崩溃!)
\[
\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{\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}}{82}}{83}}{84}}{85}}{86}}{87}}{88}}{89}}{90}}{91}}{92}}{93}}{94}}{95}}{96}}{97}}{98}}{99}}{100}
\] nyy 发表于 2023-9-25 14:28
从上到下,依次是1到200(在QQ浏览器上,显示1到200会崩溃,但是火狐浏览器不会崩溃!)
\[
#切割字符串成数组,数组必须大于等于2,否则错误,小于2也形成不了分数,
#字符串等于"abcde",得到结果"\color{red}{\frac{\frac{\frac{\frac{a}{b}}{c}}{d}}{e}}"
#就得到是LaTeX的分数(金字塔分数)的代码。20191217
use strict;use warnings;use diagnostics;
use Encode;#使用编码
my $txt="abcde";
my $txt="做个笔记:pari/GP可以用default(realbitprecision, 1024)增加精度(经@无心人提醒,可以用\p 1024设定精度)";
my @arrtxt=split(//,decode("cp936",$txt));#把字符串切割成数组
my $aa="\\frac{" . $arrtxt . "}{".$arrtxt."}";#初始值
my $i=2;#循环变量初始值
while($i<=$#arrtxt)
{
$aa="\\frac{".$aa."}{".$arrtxt[$i]."}";
$i++;
}
my $out="\\color{red}{".$aa."}";#最后结果红色处理
#输出结果
open(FH,">out3.txt");
print FH encode("cp936",$out);
#print FH encode("cp936","\n$arrtxt$arrtxt");
close(FH);
my $out="1";
my $j=2;#循环变量初始值
my $max=100;#最后一个数
while($j<=$max) #最后一个数是$max
{
$out="\\frac{".$out."}{".$j."}";
$j++;
}
#输出结果
open(FH,">>out3.txt"); #追加写出结果
print FH "\n$out"; #换行输出结果
close(FH);
perl代码 nyy 发表于 2023-9-25 14:37
perl代码
\[\frac{\frac{\frac{\frac{\frac{1}{2}}{\frac{3}{4}}}{\frac{\frac{5}{6}}{\frac{7}{8}}}}{\frac{\frac{\frac{9}{10}}{\frac{11}{12}}}{\frac{\frac{13}{14}}{\frac{15}{16}}}}}{\frac{\frac{\frac{\frac{17}{18}}{\frac{19}{20}}}{\frac{\frac{21}{22}}{\frac{23}{24}}}}{\frac{\frac{\frac{25}{26}}{\frac{27}{28}}}{\frac{\frac{29}{30}}{\frac{31}{32}}}}}\]
盖分数的楼!
\[\frac{\frac{\frac{\frac{\frac{1}{2}}{\frac{3}{4}}}{\frac{\frac{5}{6}}{\frac{7}{8}}}}{\frac{\frac{\frac{9}{10}}{\frac{11}{12}}}{\frac{\frac{13}{14}}{\frac{15}{16}}}}}{\frac{\frac{\frac{\frac{17}{18}}{\frac{19}{20}}}{\frac{\frac{21}{22}}{\frac{23}{24}}}}{\frac{\frac{\frac{25}{26}}{\frac{27}{28}}}{\frac{\frac{29}{30}}{\frac{31}{32}}}}}\]
nyy 发表于 2023-9-26 08:41
盖分数的楼!
\[\frac{\frac{\frac{\frac{\frac{1}{2}}{\frac{3}{4}}}{\frac{\frac{5}{6}}{\frac{7}{8 ...
use strict;use warnings;use diagnostics;
my $str="\\frac{1}{2}";#第一个初始的值
my $add=2;#初始分母每个数字应该增加的值
my $fm;#分母
my $i=1;#循环变量
my $max=5;#最大的数是2^($max)
while($i<$max)#最大的数是2^($max)
{
$fm=$str;#把分子字符串赋值给分母
$fm=~s/(\d+)/$1+$add/eg;#分母上的各个数增加$add,e表示计算
$str="\\frac{$str}{$fm}";#由分子分母得到一个新的分数
$add=$add*2;#下次增加的数乘以2,依次是2 4 8 16 32 64
$i++;
}
#输出结果
open(FH,">out2.txt");
print FH "\\[$str\\]";
print FH "\n";
close(FH);
perl代码 nyy 发表于 2023-9-26 08:43
perl代码
指数金字塔
\
\
本帖最后由 nyy 于 2023-9-26 09:23 编辑
nyy 发表于 2023-9-26 09:07
指数金字塔
不断开根号金字塔
\[\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5+\sqrt{6+\sqrt{7+\sqrt{8+\sqrt{9+\sqrt{10+\sqrt{11+\sqrt{12+\sqrt{13+\sqrt{14+\sqrt{15+\sqrt{16+\sqrt{17+\sqrt{18+\sqrt{19+\sqrt{20+\sqrt{21+\sqrt{22+\sqrt{23+\sqrt{24+\sqrt{25}}}}}}}}}}}}}}}}}}}}}}}}}\]
\[\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5+\sqrt{6+\sqrt{7+\sqrt{8+\sqrt{9+\sqrt{10+\sqrt{11+\sqrt{12+\sqrt{13+\sqrt{14+\sqrt{15+\sqrt{16+\sqrt{17+\sqrt{18+\sqrt{19+\sqrt{20+\sqrt{21+\sqrt{22+\sqrt{23+\sqrt{24+\sqrt{25}}}}}}}}}}}}}}}}}}}}}}}}}\]
\[\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5+\sqrt{6+\sqrt{7+\sqrt{8+\sqrt{9+\sqrt{10}}}}}}}}}}\]
本帖最后由 nyy 于 2023-9-26 12:32 编辑
nyy 发表于 2023-9-26 09:17
不断开根号金字塔
\[\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\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}}]{16}}]{15}}]{14}}]{13}}]{12}}]{11}}]{10}}]{9}}]{8}}]{7}}]{6}}]{5}}]{4}}]{3}}]{2}}]{1}\]
\[\sqrt[{\sqrt[{\sqrt[{\sqrt[{5}]{4}}]{3}}]{2}}]{1}\]
\[\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{61}]{60}}]{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}\]
nyy 发表于 2023-9-26 12:20
不断地开根号
\[\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sqrt[{\sq ...
use strict;use warnings;use diagnostics;
my $str="\\frac{1}{2}";#第一个初始的值
my $add=2;#初始分母每个数字应该增加的值
my $fm;#分母
my $i=1;#循环变量
my $max=5;#最大的数是2^($max)
while($i<$max)#最大的数是2^($max)
{
$fm=$str;#把分子字符串赋值给分母
$fm=~s/(\d+)/$1+$add/eg;#分母上的各个数增加$add,e表示计算
$str="\\frac{$str}{$fm}";#由分子分母得到一个新的分数
$add=$add*2;#下次增加的数乘以2,依次是2 4 8 16 32 64
$i++;
}
#输出结果
open(FH,">out2.txt");
print FH "\\[$str\\]";
print FH "\n";
close(FH);
#指数金字塔
#$max=4时的输出结果:\
$max=95;#最大的指数是$max
my $aa="1";#最下面的base
my $bb="";
$i=2;#循环变量
while($i<=$max)
{
$aa="$aa"."^{"."$i";
$bb=$bb."}";
$i++;
}
$str=$aa.$bb;#两部分拼成输出结果
#输出结果
open(FH,">>out2.txt");
print FH "\\[$str\\]";
print FH "\n";
close(FH);
#不断开根号金字塔
#$max=5时的输出结果: \[\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5}}}}}\]
$max=25;#最大的指数是$max
$aa="\\sqrt{1";#初始值,最下面的base
$bb="}";#初始值
$i=2;#循环变量
while($i<=$max)
{
$aa="$aa"."+\\sqrt{$i";
$bb=$bb."}";
$i++;
}
$str=$aa.$bb;#两部分拼成输出结果
#输出结果
open(FH,">>out2.txt");
print FH "\\[$str\\]";
print FH "\n";
close(FH);
#开n次方的金字塔
#max=5的输出结果: \[\sqrt[{\sqrt[{\sqrt[{\sqrt[{5}]{4}}]{3}}]{2}}]{1}\]
$max=5;#最大的指数是$max
$aa="\\sqrt";#初始值,最下面的base
$bb="{1}";#初始值
$i=2;
while($i<$max)
{
$aa=$aa . "[{\\sqrt";
$bb="{$i}}]" . $bb;
$i++;
}
$str=$aa."[{$max}]".$bb;#前后两部分,加上中间的
#输出结果
open(FH,">>out2.txt");
print FH "\\[$str\\]";#加上LaTeX的符号
print FH "\n";
close(FH);
本帖最后由 nyy 于 2023-9-27 08:47 编辑
nyy 发表于 2023-9-26 12:24
右下角不断迭代:
\
只发73个
\
#右下角不断下标
#max=5时的输出结果:\
$max=5;#最大的指数是$max
$aa="1";#初始值
$bb="";#初始值
$i=2;#循环变量
while($i<=$max)
{
$aa="$aa"."_{"."$i";
$bb=$bb."}";
$i++;
}
$str=$aa.$bb;#两部分拼成输出结果
#输出结果
open(FH,">>out2.txt");
print FH "\\[$str\\]";#LaTeX输出
print FH "\n";#换行
close(FH);
页:
[1]
2