Fine as Nine

This is a regular nonagon (a polygon with nine sides):

A nonagon or enneagon (from Wikipedia)

And this is the endlessly repeating decimal of the reciprocal of 7:

1/7 = 0.142857142857142857142857…

What is the curious connection between 1/7 and nonagons? If I’d been asked that a week ago, I’d’ve had no answer. Then I found a curious connection when I was looking at the leading digits of polygonal numbers. A polygonal number is a number that can be represented in the form of a polygon. Triangular numbers look like this:


* = 1

*
** = 3

*
**
*** = 6

*
**
***
**** = 10

*
**
***
****
***** = 15

By looking at the shapes rather than the numbers, it’s easy to see that you generate the triangular numbers by simply summing the integers:


1 = 1
1+2=3
1+2+3=6
1+2+3+4=10
1+2+3+4+5=15

Now try the square numbers:


* = 1

**
** = 4

***
***
*** = 9

****
****
****
**** = 16

*****
*****
*****
*****
***** = 25


You generate the square numbers by summing the odd integers:


1 = 1
1+3 = 4
1+3+5 = 9
1+3+7 = 16
1+3+7+9 = 25

Next come the pentagonal numbers, the hexagonal numbers, the heptagonal numbers, and so on. I was looking at the leading digits of these numbers and trying to find patterns. For example, when do the leading digits of the k-th triangular number, tri(k), match the digits of k? This is when:


tri(1) = 1
tri(19) = 190
tri(199) = 19900
tri(1999) = 1999000
tri(19999) = 199990000
tri(199999) = 19999900000
[...]

That pattern is easy to explain. The formula for the k-th polygonal number is k * ((pn-2)*k + (4-pn)) / 2, where pn = 3 for the triangular numbers, 4 for the square numbers, 5 for the pentagonal numbers, and so on. Therefore the k-th triangular number is k * (k + 1) / 2. When k = 19, the formula is 19 * (19 + 1) / 2 = 19 * 20 / 2 = 19 * 10 = 190. And so on. Now try the pol(k) = leaddig(pol(k)) for higher polygonal numbers. The patterns are easy to predict until you get to the nonagonal numbers:


square(10) = 100
square(100) = 10000
square(1000) = 1000000
square(10000) = 100000000
square(100000) = 10000000000
[...]


pentagonal(7) = 70
pentagonal(67) = 6700
pentagonal(667) = 667000
pentagonal(6667) = 66670000
pentagonal(66667) = 6666700000
[...]


hexagonal(6) = 66
hexagonal(51) = 5151
hexagonal(501) = 501501
hexagonal(5001) = 50015001
hexagonal(50001) = 5000150001
[...]


heptagonal(5) = 55
heptagonal(41) = 4141
heptagonal(401) = 401401
heptagonal(4001) = 40014001
heptagonal(40001) = 4000140001
[...]


octagonal(4) = 40
octagonal(34) = 3400
octagonal(334) = 334000
octagonal(3334) = 33340000
octagonal(33334) = 3333400000
[...]


nonagonal(4) = 46
nonagonal(30) = 3075
nonagonal(287) = 287574
nonagonal(2858) = 28581429
nonagonal(28573) = 2857385719
nonagonal(285715) = 285715000000
nonagonal(2857144) = 28571444285716
nonagonal(28571430) = 2857143071428575
nonagonal(285714287) = 285714287571428574
nonagonal(2857142858) = 28571428581428571429
nonagonal(28571428573) = 2857142857385714285719
nonagonal(285714285715) = 285714285715000000000000
nonagonal(2857142857144) = 28571428571444285714285716
nonagonal(28571428571430) = 2857142857143071428571428575
nonagonal(285714285714287) = 285714285714287571428571428574
nonagonal(2857142857142858) = 28571428571428581428571428571429
nonagonal(28571428571428573) = 2857142857142857385714285714285719
nonagonal(285714285714285715) = 285714285714285715000000000000000000
nonagonal(2857142857142857144) = 28571428571428571444285714285714285716
nonagonal(28571428571428571430) = 2857142857142857143071428571428571428575
[...]


What’s going on with the leading digits of the nonagonals? Well, they’re generating a different reciprocal. Or rather, they’re generating the multiple of a different reciprocal:


1/7 * 2 = 2/7 = 0.285714285714285714285714285714...

And why does 1/7 have this curious connection with the nonagonal numbers? Because the nonagonal formula is k * (7k-5) / 2 = k * ((9-2) * k + (4-pn)) / 2. Now look at the pentadecagonal numbers, where pn = 15:


pentadecagonal(1538461538461538461540) = 15384615384615384615406923076923076923076930

2/13 = 0.153846153846153846153846153846...

