Color-Coded ContFracs

Continued fractions are cool… Too cool for school. Or too cool for my school, at least. Because I never learnt about them there. Now that I have learnt about them, they’ve helped me wade a little further into the immeasurable Mare Mathematicum. Or Mare Matris Mathematicæ. I’m almost ankle-deep now, rather than just toe-deep. (I wish.)

But apart from aiding my understanding, continued fractions have always enhanced my entertainment. I can use them to find pretty but (probably) puny patterns like these:


[3,1,2] = contfrac(3/12) in base 9 = contfrac(3/11) in base 10
4,1,34/13 in b16 = 4/19
5,1,45/14 in b25 = 5/29
6,1,56/15 in b36 = 6/41
7,1,67/16 in b49 = 7/55
8,1,78/17 in b64 = 8/71
9,1,89/18 in b81 = 9/89
A,1,9A/19 in b100 = 10/109 → 10,1,9
B,1,AB/1A in b121 = 11/131 → 11,1,10
C,1,BC/1B in b144 = 12/155 → 12,1,11


Those patterns with square numbers carry on for ever, I assume. I also assume that the similar patterns below do too, though I’m not sure if every base contains an infinite number of them. Maybe some bases don’t contain any at all. I haven’t found any in base 10 so far:


[25,2] = contfrac(2/52) in base 9 = contfrac(2/47) in base 10 = [23,2]
42,1,34/213 in b8 = 4/139 → 34,1,3
4,1,2,3,341/233 in b8 = 33/155
24,1,3,1,224/1312 in b5 = 14/207 → 14,1,3,1,2
1,17,1,2,3117/123 in b14 = 217/227 → 1,21,1,2,3
320,1,23/2012 in b5 = 3/257 → 85,1,2
254,22/542 in b7 = 2/275 → 137,2
3A,33/A3 in b28 = 3/283 → 94,3
3,5,A,235/A2 in b34 = 107/342 → 3,5,10,2
12,1,5,312/153 in b17 = 19/377 → 19,1,5,3
12,1,5,312/153 in b17 = 19/377 → 19,1,5,3
3,1,4,1,4,1,5314/1415 in b8 = 204/781
2,1,36,3,2213/632 in b12 = 303/902 → 2,1,42,3,2
3,2,11,2,2,2321/1222 in b9 = 262/911 → 3,2,10,2,2,2
41,2,1,1,641/2116 in b8 = 33/1102 → 33,2,1,1,6
4H,44/H4 in b65 = 4/1109 → 277,4
249,22/492 in b17 = 2/1311 → 655,2
6,2,1,3,J62/13J in b35 = 212/1349 → 6,2,1,3,19
8,3,3,1,D83/31D in b22 = 179/1487 → 8,3,3,1,13
142,1,1,614/2116 in b9 = 13/1554 → 119,1,1,6
10,1,111,1,1,21011/11112 in b6 = 223/1556 → 6,1,43,1,1,2
204,1,1720/4117 in b8 = 16/2127 → 132,1,15
93,1,89/318 in b27 = 9/2222 → 246,1,8
1,3A,1,1,4,2,213A1/1422 in b12 = 2281/2330 → 1,46,1,1,4,2,2
4340,1,34/34013 in b5 = 4/2383 → 595,1,3
13,1,7,613/176 in b46 = 49/2444 → 49,1,7,6
C7,1,BC/71B in b21 = 12/3119 → 259,1,11
35,3,2,3,1,1,2353/23112 in b6 = 141/3284 → 23,3,2,3,1,1,2
1,2,2,1,O,F122/1OF in b50 = 2602/3715 → 1,2,2,1,24,15
2,1,1,5,55211/555 in b28 = 1597/4065 → 2,1,1,5,145
1P,2,H,21P/2H2 in b47 = 72/5219 → 72,2,17,2
50,14,1,1,1,5501/41115 in b6 = 181/5447 → 30,10,1,1,1,5
5450,1,45/45014 in b6 = 5/6274 → 1254,1,4
3103,1,23/10312 in b9 = 3/6815 → 2271,1,2
4B,1,2,2,C4B/122C in b19 = 87/7631 → 87,1,2,2,12
3G,D,2,33G/D23 in b26 = 94/8843 → 94,13,2,3
3,1,1,A,K,6311/AK6 in b29 = 2553/8996 → 3,1,1,10,20,6
1,2[70],1,3,912[70]/139 in b98 = 9870/9907 → 1,266,1,3,9
14,1,9,A14/19A in b97 = 101/10292 → 101,1,9,10
14,1,9,A14/19A in b97 = 101/10292 → 101,1,9,10
4133,1,14,241/331142 in b5 = 21/11422 → 543,1,9,2
1,E,4,1,M,71E4/1M7 in b100 = 11404/12207 → 1,14,4,1,22,7
LG,5,4L/G54 in b28 = 21/12688 → 604,5,4

