Some Examples


This page has some examples of how to produce triangle sequences using our Mathematica Package.


How To Load a Mathematica Package

Assuming that the file "TriangleSequences.m" is in your Mathematica working directory, you can load the Mathematica Package by typing
<<TriangleSequences`

To get a list of all the commands in the package type
?TriangleSequences`*

To get more information about a specific command type
?command name

How To Tell What Triangle A Point is In?

To get the number of the sub-triangle in which a point {a,b}, lies type:
Triangle[{a,b}]

For example, typing:
Triangle[{.4, .25}]

Will yield: 2

How To Generate a Triangle Sequence

To produce the first n terms of the triangle sequence for a point {a,b}, type:
TriangleSequence[{a,b},n]

For example, typing:
TriangleSequence[{Sqrt[2]-1, (Sqrt[2]-1)^2}, 5]

Will yield: {3,3,3,3,3}

How To Generate Convergent Vectors

To produce the first n convergent vectors for a point {a,b}, type:
CVectors[{a,b},n]

For example, typing:
CVectors[{5^(1/3)-1, 3^(1/3)-1}, 5]

Will yield: {{1,-1,0}, {0,1,-1}, {-1,1,1}, {1,-2,1}, {-4,10,-7}}

How To Plot The Orbit of a Point

To plot the orbit of a point {a,b} under the triangle iteration, type:
PlotOrbit[{a,b}]

For example, to get a nice picture type:
PlotOrbit[{Sqrt[24]-4, (Sqrt[24]-4)^2}]

How To Find The Point Corresponding To a Periodic Sequence

To find the point with triangle sequence (b1, b2, ..., a1, a2, ..., a1, a2, ..., a1, a2, ...), type:
FindPeriodicPoint[{b1, b2, ...}, {a1, a2, ...}]

For example, typing:
FindPeriodicPoint[{5,2}]

Will yield: {Sqrt[5] - 2, 7/2 - (3/2) Sqrt[5]}
Note that this the points corresponding to periodic sequences are always algebraic numbers of degree at most 3. For more information on this result, see The Paper: Periodic Sequences for Algebraic Numbers.


Triangle Sequence Home Page


This work on Triangle Sequences was done by the 1999 SMALL Number Theory group at Williams College under the direction of Tom Garrity. The students in this group were Tegan Cheslack-Postava, Alex Diesl, Matthew Lepinski and Adam Schuyler. This work was supported by an REU grant from the National Science Foundation.

If you have any questions or comments about this page, please email Tom Garrity at tgarrity@williams.edu