The Sumber of the B’s

First a bit of a boredom. Then a bit of beauty. These are the triangular numbers, including 666, the Number of the Beast:

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, …

You can createthem as sumbers, that is, as numbers made by summing the whole numbers:

tri(1) = 1 = 1
tri(2) = 3 = 2+1
tri(3) = 6 = 3+2+1
tri(4) = 10 = 4+3+2+1
tri(5) = 15 = 5+4+3+2+1
tri(6) = 21 = 6+5+4+3+2+1
tri(7) = 28 = 7+6+5+4+3+2+1
tri(8) = 36 = 8+7+6+5+4+3+2+1
tri(9) = 45 = 9+8+7+6+5+4+3+2+1
tri(10) = 55 = 10+9+8+7+6+5+4+3+2+1

And here are the square numbers:

1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401, 2500, …

You can create square numbers in various ways. Most obviously, by multiplying each whole number by itself:

sq(1) = 1*1 = 1
sq(2) = 2*2 = 4
sq(3) = 3*3 = 9
sq(4) = 4*4 = 16
sq(5) = 5*5 = 25
sq(6) = 6*6 = 36
sq(7) = 7*7 = 49
sq(8) = 8*8 = 64
sq(9) = 9*9 = 81
sq(10) = 10*10 = 100

Less obviously, by summing consecutive odd numbers:

sq(1) = 1 = 1
sq(2) = 1+3 = 4
sq(3) = 1+3+5 = 9
sq(4) = 1+3+5+7 = 16
sq(5) = 1+3+5+7+9 = 25
sq(6) = 1+3+5+7+9+11 = 36
sq(7) = 1+3+5+7+9+11+13 = 49
sq(8) = 1+3+5+7+9+11+13+15 = 64
sq(9) = 1+3+5+7+9+11+13+15+17 = 81
sq(10) = 1+3+5+7+9+11+13+15+17+19 = 100

And by summing pairs of consecutive triangular numbers (note that tri(0) = 0):

sq(1) = tri(0) + tri(1) = 0 + 1 = 1
sq(2) = tri(1) + tri(2) = 1 + 3 = 4
sq(3) = tri(2) + tri(3) = 3 + 6 = 9
sq(4) = tri(3) + tri(4) = 6 + 10 = 16
sq(5) = tri(4) + tri(5) = 10 + 15 = 25
sq(6) = tri(5) + tri(6) = 15 + 21 = 36
sq(7) = tri(6) + tri(7) = 21 + 28 = 49
sq(8) = tri(7) + tri(8) = 28 + 36 = 64
sq(9) = tri(8) + tri(9) = 36 + 45 = 81
sq(10) = tri(9) + tri(10) = 45 + 55 = 100

But sometimes squares are the sum of two triangular numbers that aren’t consecutive:

sq(4) = tri(1) + tri(5) = 1+15 = 16
sq(9) = tri(2) + tri(12) = 3+78 = 81
sq(16) = tri(2) + tri(22) = 3+253 = 256
sq(52) = tri(2) + tri(73) = 3+2701 = 2704
sq(14) = tri(3) + tri(19) = 6+190 = 196
sq(21) = tri(3) + tri(29) = 6+435 = 441
sq(44) = tri(9) + tri(61) = 45+1891 = 1936
sq(51) = tri(9) + tri(71) = 45+2556 = 2601
sq(49) = tri(10) + tri(68) = 55+2346 = 2401
sq(56) = tri(10) + tri(78) = 55+3081 = 3136
sq(16) = tri(11) + tri(19) = 66+190 = 256
sq(38) = tri(11) + tri(52) = 66+1378 = 1444
sq(54) = tri(11) + tri(75) = 66+2850 = 2916
sq(87) = tri(47) + tri(113) = 1128+6441 = 7569
sq(77) = tri(48) + tri(97) = 1176+4753 = 5929
sq(121) = tri(64) + tri(158) = 2080+12561 = 14641
sq(141) = tri(96) + tri(174) = 4656+15225 = 19881
sq(121) = tri(100) + tri(138) = 5050+9591 = 14641

Here’s a graph of squares that are the sum of any two triangular numbers, that is, is_square(tri(k1)+tri(k2)). The x axis is 1..k1 and the y axis is 1..k2, so the graph is symmetrical:

tri(k1) + tri(k2) = square(k3)


The (double) line at 45° represents squares that are the sum of consecutive triangulars. Other lines represent similarly regular patterns. Now for a bit of beauty. Things get more visually interesting when you test for squares that are the sums of any integer and a triangular number:

k1 + tri(k2) = square(k3)


The curves are optical oddities: where do they begin and end? The upper ones become lost to the eye in the lower ones. And vice versa. But you can force your eye to trace them further that it wants to.

Now try sums of integers and other polygonal numbers:

k1 + tri(k2) = pentagonal(k3)


k1 + square(k2) = pentagonal(k3)


k1 + pentagonal(k2) = square(k3)


k1 + hexagonal(k2) = pentagonal(k3)


And try other number sequences, like multiples of 4 with polygonals:

k1*4 + pentagonal(k2) = tri(k3)


k1*4 + square(k2) = tri(k3)


k1*4 + heptagonal(k2) = tri(k3)


And primes with polygonals:

tri(k1) + prime(k2) = tri(k3)


prime(k1) + tri(k2) = square(k3)


prime(k1) + octagonal(k2) = square(k3)


prime(k1) + pentagonal(k2) = square(k3)


prime(k1) + square(k2) = decagonal(k3)


prime(k1) + tri(k2) = hendecagonal(k3)


Partitional Pulchritude

If you want a good example of how, in math, something very simple can quickly get very deep, just look at partitions. Here are the partitions of 1 to 5, that is, the ways 1 to 5 can be expressed as a sum of integers smaller than or equal to themselves:

1 = 1

numbpart(1) = 1


2 = 2
1 + 1 = 2

numbpart(2) = 2


3 = 3
1 + 2 = 3
1 + 1 + 1 = 3

numbpart(3) = 3


4 = 4
1 + 3 = 4
2 + 2 = 4
1 + 1 + 2 = 4
1 + 1 + 1 + 1 = 4

numbpart(4) = 5


5 = 5
1 + 4 = 5
2 + 3 = 5
1 + 1 + 3 = 5
1 + 2 + 2 = 5
1 + 1 + 1 + 2 = 5
1 + 1 + 1 + 1 + 1 = 5

numbpart(5) = 7


It’s very easy to understand the concept of partitions, but very difficult to understand how partitions behave. For example, here is numbpart(n), the count of partitions for 1, 2, 3,…

1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604, 6842, 8349, 10143, 12310, 14883, 17977, 21637, 26015, 31185, 37338, 44583, 53174, 63261, 75175, 89134, 105558, 124754, 147273, 173525, 204226, … A000041 at the Online Encyclopedia of Integer Sequences, “a(n) is the number of partitions of n (the partition numbers)”

What’s the formula for numbpart(n)? That’s a tricky question. And what’s the formula for the curves produced by counting the various lengths of partitions(n)? That’s another tricky question, but one thing is easy to see. As n gets bigger, the graph of countlen(partitions(n)) acquires a strange, lopsided beauty. Here are the partitions of 8, with the count of how many partitions of a particular length there are:

8 = 8 (1 partition of length 1)
1 + 7 = 8
2 + 6 = 8
3 + 5 = 8
4 + 4 = 8 (4 partitions of length 2)
1 + 1 + 6 = 8
1 + 2 + 5 = 8
1 + 3 + 4 = 8
2 + 2 + 4 = 8
2 + 3 + 3 = 8 (5 of length 3)
1 + 1 + 1 + 5 = 8
1 + 1 + 2 + 4 = 8
1 + 1 + 3 + 3 = 8
1 + 2 + 2 + 3 = 8
2 + 2 + 2 + 2 = 8 (5 of length 4)
1 + 1 + 1 + 1 + 4 = 8
1 + 1 + 1 + 2 + 3 = 8
1 + 1 + 2 + 2 + 2 = 8 (3 of length 5)
1 + 1 + 1 + 1 + 1 + 3 = 8
1 + 1 + 1 + 1 + 2 + 2 = 8 (2 of length 6)
1 + 1 + 1 + 1 + 1 + 1 + 2 = 8 (1 of length 7)
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8 (1 of length 8)

When counts like that are shown as a graph, the graphs look like this (maximum counts are normalized to the same height):


graph of countlen(partitions(2))



countlen(partitions(3))



countlen(partitions(4))



countlen(partitions(5))



countlen(partitions(6))



countlen(partitions(7))



countlen(partitions(8))



countlen(partitions(9))



countlen(partitions(10))



countlen(partitions(15))



countlen(partitions(20))



countlen(partitions(30))



countlen(partitions(40))



countlen(partitions(50))



countlen(partitions(60))



countlen(partitions(70))



countlen(partitions(80))



countlen(partitions(90))



countlen(partitions(100))



Animated gif of partlen graphs (courtesy EZgif)


The graphs have a long, low right tail because the counts rise to great heights very quick, then fall away again, as you can see with partitions(100):

1 = count(partitions(10),len=1)
50 = count(partitions(10),len=2)
833 = count(partitions(10),len=3)
7153 = count(partitions(10),len=4)
38225 = count(partitions(10),len=5)
143247 = count(partitions(10),len=6)

[…]

10643083 = count(partitions(10),len=16)
11022546 = count(partitions(10),len=17)
11087828 = count(partitions(10),len=18)
10885999 = count(partitions(10),len=19)
10474462 = count(partitions(10),len=20)

[…]

30 = count(partitions(10),len=91)
22 = count(partitions(10),len=92)
15 = count(partitions(10),len=93)
11 = count(partitions(10),len=94)
7 = count(partitions(10),len=95)
5 = count(partitions(10),len=96)
3 = count(partitions(10),len=97)
2 = count(partitions(10),len=98)
1 = count(partitions(10),len=99)
1 = count(partitions(10),len=100)

Summer-Time Hues

sum(4,17) = 147 = 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17
sum(1,20) = 210
sum(19,59) = 1599
sum(22,77) = 2772
sum(20,156) = 12056
sum(34,167) = 13467
sum(23,211) = 22113
sum(79,227) = 22797
sum(84,229) = 22849
sum(61,236) = 26136
sum(199,599) = 159999
sum(203,771) = 277103
sum(222,777) = 277722
sum(266,778) = 267786
sum(277,797) = 279777
sum(145,1520) = 1145520
sum(117,1522) = 1152217
sum(149,1525) = 1152549
sum(167,1527) = 1152767
sum(208,1568) = 1208568
sum(334,1667) = 1334667
sum(540,1836) = 1540836
sum(315,1990) = 1931590
sum(414,2062) = 2041462
sum(418,2063) = 2041863
sum(158,2083) = 2158083
sum(244,2132) = 2244132
sum(554,2139) = 2135549
sum(902,2347) = 2349027
sum(883,2558) = 2883558
sum(989,2637) = 2989637
sum(436,2963) = 4296336
sum(503,3303) = 5330303
sum(626,3586) = 6235866
sum(816,4183) = 8418316
sum(1075,4700) = 10470075
sum(1117,4922) = 11492217
sum(1306,5273) = 13052736
sum(1377,5382) = 13538277
sum(1420,5579) = 14557920
sum(1999,5999) = 15999999
sum(2727,7272) = 22727727
sum(2516,7528) = 25175286
sum(2625,7774) = 26777425
sum(2222,7777) = 27777222
sum(3765,9490) = 37949065
sum(535,10319) = 53103195
sum(1101,14973) = 111497301
sum(2088,15688) = 120885688
sum(3334,16667) = 133346667
sum(2603,19798) = 192603798
sum(3093,19893) = 193093893
sum(1162,20039) = 200116239
sum(1415,20095) = 200914155
sum(1563,20118) = 201156318
sum(2707,20294) = 202270794
sum(2518,20318) = 203251818
sum(2608,20333) = 203326083
sum(2895,20370) = 203289570
sum(3424,20552) = 205342452
sum(4255,20855) = 208425555
sum(4571,20971) = 209457171
sum(4613,21028) = 210461328
sum(4742,21259) = 214742259
sum(6318,21798) = 217631898
sum(6498,21943) = 219649843
sum(7080,22305) = 223708005
sum(7243,22358) = 223724358
sum(6833,22368) = 226833368
sum(7128,22473) = 227128473
sum(4523,22603) = 245232603
sum(4978,22898) = 249782898
sum(8339,23019) = 230183399
sum(8610,23191) = 231861091
sum(6013,23588) = 260133588
sum(9252,23652) = 236925252
sum(6488,23913) = 264883913
sum(8379,25254) = 283795254
sum(4012,28667) = 402866712
sum(4922,31762) = 492317622
sum(4998,31801) = 493180198
sum(5200,32675) = 520326750
sum(7707,40092) = 774009207
sum(7868,40431) = 786404318
sum(9325,44450) = 944450325
sum(11047,48287) = 1104828747
sum(14699,56100) = 1465610099
sum(16235,59860) = 1659860235
sum(19999,59999) = 1599999999
sum(17264,61239) = 1726123964
sum(17405,61605) = 1746160505
sum(18457,63782) = 1863782457
sum(25016,75028) = 2501750286
sum(28022,79942) = 2802799422
sum(37060,93740) = 3706937400
sum(7567,119567) = 7119567567
sum(9638,135513) = 9135513638
sum(15392,152607) = 11526075392
sum(17744,152880) = 11528807744
sum(12012,156387) = 12156387012
sum(20888,156888) = 12088856888
sum(30663,164538) = 13066364538
sum(33334,166667) = 13333466667
sum(36038,168838) = 13603868838

Factory Façades

Practically speaking, I’d never heard of them. Practical numbers, that is. They’re defined like this at the Online Encyclopedia of Integer Sequences:

A005153 Practical numbers: positive integers m such that every k <= sigma(m) is a sum of distinct divisors of m. Also called panarithmic numbers. […] Equivalently, positive integers m such that every number k <= m is a sum of distinct divisors of m. — A005153 at OEIS

In other words, if you take, say, divisors(12) = 1, 2, 3, 4, 6, you can find partial sums of those divisors that equal every number from 1 to 16, where 16 = 1+2+3+4+6. Here are all those sums, with c as the count of divisor-sums equalling a particular k (to simplify things, I’m excluding 12 as a divisor of 12):

1, 2, 3, 4, 6 = divisors(12)

01 = 1 (c=1)
02 = 2 (c=1)
03 = 1 + 2 = 3 (c=2)
04 = 1 + 3 = 4 (c=2)
05 = 2 + 3 = 1 + 4 (c=2)
06 = 1 + 2 + 3 = 2 + 4 = 6 (c=3)
07 = 1 + 2 + 4 = 3 + 4 = 1 + 6 (c=3)
08 = 1 + 3 + 4 = 2 + 6 (c=2)
09 = 2 + 3 + 4 = 1 + 2 + 6 = 3 + 6 (c=3)
10 = 1 + 2 + 3 + 4 = 1 + 3 + 6 = 4 + 6 (c=3)
11 = 2 + 3 + 6 = 1 + 4 + 6 (c=2)
12 = 1 + 2 + 3 + 6 = 2 + 4 + 6 (c=2)
13 = 1 + 2 + 4 + 6 = 3 + 4 + 6 (c=2)
14 = 1 + 3 + 4 + 6 (c=1)
15 = 2 + 3 + 4 + 6 (c=1)
16 = 1 + 2 + 3 + 4 + 6 (c=1)

Learning about practical numbers inspired me to look at the graphs of the count of the divisor-sums for 12. If you include count(0) = 1 (there is one way of choosing divisors of 12 to equal 0, namely, by choosing none of the divisors), the graph looks like this:

counts of divisorsum(12) = k, where 12 = 2^2 * 3 → 1, 2, 3, 4, 6


Here are some more graphs for partialsumcount(n), adjusted for a standardized y-max. They remind me variously of skyscrapers, pyramids, stupas, factories and factory façades, forts bristling with radar antennae, and the Houses of Parliament. All in an art-deco style:

18 = 2 * 3^2 → 1, 2, 3, 6, 9


24 = 2^3 * 3 → 1, 2, 3, 4, 6, 8, 12


30 = 2 * 3 * 5 → 1, 2, 3, 5, 6, 10, 15


36 = 2^2 * 3^2 → 1, 2, 3, 4, 6, 9, 12, 18


48 = 2^4 * 3 → 1, 2, 3, 4, 6, 8, 12, 16, 24


54 = 2 * 3^3 → 1, 2, 3, 6, 9, 18, 27


60 = 2^2 * 3 * 5 → 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30


72 = 2^3 * 3^2 → 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36


88 = 2^3 * 11 → 1, 2, 4, 8, 11, 22, 44, 88


96 = 2^5 * 3 → 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48


100 = 2^2 * 5^2 → 1, 2, 4, 5, 10, 20, 25, 50


108 = 2^2 * 3^3 → 1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54


120 = 2^3 * 3 * 5 → 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60


126 = 2 * 3^2 * 7 → 1, 2, 3, 6, 7, 9, 14, 18, 21, 42, 63


162 = 2 * 3^4 → 1, 2, 3, 6, 9, 18, 27, 54, 81


220 = 2^2 * 5 * 11 → 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110


And what about im-practical numbers, where the partial sums of divisors(m) don’t equal every number 1..sigma(m)? There are interesting fractal patterns to be uncovered there, as you can see from the graph for 190 (because all divsumcount(k) = 1, the graph looks like a bar-code):

190 = 2 * 5 * 19 → 1, 2, 5, 10, 19, 38, 95


Sorted for D’s nand Wizz

As I’ve pre-previously pointed out, there are an infinite number of points in the plane. And in part of the plane. So you have to pare points to create interesting shapes. One way of paring points is by comparing them. After you’ve compared them, you can sort them. For example, you can compare the distance from (x,y) to the four vertices of a square. Then you can sort the distances from nearest to furthest. Then you can mark (x,y) if the distance to, say, the nearest vertice from (x,y) is evenly divisible by 2 when measured in pixels or some other unit. When you do that, you might get an image like this (depending on the hardware and software you use):

Distance to nearest vertex is evenly divisible by 2, i.e. d mod 2 = 0 for v1 (vertices marked in red)


Or you can mark (x,y) if the distance to the nearest vertex is a triangular number:

is_triangular(d) for v1


Or a square number:

is_square(d) for v1


Or you can test the distance to the second-nearest vertex:

d mod 2 = 0 for v2


And the third-nearest (or second-furthest) vertex:

d mod 2 = 0 for v3


And furthest vertex:

d mod 2 = 0 for v4


Now try expanding or contracting the square:

d mod 2 = 0 for v1 on square * 2


d mod 2 = 0 for v1 on square * 3


d mod 2 = 0 for v1 on square * 0.5


d mod 2 = 0 for v1 on square * 1.5


d mod 2 = 0 for v1 on square * 5


d mod 2 = 0 for v1 on square * 20


d mod 2 = 0 for v1 on square * 100


Finally, here are some more mandala-like images created by using various d mod m on an expanded square (the images should be horizontally and vertically mirror-symmetrical, but my software introduced artefacts):

d mod 2 = 0 for v1 on square * 200
(open in separate window for better detail)


d mod 3 = 0 for v1 on square * 200


d mod 4 = 0 for v1 on square * 200


d mod 5 = 0 for v1 on square * 200


d mod 6 = 0 for v1 on square * 200


d mod 7 = 0 for p1 on square * 200


d mod 8 = 0 for p1 on square * 200


d mod 9 = 0 for p1 on square * 200


d mod 2..9 = 0 for p1 on square * 200 (animated at EZgif)


Post-Performative Post-Scriptum…

The title of this incendiary intervention is a paronomasia on “Sorted for E’s and Wizz”, a song offa of 1995 album Different Class by Sheffield Brit-popsters Pulp rebelliously referencing counter-cultural consumption of psychoactive drugs ecstasy and amphetamine. My program sorted distances, i.e. d’s, but not wizz, therefore it sorted d’s and-not wizz. In Boolean logic, nand means “and-not” (roughly speaking).


Previously Pre-Posted (Please Peruse)…

Points Pared — an earlier look at points and polygons

Fertile Fractions

Here’s the simplest possible Egyptian fraction summing to 1:

1 = 1/2 + 1/3 + 1/6 = egypt(2,3,6)

But how many times does 1 = egypt()? Infinitely often, as is very easy to prove. Take this equation:

1/6 – 1/7 = 1/42

For any 1/n, 1/n – 1/(n+1) = 1/(n*(n+1)) = 1/(n^2 + n). In the case of 1/6, the formula means that you can re-write egypt(2,3,6) like this:

1 = egypt(2,3,7,42) = 1/2 + 1/3 + 1/7 + 1/42

Now try these equations:

1/6 – 1/8 = 1/24
1/6 – 1/9 = 1/18
1/6 – 1/10 = 1/15

Which lead to these re-writes of egypt(2,3,6):

1 = egypt(2,3,8,24)
1 = egypt(2,3,9,18)
1 = egypt(2,3,10,15)

Alternatively, you can expand the 1/3 of egypt(2,3,6):

1/3 – 1/4 = 1/12

Therefore:

1 = egypt(2,4,6,12)

And the 1/12 opens all these possibilities:

1/12 – 1/13 = 1/156 → 1 = egypt(2,4,6,13,156)
1/12 – 1/14 = 1/84 → 1 = egypt(2,4,6,14,84)
1/12 – 1/15 = 1/60 → 1 = egypt(2,4,6,15,60)
1/12 – 1/16 = 1/48 → 1 = egypt(2,4,6,16,48)
1/12 – 1/18 = 1/36 → 1 = egypt(2,4,6,18,36)
1/12 – 1/20 = 1/30 → 1 = egypt(2,4,6,20,30)
1/12 – 1/21 = 1/28 → 1 = egypt(2,4,6,21,28)

So you can expand an Egyptian fraction for ever. If you stick to expanding the 1/6 to 1/7 + 1/42, then the 1/42 to 1/43 + 1/1806 and so on, you get this:

1 = egypt(2,3,6)
1 = egypt(2,3,7,42)
1 = egypt(2,3,7,43,1806)
1 = egypt(2,3,7,43,1807,3263442)
1 = egypt(2,3,7,43,1807,3263443,10650056950806)
1 = egypt(2,3,7,43,1807,3263443,10650056950807,113423713055421844361000442)
1 = egypt(2,3,7,43,1807,3263443,10650056950807,113423713055421844361000443,12864938683278671740537145998360961546653259485195806)
1 = egypt(2,3,7,43,1807,3263443,10650056950807,113423713055421844361000443,12864938683278671740537145998360961546653259485195807,165506647324519964198468195444439180017513152706377497841851388766535868639572406808911988131737645185442)
[…]


Elsewhere Other-Accessible…

A000058, Sylvester’s Sequence, at the Online Encyclopedia of Integer Sequences, with more details on the numbers above

Feral Fractions

“The uniquely unrepresentative ‘Egyptian’ fraction.” That’s what David Wells calls 2/3 = 0·666… in The Penguin Dictionary of Curious and Interesting Numbers (1986). Why unrepresentative”? Wells goes on to explain: “the Egyptians used only unit fractions, with this one exception. All other fractional quantities were expressed as sums of unit fractions.”

A unit fraction is 1 divided by a higher integer: 1/2, 1/3, 1/4, 1/5 and so on. Modern mathematicians are interested in those sums of unit fractions that produce integers, like this:

1 = 1/2 + 1/3 + 1/6 = egypt(2,3,6)
1 = 1/2 + 1/4 + 1/6 + 1/12 = egypt(2,4,6,12)
1 = 1/2 + 1/3 + 1/10 + 1/15 = = egypt(2,3,10,15)
1 = egypt(2,4,10,12,15)
1 = egypt(3,4,6,10,12,15)
1 = egypt(2,3,9,18)
1 = egypt(2,4,9,12,18)
1 = egypt(3,4,6,9,12,18)
1 = egypt(2,6,9,10,15,18)
1 = egypt(3,4,9,10,12,15,18)
1 = egypt(2,4,5,20)
1 = egypt(3,4,5,6,20)
1 = egypt(2,5,6,12,20)
1 = egypt(3,4,5,10,15,20)
1 = egypt(2,5,10,12,15,20)
1 = egypt(3,5,6,10,12,15,20)
1 = egypt(3,4,5,9,18,20)
1 = egypt(2,5,9,12,18,20)
1 = egypt(3,5,6,9,12,18,20)
1 = egypt(4,5,6,9,10,15,18,20)

2 = egypt(2,3,4,5,6,8,9,10,15,18,20,24)
2 = 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/8 + 1/9 + 1/10 + 1/15 + 1/18 + 1/20 + 1/24


Sums-to-integers like those are called Egyptian fractions, for short. I looked for some such sums that included 1/666:

1 = egypt(2,3,7,63,222,518,666)
1 = egypt(2,3,8,36,111,296,666)
1 = egypt(2,3,9,20,444,555,666)
1 = egypt(2,3,9,21,222,518,666)
1 = egypt(2,3,9,24,111,296,666)
1 = egypt(2,3,9,26,74,481,666)
1 = egypt(2,4,8,9,111,296,666)


And I looked for Egyptian fractions whose denominators summed to rep-digits like 111 and 666 (denominators are the bit below the stroke of 1/3 or 2/3, where the bit above is called the numerator):

1 = egypt(4,6,7,9,10,14,15,18,28)
111 = 4+6+7+9+10+14+15+18+28


1 = egypt(3,6,8,9,10,15,21,24,126)
222 = 3+6+8+9+10+15+21+24+126


1 = egypt(2,6,8,12,16,17,272)
333 = 2+6+8+12+16+17+272


1 = egypt(2,4,9,11,22,396)
444 = 2+4+9+11+22+396


1 = egypt(5,6,9,10,11,12,15,20,21,22,28,396)
555 = 5+6+9+10+11+12+15+20+21+22+28+396


1 = egypt(2,6,8,10,15,25,600)
666 = 2+6+8+10+15+25+600


1 = egypt(4,5,8,12,14,18,20,21,24,26,28,819)
999 = 4+5+8+12+14+18+20+21+24+26+28+819


Alas, Egyptian fractions like those are attractive but trivial. This isn’t trivial, though:

Prof Greg Martin of the University of British Columbia has found a remarkable Egyptian fraction for 1 with 454 denominators all less than 1000.

1 = egypt(97, 103, 109, 113, 127, 131, 137, 190, 192, 194, 195, 196, 198, 200, 203, 204, 205, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 225, 228, 230, 231, 234, 235, 238, 240, 244, 245, 248, 252, 253, 254, 255, 256, 259, 264, 265, 266, 267, 268, 272, 273, 274, 275, 279, 280, 282, 284, 285, 286, 287, 290, 291, 294, 295, 296, 299, 300, 301, 303, 304, 306, 308, 309, 312, 315, 319, 320, 321, 322, 323, 327, 328, 329, 330, 332, 333, 335, 338, 339, 341, 342, 344, 345, 348, 351, 352, 354, 357, 360, 363, 364, 365, 366, 369, 370, 371, 372, 374, 376, 377, 378, 380, 385, 387, 390, 391, 392, 395, 396, 399, 402, 403, 404, 405, 406, 408, 410, 411, 412, 414, 415, 416, 418, 420, 423, 424, 425, 426, 427, 428, 429, 430, 432, 434, 435, 437, 438, 440, 442, 445, 448, 450, 451, 452, 455, 456, 459, 460, 462, 464, 465, 468, 469, 470, 472, 473, 474, 475, 476, 477, 480, 481, 483, 484, 485, 486, 488, 490, 492, 493, 494, 495, 496, 497, 498, 504, 505, 506, 507, 508, 510, 511, 513, 515, 516, 517, 520, 522, 524, 525, 527, 528, 530, 531, 532, 533, 536, 539, 540, 546, 548, 549, 550, 551, 552, 553, 555, 558, 559, 560, 561, 564, 567, 568, 570, 572, 574, 575, 576, 580, 581, 582, 583, 584, 585, 588, 589, 590, 594, 595, 598, 603, 605, 608, 609, 610, 611, 612, 616, 618, 620, 621, 623, 624, 627, 630, 635, 636, 637, 638, 640, 642, 644, 645, 646, 648, 649, 650, 651, 654, 657, 658, 660, 663, 664, 665, 666, 667, 670, 671, 672, 675, 676, 678, 679, 680, 682, 684, 685, 688, 689, 690, 693, 696, 700, 702, 703, 704, 705, 707, 708, 710, 711, 712, 713, 714, 715, 720, 725, 726, 728, 730, 731, 735, 736, 740, 741, 742, 744, 748, 752, 754, 756, 759, 760, 762, 763, 765, 767, 768, 770, 774, 775, 776, 777, 780, 781, 782, 783, 784, 786, 790, 791, 792, 793, 798, 799, 800, 804, 805, 806, 808, 810, 812, 814, 816, 817, 819, 824, 825, 826, 828, 830, 832, 833, 836, 837, 840, 847, 848, 850, 851, 852, 854, 855, 856, 858, 860, 864, 868, 869, 870, 871, 872, 873, 874, 876, 880, 882, 884, 888, 890, 891, 893, 896, 897, 899, 900, 901, 903, 904, 909, 910, 912, 913, 915, 917, 918, 920, 923, 924, 925, 928, 930, 931, 935, 936, 938, 940, 944, 945, 946, 948, 949, 950, 952, 954, 957, 960, 962, 963, 966, 968, 969, 972, 975, 976, 979, 980, 981, 986, 987, 988, 989, 990, 992, 994, 996, 999) — "Egyptian Fractions" by Ron Knott at Surrey University


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