Spirograph Math

Like a wheel within a wheel


A spirograph can be used to create artistically interesting patterns.
The patterns can be used to show:
the mathematics of least common multiples,
of clock arithmetic (aka modular arithmetic)
and the fundamental theorem of mathematics.


A spirograph
paper and colored pens or pencils
optional 2 common pins and some corrugated cardboard.

The Spirograph

To Do and Notice

Place one of the solid disks with gear teeth on its outside, inside one of the circular holes with gear teeth on its inside.
Roll it around until the inner wheel is at the top center of the outer circle.
Place a pen or pencil inside one of the holes in the inner wheel.
Roll the inner wheel around creating a pattern.
Stop when the pen returns to its starting spot.
Examine the pattern, what does it remind you of?
(I see a flower with many petals.)
Explore the patterns made by wheels and circles with different numbers of teeth.
Notice how the patterns are similar and different.

What happens if you start the pattern with the wheel at the bottom center of the circle?
(Be careful to use the same hole for the pen that you used the first time.)

What’s Going On?

The number of teeth on the wheel and the circle determine the shapes of the patterns made by the spirograph.
The numbers of teeth on the two wheels determines the number of cycles the smaller wheel wil make before the line drawn by the pen returns to its starting point.


A point on a wheel rolling inside a circle traces out a hypocycloid.
A point on a wheel rolling on a flat surface traces out a curve called a cycloid.
A point on a wheel rolling outside another wheel traces out an epicycloid.

Starting at different places produces the same pattern just rotated around from the original.


To Do and Notice

Count the number of teeth on your spirograph wheels and in the spirograph circles.
Stick a piece of tape onto your wheel and write a letter of the alphabet on this wheel such as "A."
Write the letter A on a piece of paper and next to it write the number of teeth you counted.
Give the wheel to a different person and ask them to count the number of teeth and write it on a piece of paper.
Keep your number a secret from them.
After they have counted the number of teeth and written it on their paper, compare your answers.
Are they the same. If not decide who is right.
Then label each gear with its number of teeth.

My spirograph has three large open circles with 72, 96, and 105 teeth.
It has 3 small plastic toothed disks with holes in them. There are small wheels with 36, 52, and 63 teeth.


Are the number of gaps between the teeth the same as the number of teeth?

What’s Going On?

Caution, counting is not easy.
In the Pooh stories there is a forest with either 40 or 41 trees no one can tell which, even if they tie a ribbon around each tree as it is counted.

One good way to count is to pin the wheel down so it cannot move. Insert two pins through holes in the wheel then through a piece of paper, into a sheet of cardboard. Use a pencil to make a mark on the paper next to your starting tooth, number this mark 1. Make a mark next to tooth number 10, 20 and so forth.


The number of gaps equals the number of teeth.

Mathematical patterns

To Do and Notice

Find a wheel with a number of teeth that evenly divides the number of teeth in a circle, that is, the smaller number divides into the larger with no remainder. For example, our 36 tooth wheel divides into the 72 tooth circle exactly twice. Use a pen and trace the pattern created by rolling the wheel inside the circle. Notice the pen returns to its starting point after just one circuit of the larger circle by the smaller wheel.

Find a wheel with a number of teeth that does not evenly divide the number of teeth in the larger circle. Use a pen and trace the pattern created when you roll the wheel inside the circle. For example use our 52 tooth wheel inside our 72 tooth circle and the pattern closes after 13 circuits of the circle by the wheel.

What’s Going On?

The mathematics behind the spirograph.

Consider a small wheel with 10 teeth,inside a larger circular hole with 40 teeth and 40 gaps.
Assign the teeth on the wheel numbers from 0 to 9. Starting at 0 will make our mathematics easier later.
Assign the forty gaps in the large circle numbers starting at 0 and ending at 39.