Mathematicoynte

Pre-previously, I looked at a fractal phallus. Now I want to look at a fractal fanny (in the older British sense). In fact, it’s a fractional fractal fanny. Take a look at these fractions:


1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 2/10, 2/9, 1/4, 2/8, 2/7, 3/10, 1/3, 2/6, 3/9, 3/8, 2/5, 4/10, 3/7, 4/9, 1/2, 2/4, 3/6, 4/8, 5/10, 5/9, 4/7, 3/5, 6/10, 5/8, 2/3, 4/6, 6/9, 7/10, 5/7, 3/4, 6/8, 7/9, 4/5, 8/10, 5/6, 6/7, 7/8, 8/9, 9/10

They’re all the fractions for 1/2..(n-1)/n, n = 10, sorted by increasing size. But obviously some of them are the same: 1/2 = 2/4 = 3/6 = 5/10, 1/3 = 2/6 = 3/9, 1/4 = 2/8, and so on. If you remove the duplicates, you get this set of reduced fractions:


1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 2/9, 1/4, 2/7, 3/10, 1/3, 3/8, 2/5, 3/7, 4/9, 1/2, 5/9, 4/7, 3/5, 5/8, 2/3, 7/10, 5/7, 3/4, 7/9, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10

Now here are the reduced fractions for 1/2..(n-1)/n, n = 30:


1/30, 1/29, 1/28, 1/27, 1/26, 1/25, 1/24, 1/23, 1/22, 1/21, 1/20, 1/19, 1/18, 1/17, 1/16, 1/15, 2/29, 1/14, 2/27, 1/13, 2/25, 1/12, 2/23, 1/11, 2/21, 1/10, 3/29, 2/19, 3/28, 1/9, 3/26, 2/17, 3/25, 1/8, 3/23, 2/15, 3/22, 4/29, 1/7, 4/27, 3/20, 2/13, 3/19, 4/25, 1/6, 5/29, 4/23, 3/17, 5/28, 2/11, 5/27, 3/16, 4/21, 5/26, 1/5, 6/29, 5/24, 4/19, 3/14, 5/23, 2/9, 5/22, 3/13, 7/30, 4/17, 5/21, 6/25, 7/29, 1/4, 7/27, 6/23, 5/19, 4/15, 7/26, 3/11, 8/29, 5/18, 7/25, 2/7, 7/24, 5/17, 8/27, 3/10, 7/23, 4/13, 9/29, 5/16, 6/19, 7/22, 8/25, 9/28, 1/3, 10/29, 9/26, 8/23, 7/20, 6/17, 5/14, 9/25, 4/11, 11/30, 7/19, 10/27, 3/8, 11/29, 8/21, 5/13, 7/18, 9/23, 11/28, 2/5, 11/27, 9/22, 7/17, 12/29, 5/12, 8/19, 11/26, 3/7, 13/30, 10/23, 7/16, 11/25, 4/9, 13/29, 9/20, 5/11, 11/24, 6/13, 13/28, 7/15, 8/17, 9/19, 10/21, 11/23, 12/25, 13/27, 14/29, 1/2, 15/29, 14/27, 13/25, 12/23, 11/21, 10/19, 9/17, 8/15, 15/28, 7/13, 13/24, 6/11, 11/20, 16/29, 5/9, 14/25, 9/16, 13/23, 17/30, 4/7, 15/26, 11/19, 7/12, 17/29, 10/17, 13/22, 16/27, 3/5, 17/28, 14/23, 11/18, 8/13, 13/21, 18/29, 5/8, 17/27, 12/19, 19/30, 7/11, 16/25, 9/14, 11/17, 13/20, 15/23, 17/26, 19/29, 2/3, 19/28, 17/25, 15/22, 13/19, 11/16, 20/29, 9/13, 16/23, 7/10, 19/27, 12/17, 17/24, 5/7, 18/25, 13/18, 21/29, 8/11, 19/26, 11/15, 14/19, 17/23, 20/27, 3/4, 22/29, 19/25, 16/21, 13/17, 23/30, 10/13, 17/22, 7/9, 18/23, 11/14, 15/19, 19/24, 23/29, 4/5, 21/26, 17/21, 13/16, 22/27, 9/11, 23/28, 14/17, 19/23, 24/29, 5/6, 21/25, 16/19, 11/13, 17/20, 23/27, 6/7, 25/29, 19/22, 13/15, 20/23, 7/8, 22/25, 15/17, 23/26, 8/9, 25/28, 17/19, 26/29, 9/10, 19/21, 10/11, 21/23, 11/12, 23/25, 12/13, 25/27, 13/14, 27/29, 14/15, 15/16, 16/17, 17/18, 18/19, 19/20, 20/21, 21/22, 22/23, 23/24, 24/25, 25/26, 26/27, 27/28, 28/29, 29/30