pentadecagonal formula = k * (13k - 11) / 2 = k * ((15-2)*k + (4-15)) / 2

Penultimately, let’s look at the icosikaihenagonal numbers, where pn = 21:


icosikaihenagonal(2) = 21
icosikaihenagonal(12) = 1266
icosikaihenagonal(107) = 107856
icosikaihenagonal(1054) = 10544743
icosikaihenagonal(10528) = 1052878960
icosikaihenagonal(105265) = 105265947385
icosikaihenagonal(1052633) = 10526335263165
icosikaihenagonal(10526317) = 1052631731578951
icosikaihenagonal(105263159) = 105263159210526318
icosikaihenagonal(1052631580) = 10526315801578947370
icosikaihenagonal(10526315791) = 1052631579163157894746
icosikaihenagonal(105263157896) = 105263157896368421052636
icosikaihenagonal(1052631578949) = 10526315789497368421052643
icosikaihenagonal(10526315789475) = 1052631578947542105263157900
icosikaihenagonal(105263157894738) = 105263157894738263157894736845
icosikaihenagonal(1052631578947370) = 10526315789473706842105263157905
icosikaihenagonal(10526315789473686) = 1052631578947368689473684210526331
icosikaihenagonal(105263157894736843) = 105263157894736843000000000000000000
icosikaihenagonal(1052631578947368422) = 10526315789473684220526315789473684211
icosikaihenagonal(10526315789473684212) = 1052631578947368421257894736842105263166

2/19 = 0.1052631578947368421052631579

icosikaihenagonal formula = k * (19k - 17) / 2 = k * ((21-2)*k + (4-21)) / 2

And ultimately, let’s look at this other pattern in the leading digits of the triangular numbers, which I can’t yet explain at all:


tri(904) = 409060
tri(6191) = 19167336
tri(98984) = 4898965620
tri(996694) = 496699963165
tri(9989894) = 49898996060565
tri(99966994) = 4996699994681515
tri(999898994) = 499898999601055515
tri(9999669994) = 49996699999451815015
tri(99998989994) = 4999898999960055555015
tri(999996699994) = 499996699999945018150015
tri(9999989899994) = 49999898999996005055550015
tri(99999966999994) = 4999996699999994500181500015
tri(999999898999994) = 499999898999999600500555500015
[...]

Fingering the Frigit

Fingers are fractal. Where a tree has a trunk, branches and twigs, a human being has a torso, arms and fingers. And human beings move in fractal ways. We use our legs to move large distances, then reach out with our arms over smaller distances, then move our fingers over smaller distances still. We’re fractal beings, inside and out, brains and blood-vessels, fingers and toes.

But fingers are fractal are in another way. A digit – digitus in Latin – is literally a finger, because we once counted on our fingers. And digits behave like fractals. If you look at numbers, you’ll see that they contain patterns that echo each other and, in a sense, recur on smaller and smaller scales. The simplest pattern in base 10 is (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). It occurs again and again at almost very point of a number, like a ten-hour clock that starts at zero-hour:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9…
10, 11, 12, 13, 14, 15, 16, 17, 18, 19…
200… 210… 220… 230… 240… 250… 260… 270… 280… 290…

These fractal patterns become visible if you turn numbers into images. Suppose you set up a square with four fixed points on its corners and a fixed point at its centre. Let the five points correspond to the digits (1, 2, 3, 4, 5) of numbers in base 6 (not using 0, to simplify matters):

1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55, 61, 62, 63, 64, 65… 2431, 2432, 2433, 2434, 2435, 2441, 2442, 2443, 2444, 2445, 2451, 2452…

Move between the five points of the square by stepping through the individual digits of the numbers in the sequence. For example, if the number is 2451, the first set of successive digits is (2, 4), so you move to a point half-way between point 2 and point 4. Next come the successive digits (4, 5), so you move to a point half-way between point 4 and point 5. Then come (5, 1), so you move to a point half-way between point 5 and point 1.

When you’ve exhausted the digits (or frigits) of a number, mark the final point you moved to (changing the colour of the pixel if the point has been occupied before). If you follow this procedure using a five-point square, you will create a fractal something like this:
fractal4_1single

fractal4_1
A pentagon without a central point using numbers in a zero-less base 7 looks like this:
fractal5_0single

fractal5_0
A pentagon with a central point looks like this:
fractal5_1single

fractal5_1
Hexagons using a zero-less base 8 look like this:
fractal6_1single

fractal6_1


fractal6_0single

fractal6_0
But the images above are just the beginning. If you use a fixed base while varying the polygon and so on, you can create images like these (here is the program I used):
fractal4


fractal5


fractal6789