As it rolls around, the small wheel measures off the larger wheel.
Every 10 holes, the marked tooth, number zero, fits into a hole in the rim.
It returns to the rim at hole number 10,and again at 20, 30,and then after hole 39 it returns to hole 0.
So after one “roll-around” things are back as they started and the pattern made by the pen in the spirograph repeats the same pattern exactly.

But what would happen if there were 45 holes in the outer circle?
In this case hole 0 would be the same as hole 45.
The disk would roll around once hitting, 10,20,30,40, then 50 = 45 + 5, the next time around the pen would make a different pattern as tooth zero hit holes 15,25,35 and then 45 aka 0, returning to its start.

What if there were 42 holes?
then we would get:
cycle 1: 10,20,30,40, 50= 42 + 8.
cycle 2: 18,28,38,48 = 42 + 6
cycle 3: 16,26,36,46 = 42 + 4
cycle 4: 14,24,34,44 = 42 + 2
cycle 5: 12,22,32,42= 42 + 0
and after 5 complete circles the pattern will repeat.

There are several bits of mathematics here:
Least Common Multiples
The fundamental theorem of arithmetic
cycloids and their relatives
modular mathematics and time telling

Let's look at each of these in turn.

Least common multiples.

What’s Going On?

The least common multiple of 10 and 40 is 40
any pair of gears whose larger gear has a number of teeth which is an exact multiple of the number of teeth on the smaller gear will result in a pattern which will be complete after one revolution.

With a 45 tooth circle and 10 tooth wheel the least common multiple is 90.
To go 90 teeth the inner disk must make two complete revolutions (2 = 90/45) of the 45 tooth gear so the pattern repeats after two revolutions.

With 42 teeth the least common multiple of 10 and 42 is 210.
the inner wheel must make 5 revolutions (5 = 210/42) before the pattern repeats.

We can now ask how many revolutions will be made with gears of 10 teeth and 41 teeth.
The least common multiple of 10 and 41 is 410 and the inner disk must make 10 revolutions before the pattern repeats. The maximum number of revolutions before a repeat is equal to the number of teeth on the inner gear.

So What?

It seems surprising, at least to me, that the patterns made by the spirograph relate to the mathematics of adding fractions!
to add 2/5 and 1/2 find the least common multiple of the denominators
5 and 2 which is 10
convert each fraction to this denominator
2/5 = 4/10 and 1/2 = 5/10
then add

More Least Common Multiples
The fundamental theorem of Arithmetic.

(Every number is either prime or else can be expressed as a product of primes in one unique way.)

To find the least common multiple you must decompose each number into its prime factors.
So when we wanted the least common multiple of 10 and 42 we found
2 x 5 = 10 and 2 x 3 x 7 = 42
To make the least common multiple assemble all the prime factors for each number.
In the above numbers 2 appears in both numbers once so include it only once.
The least common multiple is:
the product of 2,3,5,and 7 = 210.

Some numbers contain a prime number more than once such as 8 = 2x2x2. The LCM must include the larger number of appearances of each prime.
With numbers such as 8 and 18 the least common multiple is
2x2x2 = 8
2x3x3 = 18
the least common multiple must contain 2x2x2 from the 8, it can ignore the single 2 from the 18 since it is already included in these three 2's.
The least common multiple is thus

2x2x2x3x3 = 72

Canceling Prime factors
Another way to find the number of cycles before a repeat is to decompose each number into its prime factors
e.g. 96 = 2,2,2,2,2,3
36 = 2,2,3,3

Then cancel out of the smaller number
the prime factors which appear in the larger one
both of the 2’s in 36 appear in 96 and one of the threes
This leaves one three behind
the remaining number,3, means that the inner wheel must make 3 circles before the pattern repeats.

Modular arithmetic what is the remainder?

Modular arithmetic also allows us to calculate the number of revolutions of the spirograph that are needed to close the pattern. Modular arithmetic also allows us to calculate time on a 12 or 24 hour clock.

When you divide two numbers you sometimes get a remainder.
8/2 = 4 exactly, but 9/2 = 4 with a remainder of 1.
The remainder is what is important when figuring out the repeating pattern of the spirograph.
Consider the hole with 72 teeth and the wheel with 36 teeth.
72/36 = 2 no remainder. With no remainder the pattern will repeat exactly after just one revolution of the inner disk within the outer. No remainder means that the marked tooth will return to its starting position after one cycle.
However if there were 96 teeth in the outer ring then 96/36 = 2 remainder 24. The marked tooth misses returning to its original position by 24 teeth!
One its second time around it rolls around 2 x 96 = 192 teeth and 192/36 = 5 remainder 12. It still misses

On the third time around it rolls around 3 x 96 teeth = 288 teeth for 288/36 = 8 no remainder and the pattern repeats after 3 revolutions.

There is a whole branch of mathematics devoted to division with remainders called modular arithmetic. 8 mod 2 = 0 means: What is the remainder when you divide 8 by 2?
In the spirograph, when the modulus is zero the pattern repeats exactly. That is, with an 8 tooth circle and a 2 tooth wheel the pattern will repeat after the first cycle.
However, for a 9 tooth circle, 9 mod 2 = 1 There is a remainder of 1 the pattern does not repeat after this first cycle. The second time around however we get 18 mod 2 = 0 and the pattern made by the spirograph repeats.

Similarly for a 36 tooth wheel inside a 72 tooth cicular hole: 72 mod 36 = 0 and the pattern repeats on the first time around.
While 96 mod 36 = 24 and the wheel does not repeat the first time around.
2 x 96 mod 36 = 12
3 x 96 mod 36 = 0

The arithmetic of clocks

Modular arithmetic is the arithmetic of clocks. Consider our usual 12 hour clock, but ignore AM and PM. If you want to know what 6 hours after 8 is then use modular arithmetic, mod 12.
8 + 6 mod 12 = 14 mod 12 = 2 and it is 2.

This is particularly interesting when crossing time zones. England is 8 hours later than California. so to find the time in England when it is 11 in California
11+8 mod 12 = 19 mod 12 = 7

You can also do modular arithmetic with 24 hour clocks, mod 24.
And with months mod 28, 29, 30 or 31 depending on the number of days in the month.



When a circle rolls along a surface a point on the rim of the circle traces out a curve known as a cycloid.
A pen placed at the rim of your rolling wheel as it moves along the straight-toothed edge of the plastic is a cycloid.
Put a light on the rim of the bicycle tire and the path it traces out as the bicycle rolls is a cycloid.

Illusion of the rolling wheel

Many people see the light going in a circle because they mentally follow the moving bicycle, and see the wheel just rotating, but the actual path involves both the circular motion of the wheel plus the linear displacement of the wheel as it rolls along the ground. The result of the combination of the two motions is a cycloid.
The axle of the wheel moves in a straight line.
And points on the wheel between the axle and the rim move in paths that are also cycloids.
The classic question is, Is there a point on a train that is moving backward? The answer is yes, a point on the flange of the wheel beneath the top of the rail moves backward.
If you slide a bead down a wire shaped like a cycloid the bead will slide from point A to point B in the shortest time. This problem was solved by John Bernoulli. Galileo thought the least time shape was the arc of a circle, he was wrong. This problem of least time is one of the most important problems of physics. It is called the brachistochrone problem.

Copernicus modeled the planets as moving in circular orbits about the sun. This was heresy at the time. As more accurate measurements of planetary motion became available Kepler added other circles, epicycles to the circles in order to match the model the the motion of the planets. An epicycle is drawn by a circle rotating on another circle just similar to what you are drawing here. Eventually, he had to add so many circles that he abandoned epicycles and shifted to conic sections, ellipses, for planetary orbits. This is one of the greatest moments in all of science.


Spirographs are available in many models, Search through toy stores and garage sales. Don't miss the large toothed versions for children.

# Spirograph Scientific Explorations by Paul Doherty 1/14/00