Can you see the fractal fanny? Not unless you’re superhuman. But any normal human can see the fractal fanny when you turn those reduced and sorted fractions, a/b, into a graph, where y = b and x = n for a/bn:

graph for b of reduced a/b = 1/2..29/30, sorted by size of a/b

(click for larger)


If you don’t reduce the fractions, you get this distorted coynte:

graph for b of all fractions 1/2..29/30, sorted by a/b


And you can use other variables for y, like the sum of the continued fraction of a/b:

graph for sum(contfrac(a/b)) of reduced fractions 1/2..29/30, sorted by a/b


graph for cfsum of all fractions 1/2..29/30, sorted by a/b


And the product of the continued fraction of a/b:

graph for prod(contfrac(a/b)) of reduced fractions 1/2..29/30, sorted by a/b


graph for cfmul of all fractions 1/2..29/30, sorted by a/b


And you can sort by the size of other variables, like the number of factors of b:

graph for a+b of all fractions 1/2..29/30, sorted by factornum(b)


And so on:

graph for a of reduced fractions 1/2..29/30, sorted by a/b


graph for a of reduced fractions 1/2..29/30, sorted by a/b


graph for a of all fractions 1/2..29/30, sorted by a/b


graph for a of all fractions 1/2..29/30, sorted by length(contfrac(a/b))


graph for a of all fractions 1/2..29/30, sorted by factornum(b)


graph for a of all fractions 1/2..29/30, sorted by gcd(a/b)


graph for a+b of all fractions 1/2..29/30, sorted by a/b


graph for a+b of reduced fractions 1/2..29/30, sorted by a/b


graph for a+b of all fractions 1/2..29/30, sorted by a+b


graph for a+b of all fractions 1/2..29/30, sorted by cflen(a/b)


graph for a+b of all fractions 1/2..29/30, sorted by gbd(a,b)


graph for b of all fractions 1/2..29/30, sorted by a+b


graph for b of all fractions 1/2..29/30, sorted by cflen(a/b)


graph for b of all fractions 1/2..29/30, sorted by factnum(b)


graph for b of all fractions 1/2..29/30, sorted by gcd(a,b)


graph for b-a of all fractions 1/2..29/30, sorted by a/b


graph for b-a of reduced fractions 1/2..29/30, sorted by a/b


graph for b-a of all fractions 1/2..29/30, sorted by a+b


graph for b-a of all fractions 1/2..29/30, sorted by factnum(b)


graph for cfmul of all fractions 1/2..29/30, sorted by a


graph for cfsum of all fractions 1/2..29/30, sorted by a


Previously Pre-Posted (Please Peruse)

Phrallic Frolics — a look at fractal phalluses, a.k.a. phralluses

The Call of CFulhu

“The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents.” So said HPL in “The Call of Cthulhu” (1926). But I’d still like to correlate the contents of mine a bit better. For example, I knew that φ, the golden ratio, is the most irrational of all numbers, in that it is the slowest to be approximated with rational fractions. And I also knew that continued fractions, or CFs, were a way of representing both rationals and irrationals as a string of numbers, like this:

contfrac(10/7) = [1; 2, 3]
10/7 = 1 + 1/(2 + 1/3)
10/7 = 1.428571428571…

contfrac(3/5) = [0; 1, 1, 2]
4/5 = 0 + 1/(1 + 1/(1 + 1/2))
4/5 = 0.8

contfrac(11/8) = [1; 2, 1, 2]
11/8 = 1 + 1/(2 + 1/(1 + 1/2))
11/8 = 1.375

contfrac(4/7) = [0; 1, 1, 3]
4/7 = 0 + 1/(1 + 1/(1 + 1/3))
4/7 = 0.57142857142…

contfrac(17/19) = [0; 1, 8, 2]
17/19 = 0 + 1/(1 + 1/(8 + 1/2))
17/19 = 0.8947368421052…

contfrac(8/25) = [0; 3, 8]
8/25 = 0 + 1/(3 + 1/8)
8/25 = 0.32

contfrac(√2) = [1; 2, 2, 2, 2, 2, 2, 2…] = [1; 2]

√2 = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/2 + …))))))

√2 = 1.41421356237309504…

contfrac(φ) = [1; 1, 1, 1, 1, 1, 1, 1, 1…]

φ = 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/1 + …)))))))

φ = 1.6180339887498948…


But I didn’t correlate those two contents of my mind: the maximal irrationality of φ and the way continued fractions work.

That’s why I was surprised when I was looking at the continued fractions of 2..(n-1) / n for 3,4,5,6,7… That is, I was looking at the continued fractions of 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… (skipping fractions like 2/4, 2/6, 3/6 etc, because they’re reducible: 2/4 = ½, 2/6 = 1/3, 3/6 = ½ etc). I wondered which fractions set successive records for the length of their continued fractions as one worked through ½, 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… And because I hadn’t correlated the contents of my mind, I was surprised at the result. I shouldn’t have been, of course:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/3) = [0; 1, 2] (cfl=2)
2/3 = 0 + 1/(1 + 1/2)
2/3 = 0.666666666…

contfrac(3/5) = [0; 1, 1, 2] (cfl=3)
3/5 = 0 + 1/(1 + 1/(1 + 1/2))
3/5 = 0.6

contfrac(5/8) = [0; 1, 1, 1, 2] (cfl=4)
5/8 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/2)))
5/8 = 0.625

contfrac(8/13) = [0; 1, 1, 1, 1, 2] (cfl=5)
8/13 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/13 = 0.615384615…

contfrac(13/21) = [0; 1, 1, 1, 1, 1, 2] (cfl=6)
13/21 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2)))))
13/21 = 0.619047619…

contfrac(21/34) = [0; 1, 1, 1, 1, 1, 1, 2] (cfl=7)
21/34 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/34 = 0.617647059…

contfrac(34/55) = [0; 1, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/89) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/144) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/233) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/377) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/610) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/987) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/1597) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/2584) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/4181) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
contfrac(4181/6765) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=18)
[…]


Which n1/n2 set records for the length of their continued fractions (with n2 > n1)? It’s the successive Fibonacci fractions, fib(i)/fib(i+1), of course. I didn’t anticipate that answer because I didn’t understand φ and continued fractions properly. And I still don’t, because I’ve been surprised again today looking at palindromic CFs like these:

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(3/10) = [0; 3, 3] (cfl=2)
3/10 = 0 + 1/(3 + 1/3)
3/10 = 0.3

contfrac(5/12) = [0; 2, 2, 2] (cfl=3)
5/12 = 0 + 1/(2 + 1/(2 + 1/2))
5/12 = 0.416666666…

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(4/15) = [0; 3, 1, 3] (cfl=3)
4/15 = 0 + 1/(3 + 1/(1 + 1/3))
4/15 = 0.266666666…

contfrac(7/16) = [0; 2, 3, 2] (cfl=3)
7/16 = 0 + 1/(2 + 1/(3 + 1/2))
7/16 = 0.4375

contfrac(4/17) = [0; 4, 4] (cfl=2)
4/17 = 0 + 1/(4 + 1/4)
4/17 = 0.235294117…


Again, I wondered which of these fractions set successive records for the length of their palindromic continued fractions. Here’s the answer:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(8/21) = [0; 2, 1, 1, 1, 2] (cfl=5)
8/21 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/21 = 0.380952380…

contfrac(13/34) = [0; 2, 1, 1, 1, 1, 2] (cfl=6)
13/34 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(
1
+ 1/(1 + 1/2)))))
13/34 = 0.382352941..

contfrac(21/55) = [0; 2, 1, 1, 1, 1, 1, 2] (cfl=7)
21/55 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/55 = 0.381818181…

contfrac(34/89) = [0; 2, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/144) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/233) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/377) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/610) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/987) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/1597) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/2584) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/4181) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/6765) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
[…]


Now it’s the successive Fibonacci skip-one fractions, fib(i)/fib(i+2), that set records for the length of their palindromic continued fractions. But I think you’d have to be very good at maths not to be surprised by that result.

After that, I continued to be compelled by the Call of CFulhu and started to look at the CFs of Fibonacci skip-n fractions in general. That’s contfrac(fib(i)/fib(i+n)) for n = 1,2,3,… And I’ve found more interesting patterns, as I’ll describe in a follow-up post.

Message from Mater

As any recreational mathematician kno, the Ulam spiral shows the prime numbers on a spiral grid of integers. Here’s a Ulam spiral with 1 represented in blue and 2, 3, 5, 7… as white blocks spiralling anti-clockwise from the right of 1:

The Ulam spiral of prime numbers


Ulam spiral at higher resolution


I like the Ulam spiral and whenever I’m looking at new number sequences I like to Ulamize it, that is, display it on a spiral grid of integers. Sometimes the result looks good, sometimes it doesn’t. But I’ve always wondered something beforehand: will this be the spiral where I see a message appear? That is, will I see a message from Mater Mathematica, Mother Maths, the omniregnant goddess of mathematics? Is there an image or text embedded in some obscure number sequence, revealed when the sequence is Ulamized and proving that there’s divine intelligence and design behind the universe? Maybe the image of a pantocratic cat will appear. Or a text in Latin or Sanskrit or some other suitably century-sanctified language.

That’s what I wonder. I don’t wonder it seriously, of course, but I do wonder it. But until 22nd March 2025 I’d never seen any Ulam-ish spiral that looked remotely like a message. But 22nd May is the day I Ulamed some continued fractions. And I saw something that did look a little like a message. Like text, that is. But I might need to explain continued fractions first. What are they? They’re a fascinating and beautiful way of representing both rational and irrational numbers. The continued fractions for rational numbers look like this in expanded and compact format:

5/3 = 1 + 1/(1 + ½) = 1 + ⅔
5/3 = [1; 1, 2]

19/7 = 2 + 1/(1 + 1/(2 + ½)) = 2 + 4/7
19/7 = [2; 1, 2, 2]

2/3 = 0 + 1/(1 + 1/2)
2/3 = [0; 1, 2] (compare 5/3 above)

3/5 = 0 + 1/(1 + 1/(1 + 1/2))
3/5 = [0; 1, 1, 2]

5/7 = 0 + 1/(1 + 1/(2 + 1/2))
5/7 = [0; 1, 2, 2] (compare 19/7 above)

13/17 = 0 + 1/(1 + 1/(3 + 1/4))
13/17 = [0; 1, 3, 4]

30/67 = 0 + 1/(2 + 1/(4 + 1/(3 + ½)))
30/67 = [0; 2, 4, 3, 2]

The continued fractions of irrational numbers are different. Most importantly, they never end. For example, here are the infinite continued fractions for φ, √2 and π in expanded and compact format:

φ = 1 + (1/(1 + 1/(1 + 1/(1 + …)))φ = [1; 1]

√2 = 1 + (1/(2 + 1/(2 + 1/(2 + …)))
√2 = [1; 2]

π = 3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + 1/(1 + 1/(1 + 1/(1 + 1/(2 + 1/(1 + 1/(3 +…))))))))))
π = [3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3…]

As you can see, the continued fraction of π doesn’t fall into a predictable pattern like those for φ and √2. But I’ve already gone into continued fractions further than I need for this post, so let’s return to the continued fractions of rationals. I set up an Ulam spiral to show patterns based on the continued fractions for 1/1, ½, ⅓, ⅔, 1/4, 2/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 2/6, 3/6… (where the fractions are assigned to 1,2,3… and 2/4 = ½, 2/6 = ⅓ etc). For example, if the continued fraction contains a number higher than 5, you get this spiral:

Spiral for continued fractions containing at least number > 5


With tests for higher and higher numbers in the continued fractions, the spirals start to thin and apparent symbols start to appear in the arms of the spirals:

Spiral for contfrac > 10


Spiral for contfrac > 15


Spiral for contfrac > 20


Spiral for contfrac > 25


Spiral for contfrac > 30


Spiral for contfrac > 35


Spiral for contfrac > 40


Spirals for contfrac > 5..40 (animated at EZgif)


Here are some more of these spirals at increasing magnification:

Spiral for contfrac > 23 (#1)


Spiral for contfrac > 23 (#2)


Spiral for contfrac > 23 (#3)


Spiral for contfrac > 13


Spiral for contfrac > 15 (off-center)


Spiral for contfrac > 23 (off-center)


And here are some of the symbols picked out in blue:

Spiral for contfrac > 15 (blue symbols)


Spiral for contfrac > 23 (blue symbols)


But they’re not really symbols, of course. They’re quasi-symbols, artefacts of the Ulamization of a simple test on continued fractions. Still, they’re the closest I’ve got so far to a message from Mater Mathematica.