{VERSION 3 0 "IBM INTEL NT" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "No rmal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 256 572 "quad2:=proc(a,b,c)\n local delta, sol1, sol 2;\n\n if a = 0 then\n if b=0 then\n print(`Invalid equati on`);\n else\n print(`There is only one solution`);\n \+ -c/b;\n fi;\n else\n delta:=evalf(b^2-4*a*c);\n if delt a > 0 then\n sol1:=evalf((-b+sqrt(delta))/(2*a));\n sol2 :=evalf((-b-sqrt(delta))/(2*a));\n print(`There are two solutio ns`);\n print(sol1, sol2);\n elif delta = 0 then\n p rint(`There is only one solution`);\n -b/(2*a);\n else\n \+ print(`There are no solutions`);\n fi;\n fi;\n\nend; " } {TEXT -1 6 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "read(`a:quad2.txt`);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%&quad2GR6%%\"aG%\"bG%\"cG6%%&deltaG%%sol1G%%sol2G6\"F.@%/9\$\"\"!@ %/9%F2-%&printG6#%1Invalid~equationGC\$-F76#%;There~is~only~one~solutio nG,\$*&9&\"\"\"F5!\"\"!\"\"C\$>8\$-%&evalfG6#,&*\$)F5\"\"#FA\"\"\"*&F1FNF@ FN!\"%@'2F2FFC&>8%-FH6#,\$*&,&F5FC-%%sqrtG6#FFFNFAF1FB#FNFM>8&-FH6#,\$*& ,&F5FCFenFCFAF1FBFhn-F76#%8There~are~two~solutionsG-F76\$FUFjn/FFF2C\$F; ,\$*&F5FAF1FB#FCFM-F76#%7There~are~no~solutionsGF.F.F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "quad2(0,1,1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%;There~is~only~one~solutionG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "qua d2(3,4,-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%8There~are~two~solutio nsG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6\$\$\"+qV]_@!#5\$!+rPe[:!\"*" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 256 "" 0 "" {TEXT -1 137 "mltable:=proc(n)\n local i, j, k;\n \n for i to n do\n for j to n do\n k:=i*j;\n pr int(i, j, k);\n od;\n od;\n\nend;" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "read(`a:mltable.txt`);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(mlt ableGR6#%\"nG6%%\"iG%\"jG%\"kG6\"F,?(8\$\"\"\"F/9\$%%trueG?(8%F/F/F0F1C\$ >8&*&F.F/F3F/-%&printG6%F.F3F6F,F,F," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "mltable(4);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\" F#F#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\"\"\"#F\$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\"\"\"\$F\$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6% \"\"\"\"\"%F\$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"#\"\"\"F#" }} {PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"#F#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"#\"\"\$\"\"'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\" #\"\"%\"\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\$\"\"\"F#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\$\"\"#\"\"'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\$F#\"\"*" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\$\" \"%\"#7" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"%\"\"\"F#" }}{PARA 11 " " 1 "" {XPPMATH 20 "6%\"\"%\"\"#\"\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"%\"\"\$\"#7" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"%F#\"#;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 147 "Example : We are interested in the sum of squares of consecutive k integers. \+ Write a program to print first n sets of such sums, for input k and n. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 165 "\n\n \n\n\nsqsum:=proc(k, n)\n local i, j, s;\n \n for i to n do\n \+ s:=0;\n for j from 0 to k-1 do\n s:=s + (i+j)^2\n \+ od;\n print(s);\n od;\n\nend;" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "read(`a:sqsum.txt`);" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&sqsumGR6\$%\"kG%\"nG6%%\"iG%\"jG%\" sG6\"F-?(8\$\"\"\"F09%%%trueGC%>8&\"\"!?(8%F6F0,&9\$F0!\"\"F0F2>F5,&F5F0 *\$),&F/F0F8F0\"\"#\"\"\"F0-%&printG6#F5F-F-F-" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "sqsum(3,5);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"#9" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#H" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#]" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#x" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\$5\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "a:=10.0^(-20); b:=1; c:=1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"aG\$\"+++++5!#H" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %\"bG\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cG\"\"\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "quad2(a,b,c);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%8There~are~two~solutionsG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6\$\"\"!\$!+++++5\"#6" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "1^2 - 4*10.^(-20);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #\$\"\"\"\"\"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "12 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }