{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 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257
"" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1
1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }
{PSTYLE "Normal" -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 "Heading 1" 0 3 1
{CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0
0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0
0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Out
put" 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 "Author" 0 19 1 {CSTYLE "" -1 -1 "
" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }
{PSTYLE "" 3 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }
3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 4" -1 257 1 {CSTYLE
"" -1 -1 "Times" 0 20 0 0 0 0 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0
0 0 0 0 0 }{PSTYLE "R3 Font 5" -1 258 1 {CSTYLE "" -1 -1 "Times" 0 17
0 0 0 0 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }{PSTYLE "Sh
are Details" 0 259 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 3 80 0 0 0 0 0 0 }{PSTYLE "R3 Font 3" -1 260 1
{CSTYLE "" -1 -1 "New century schoolbook" 0 17 0 0 1 0 2 1 2 0 0 0 0
0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }}
{SECT 0 {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT -1 38
"Computations on the 3 n + 1 conjecture" }}{PARA 19 "" 0 "" {TEXT -1
122 "Worksheet created by Michael Monagan,\nText taken from Collatz.te
x, Gaston H. Gonnet, Informatik E.T.H. Zurich, Switzerland" }}{PARA
259 "" 0 "" {TEXT 256 9 "Abstract:" }{TEXT -1 89 " Worksheet performs \+
number of iterations in Collatz's problem, i.e., the 3x+1 conjecture.
" }}{PARA 259 "" 0 "" {TEXT 259 28 "Application Areas/Subjects: " }
{TEXT 257 0 "" }{TEXT -1 14 " Number Theory" }}{PARA 259 "" 0 ""
{TEXT 258 9 "Keywords:" }{TEXT -1 58 " Collatz, number Theory, Ulam, \+
Syracuse, Kakutani, Hasse" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 39 " Computations on the 3 \+
n + 1 conjecture" }}{PARA 0 "" 0 "" {TEXT -1 435 "The 3n+1 sequence ha
s probably consumed more CPU time than any other number theoretic conj
ecture. The reason being that its statement is so simple, that most a
mateurs will feel compelled to write programs to test it. This sequen
ce, attributed to Lothar Collatz, has bee given various names, includi
ng Ulam's conjecture, Syracuse problem, Kakutani's problem and Hasse'
s algorithm. The conjecture is based on the iteration defined by:" }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 " \+
n[i+1] = if n[i] is even then n[i]/2 else 3*n[i]+1 ." }}{PARA 0 "" 0
"" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "For example, if n[1]=7
the sequence goes as follows" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 10 "n[1] := 7;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "for i f
rom 1 to 20 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " if irem(n[i],
2)=0 then n[i+1] := iquo(n[i],2) \nelse n[i+1] := 3*n[i]+1 fi;" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 21 "seq( n[i], i=1..20 );" }}{PARA 11 "" 1 "" {XPPMATH
20 "66\"\"(\"#A\"#6\"#M\"#<\"#_\"#E\"#8\"#S\"#?\"#5\"\"&\"#;\"\")\"\"%
\"\"#\"\"\"F1F2F3" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 226 "In this cas
e it is obvious that the sequence entered a cycle and will repeat the \+
values 4,2,1 forever. The 3n+1 conjecture states that for any startin
g positive integer, the sequence eventually reaches 1 and repeats as a
bove." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 301
"Jeffrey Lagarias published an excellent article summarizing most of t
he work done on this problem. His article appeared in the American Ma
thematical Monthly, Volume 92, Number 1, January 1985, pages 3-23. An
y reader who is interested in doing work on this problem is urged to r
ead Lagarias' article." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 ""
0 "" {TEXT -1 243 "The purpose of this note is to show how to compute \+
iterations of this series efficiently using Maple. The programs that \+
we will show, can compute thousands of iterations over terms which are
thousands of digits long in reasonably short times." }}{PARA 0 "" 0 "
" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 384 "We provide two main fu
nctions for working with these sequences: ``DistTo1'' computes the num
ber of iterations that will take its argument to reach the value 1 for
the first time and ``Iterate'' iterates its first argument the number
of times specified in its second argument. Both functions use a recu
rsive modular computation of the terms which requires some additional \+
explanation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT
-1 106 "Let sigma(n) denote the number of iterations required to reduc
e n to 1, or what we call the distance to 1." }}{PARA 0 "" 0 "" {TEXT
-1 56 "The following relations are known and/or easy to derive:" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "sigma( n*2^k ) = sigma (n) + k;" }}
{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%&sigmaG6#*&%\"nG\"\"\")\"\"#%\"kGF)
,&-F%6#F(F)F,F)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "sigma ( \+
n*2^k - 1 ) = sigma( n*3^k - 1 ) + 2*k;" }}{PARA 11 "" 1 "" {XPPMATH
20 "6#/-%&sigmaG6#,&*&%\"nG\"\"\")\"\"#%\"kGF*F*!\"\"F*,&-F%6#,&*&F)F*
)\"\"$F-F*F*F.F*F*F-F," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "s
igma ( n*4^k + 1 ) = sigma ( n*3^k + 1 ) + 3*k;" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#/-%&sigmaG6#,&*&%\"nG\"\"\")\"\"%%\"kGF*F*F*F*,&-F%6#,&
*&F)F*)\"\"$F-F*F*F*F*F*F-F4" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "
It is easy to see that for any value of n, the first k iterations whic
h divide by 2 depend exclusively on the value of n mod 2^k, for exampl
e." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "sigma( 8*n+3 ) = sigma( 9*n+4
) + 5;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%&sigmaG6#,&%\"nG\"\")\"
\"$\"\"\",&-F%6#,&F(\"\"*\"\"%F+F+\"\"&F+" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 36 "sigma( 8*n+5 ) = sigma( 3*n+2 ) + 4;" }}{PARA 11 "
" 1 "" {XPPMATH 20 "6#/-%&sigmaG6#,&%\"nG\"\")\"\"&\"\"\",&-F%6#,&F(\"
\"$\"\"#F+F+\"\"%F+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 243 "It should
also be observed that the factor that multiplies n in the resulting t
erm is always a power of 3. Furthermore, this power of 3 corresponds \+
exactly to the number of 3n+1 iterations necessary while doing the k d
ivide by two iterations." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 593 "The above suggests that we could run the iteratio
n in symbolic terms, say for an arbitrary value of k by computing the \+
coefficients for the resulting iterations. This strategy has two imme
diate advantages. First, for very large numbers, we will need to do t
he computation with long numbers only once for every k division by two
steps; secondly, we could easily tabulate all the possible values for
small values of k, and hence save in the computation of the coefficie
nts themselves. In mathematical terms, what we will compute are the f
unctions a_k and b_k defined by the following equation" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 59 "sigma ( 2^k*n[1] + n[0] ) = sigma ( 3^(b[k]( n
[0] ))*n[1] +" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "a[k]( n[0] ) ) + k
+ b[k]( n[0] );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%&sigmaG6#,&)\"
\"#%\"kG\"\"(&%\"nG6#\"\"!\"\"\",(-F%6#,&)\"\"$-&%\"bG6#F*6#F,F+-&%\"a
GF:F;F0F0F*F0F7F0" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 120 "By analyzin
g two steps of such an iteration we can derive the function a[2*k] and
b[2*k] in terms of a[k] and b[k]. Let" }}{PARA 0 "> " 0 "" {MPLTEXT
1 0 20 "n = n[1]*2^k + n[0];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%\"nG
,&)\"\"#%\"kG\"\"(&F$6#\"\"!\"\"\"" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 37 "q = n[1]*3^(b[k](n[0])) + a[k](n[0]);" }}{PARA 11 ""
1 "" {XPPMATH 20 "6#/%\"qG,&)\"\"$-&%\"bG6#%\"kG6#&%\"nG6#\"\"!\"\"(-&
%\"aGF+F-\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "then" }}{PARA
0 "> " 0 "" {MPLTEXT 1 0 73 "a[2*k](n) = floor( q/2^k ) * 3^(b[k](' q \+
mod 2^k ')) + a[k]('q mod 2^k');" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-
&%\"aG6#,$%\"kG\"\"#6#%\"nG,&*&-%&floorG6#*&%\"qG\"\"\")F*F)!\"\"\"\"
\")\"\"$-&%\"bG6#F)6#-%$modG6$F3F5F7F7-&F&F=F>F7" }}}{EXCHG {PARA 0 ">
" 0 "" {MPLTEXT 1 0 43 "b[2*k](n) = b[k](n[0]) + b[k]('q mod 2^k');"
}}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-&%\"bG6#,$%\"kG\"\"#6#%\"nG,&-&F&6
#F)6#&F,6#\"\"!\"\"\"-F/6#-%$modG6$%\"qG)F*F)F5" }}}{EXCHG {PARA 0 ""
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 431 "As it turns out, th
is gives us a very efficient method for computing several iterations o
f the recurrence at once. The main program to compute the sigma(n) fu
nction will compute k as an appropriate power of two, as large as poss
ible, but guaranteeing that the series will not reach 1 in less than k
steps. This is achieved simply by insuring that 2^k < n. The functi
on definition, argument checking and initialization look like:" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "DistTo1 := proc(n::posint) local it
s, t, qt, u, rt, bits;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " its :
= 0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " t := n;" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 6 " do" }}{PARA 0 "" 0 "" {TEXT -1 86 "If the a
rgument is small enough (or becomes small enough) compute the result d
irectly." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 92 " if t < 10 then
\n RETURN( op(t,[0,1,7,2,5,8,16,3,19,6]) + its )\n f
i;" }}{PARA 0 "" 0 "" {TEXT -1 186 "Now compute 2^bits < t by comparin
g the lengths of their decimal representations (the iteration is stopp
ed before exceeding t so that we save one (the largest) power of two c
omputation)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " bits := 3;
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " while 2*length(pow2(bit
s)) < length(t) do bits := 2*bits od;" }}{PARA 0 "" 0 "" {TEXT -1 86 "
The function iquo returns the quotient and stores the remainder in its
third argument." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " qt := i
quo(t,pow2(bits),'rt');" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " \+
u := CollatzMod(rt,bits);" }}{PARA 0 "" 0 "" {TEXT -1 115 "The values \+
a[bits] and b[bits] are in the list u, now add the number of iteration
s and compute the next value of t." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0
29 " its := its+u[2]+bits;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0
28 " t := qt*3^u[2]+u[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "
od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "
" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 235 "The function whic
h computes a[bits] and b[bits] is written recursively. The bottom of \+
the recursion is entered as fixed constants at the end of the definiti
on. The body of this function just follows the above mathematical def
inition." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "CollatzMod := proc(r,b)
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "local b2, q1, q2, u1, u2, res;
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " b2 := iquo(b,2);" }}{PARA
0 "" 0 "" {TEXT -1 86 "The function irem returns the remainder and sto
res the quotient in its third argument." }}{PARA 0 "> " 0 "" {MPLTEXT
1 0 47 " u1 := CollatzMod(irem(r,pow2(b2),'q1'),b2);" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 62 " u2 := CollatzMod(irem(q1*3^u1[2]+u1[1],pow
2(b2),'q2'),b2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " res := [q2*
3^u2[2]+u2[1], u1[2]+u2[2]];" }}{PARA 0 "" 0 "" {TEXT -1 206 "If b is \+
less or equal to 12, then we will remember any computed value for the \+
future. This will effectively create a dynamic table (will only grow \+
as needed) with at most 4175=2^12+2^6+2^3+2^2+2^1 entries." }}{PARA 0
"> " 0 "" {MPLTEXT 1 0 47 " if b <= 12 then CollatzMod(args) := res
fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " res;" }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 163 "Now we
will define all the possible cases for 3 or less bits, this will term
inate the recursion of the above function. (Notice that b is always of
the form 3 2^k)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "CollatzMod(0,1
) := [0,0]: CollatzMod(1,1) := [2,1]:" }}{PARA 0 "> " 0 "" {MPLTEXT
1 0 52 "CollatzMod(0,2) := [0,0]: CollatzMod(1,2) := [1,1]:" }}{PARA
0 "> " 0 "" {MPLTEXT 1 0 52 "CollatzMod(2,2) := [2,1]: CollatzMod(3,2
) := [8,2]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "CollatzMod(0,3) := [
0,0]: CollatzMod(1,3) := [2,2]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52
"CollatzMod(2,3) := [1,1]: CollatzMod(3,3) := [4,2]:" }}{PARA 0 "> "
0 "" {MPLTEXT 1 0 52 "CollatzMod(4,3) := [2,1]: CollatzMod(5,3) := [2
,1]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "CollatzMod(6,3) := [8,2]: \+
CollatzMod(7,3) := [26,3]:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 218 "Th
e above functions will use some powers of two again and again. Since \+
these powers of two are very few (just the ones of the form 2^(3 2^b) \+
it is worthwhile computing them efficiently and remembering the past v
alues." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "pow2 := proc(b) option re
member;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "if b <= 24 then 2^b else
pow2(b/2)^2 fi end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "Now compu
te some values (and try to verify some of the above identities)" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "DistTo1( 2^200 );" }}{PARA 11 "" 1
"" {XPPMATH 20 "6#\"$+#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "
DistTo1( 2^100-1 ) = DistTo1( 3^100-1 ) + 200;" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#/\"%l9F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "
DistTo1( 25*4^100+1 ) = DistTo1( 25*3^100+1 ) + 300;" }}{PARA 11 "" 1
"" {XPPMATH 20 "6#/\"%i:F$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 268 "Th
e function Iterate will start with a value x perform n Collatz iterati
ons and return the resulting term. It is written using the same ideas
of modular computation as above, plus a provision for terminating qui
ckly once that the iteration reaches its cycle at 4,2,1." }}{PARA 0 ">
" 0 "" {MPLTEXT 1 0 39 "Iterate := proc( x::posint, n::posint )" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "local bits, qt, rn, rt, rx, u;" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " rn := n; rx := x;" }}{PARA 0 "
> " 0 "" {MPLTEXT 1 0 19 " while rn > 0 do" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 58 " if rx=1 then RETURN( op( modp(rn,3)+1, [1,4,2
] ) )" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " elif rx=2 then RET
URN( op( modp(rn,3)+1, [2,1,4] ) )" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0
60 " elif rx=4 then RETURN( op( modp(rn,3)+1, [4,2,1] ) )" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " elif rn < 6 then" }}{PARA
0 "> " 0 "" {MPLTEXT 1 0 69 " if irem(rx,2,'qt')=1 then rx
:= 3*rx+1 else rx := qt fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " \+
rn := rn-1" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " els
e bits := 3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " while \+
2*length(pow2(bits)) < length(t) and 4*bits < rn" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 39 " do bits := 2*bits od; " }}{PARA 0 ">
" 0 "" {MPLTEXT 1 0 44 " qt := iquo(rx,pow2(bits),'rt');
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " u := CollatzMod(rt
,bits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " rn := rn-u[
2]-bits;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " rx := qt*3
^u[2]+u[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " od;" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 7 " rx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end: " }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT
-1 45 "Now we can try some examples of this function" }}{PARA 0 "> "
0 "" {MPLTEXT 1 0 34 "Iterate(12345678901234567890,100);" }}{PARA 11 "
" 1 "" {XPPMATH 20 "6#\"1$R$zL^M!z#" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 26 "Iterate( 2^100-1, 2^100 );" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "The next
expression should return 1 for any value of x" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 40 "x := 7052477465274658974657456924727562;" }}{PARA 0 "
> " 0 "" {MPLTEXT 1 0 25 "Iterate( x, DistTo1(x) );" }}{PARA 11 "" 1 "
" {XPPMATH 20 "6#>%\"xG\"CivsCpXdY(*eYFluZ_q" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 122 "Finally
, for some timings, this was run on a DEC 5000 workstation (notice tha
t 3^50000-1 is an integer 23857 digits long)." }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 47 "st := time(): DistTo1( 3^5000-1 ); time()-st;" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "st := time(): DistTo1( 3^50000-1 )
; time()-st;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"&yt&" }}{PARA 11 "
" 1 "" {XPPMATH 20 "6#$\"%o9!\"$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"
'eyc" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"&$*G$!\"$" }}}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "7 0 0" 8 }{VIEWOPTS 1
1 0 1 1 1803 }