Fract-L Geometry

Suppose you set up an L, i.e. a vertical and horizontal line, representing the x,y coordinates between 0 and 1. Next, find the fractional pairs x = 1/2, 1/3, 2/3, 1/4, 2/4…, y = 1/2, 1/3, 2/3, 1/4, 2/4… and mark the point (x,y). That is, find the point, say, 1/5 of the way along the x-line, then the points 1/5, 2/5, 3/5 and 4/5 along the y-line, marking the points (1/5, 1/5), (1/5, 2/5), (1/5, 3/5), (1/5, 4/5). Then find (2/5, 1/5), (2/5, 2/5), (2/5, 3/5), (2/5, 4/5) and so on. Some interesting patterns appear in what I call a Frac-L (pronounced “frackle”) or Fract-L:

Frac-L for 1/2 to 21/22


Frac-L for 1/2 to 48/49


Frac-L for 1/2 to 75/76


Frac-L for 1/2 to 102/103


Frac-L for 1/2 to 102/103 (animated)


If the (x,y) point is first red, then becomes different colors as it is repeatedly found, you get these patterns:

Frac-L for 1/2 to 48/49 (color)


Frac-L for 1/2 to 75/79 (color)


Frac-L for 1/2 to 102/103 (color) (animated)


Now try polygonal numbers. The triangular numbers are 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78…, so you’re finding the fractional pairs, say, (1/21, 1/21), (1/21, 3/21, (1/21, 6/21), (1/21, 10/21), (1/21, 15/21), then (3/21, 1/21), (3/21, 3/21, (3/21, 6/21), (3/21, 10/21), (3/21, 15/21), and so on:

Frac-L for triangular fractions


The frac-L for square numbers (1, 4, 9, 16, 25, 36, 49, 64, 81, 100…) is almost identical:

Frac-L for square fractions, e.g. (1/16, 1/16), (1/16, 4/16), (1/16, 9/16)…


So is the frac-L for pentagonal numbers (1, 5, 12, 22, 35, 51, 70, 92, 117, 145, 176, 210, 247, 287, 330…):

Frac-L for pentagonal fractions, e.g. (1/35, 5/35), (1/35, 12/35), (1/35,22/35)…


Here are frac-Ls for tetrahedral and square-pyramidal numbers:

Frac-L for tetrahedral fractions


Frac-L for square pyramidal fractions


But what about prime numbers (skipping 2)? Here the fractional pairs are, say, (1/17, 1/17), (1/17, 3/17), (1/17, 5/17), (1/17, 7/17), (1/17, 11/17), (1/17, 13/17), then (3/17, 1/17), (3/17, 3/17), (3/17, 5/17), (3/17, 7/17), (3/17, 11/17), (3/17, 13/17), and so on:

Frac-L for 1/3 to 73/79 (prime fractions)


Frac-L for 1/3 to 223/227


Frac-L for 1/3 to 307/331


Frac-L for 1/3 to 307/331 (animated)


Frac-L for 1/3 to 73/79 (color) (prime fractions)


Frac-L for 1/3 to 223/227 (color)


Frac-L for 1/3 to 307/331 (color)


Frac-L for 1/3 to 307/331 (color) (animated)


And finally (for now), a frac-L for Fibonnaci numbers, where the fractional pairs are, say, (1/13, /13), (1/13, 2/13), (1/13, 3/13), (1/13, 5/13), (1/13, 8/13), then (2/13, /13), (2/13, 2/13), (2/13, 3/13), (2/13, 5/13), (2/13, 8/13), and so on:

Frac-L for Fibonacci fractions to 14930352/2178309 = fibonacci(36)/fibonacci(37)


Spiral Artefact #2

Why stop at primes? Those are the numbers the Ulam spiral is usually used for. You get a grid of square blocks, then move outward from the middle of the grid in a spiral, counting as you go. If the count matches a prime, you fill the block in. The first block is 1. Not filled. The second block is 2, which is prime. So the block is filled. The third block is 3, which is prime. Filled again. And so on. In the end, the Ulam spiral for primes looks like this:

The Ulam spiral of prime numbers


But why stop at primes? If you change the fill-test, you get different patterns. I’ve recently tried a test based on how many ways a number can be represented as the sum of consecutive integers. For example, 5, 208 and 536 can be represented in only one way:

5 = 2+3
208 = 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22
536 = sum(26..41) = 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41


Let’s use “runsum” to mean a sum of consecutive integers. If the function runsum(n) returns the count of runsums for n, then runsum(5) = runsum(208) = runsum(536) = 1. Here are spirals for runsum(n) = 1:

A spiral for runsum(n) = 1, i.e. numbers that are the sum of consecutive integers in only one way


runsum(n) = 1 (higher resolution)


runsum(n) = 1 (higher resolution still)


Now try runsum(n) = 2, i.e. numbers that are the sum of consecutive integers in exactly two ways:

A spiral for runsum(n) = 2


runsum(n) = 2 (hi-res #1)


runsum(n) = 2 (hi-res #2)


runsum(n) = 2 (hi-res #3)


Why do most of the numbers fall on a diagonal? I don’t know, but I know that the diagonal represents square numbers:

9 = sum(4..5) = sum(2..4)
25 = sum(12..13) = sum(3..7)
36 = sum(11..13) = sum(1..8)
49 = sum(24..25) = sum(4..10)


Now try runsum(n) = 3:

A spiral for runsum(n) = 3


runsum(n) = 3 (hi-res)


It’s a densely packed spiral, unlike the spiral for runsum(n) = 4:

A spiral for runsum(n) = 4


runsum(n) = 4 (hi-res)


Like the spiral for runsum(n) = 2, the numbers are disproportionately falling on the diagonal of square numbers:

81 = 9^2 = sum(40..41) = sum(26..28) = sum(11..16) = sum(5..13)
324 = 18^2 = sum(107..109) = sum(37..44) = sum(32..40) = sum(2..25)
2500 = 50^2 = sum(498..502) = sum(309..316) = sum(88..112) = sum(43..82)


Here are spirals for runsum(n) = 5:

A spiral for runsum(n) = 5 (note patterns in green)


runsum(n) = 5 (hi-res #1)


runsum(n) = 5 (hi-res #2)


There are two interesting patterns in the spiral, marked in green above and enlarged below:

Pattern #1 in spiral for runsum(n) = 5


Pattern #2 in spiral for runsum(n) = 5


Are the patterns merely artefacts or does one or both represent something mathematically significant? I don’t know.

More spirals:

A spiral for runsum(n) = 6


A spiral for runsum(n) = 7


runsum(n) = 7 (hi-res)


A spiral for runsum(n) = 8


runsum(n) = 8 (hi-res #1)


runsum(n) = 8 (hi-res #2)


Numbers in the spiral for runsum(n) = 8 are again falling disproportionately on the diagonal of square numbers. Here’s one of those squares:

441 = 21^2 = sum(220..221) = sum(146..148) = sum(71..76) = sum(60..66) = sum(45..53) = sum(25..38) = sum(16..33) = sum(11..31)


Previously Pre-Posted…

Spiral Artefact #1 — a look at patterns in spirals with different tests

Triangular Squares

The numbers that are both square and triangular are beautifully related to the best approximations to √2:

Number

Square Root

Factors of root

1 1 1
36 6 2 * 3
1225 35 5 * 7
41616 204 12 * 17

and so on.

In each case the factors of the root are the numerator and denominator of the next approximation to √2. — David Wells, The Penguin Dictionary of Curious and Interesting Mathematics (1986), entry for “36”.


Elsewhere other-accessible

A001110 — Square triangular numbers: numbers that are both triangular and square

Palindrought

The alchemists dreamed of turning dross into gold. In mathematics, you can actually do that, metaphorically speaking. If palindromes are gold and non-palindromes are dross, here is dross turning into gold:


22 = 10 + 12
222 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 23 + 24
484 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 34
555 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 34 + 35 + 36
2002 = nonpalsum(10,67)
36863 = nonpalsum(10,286)
45954 = nonpalsum(10,319)
80908 = nonpalsum(10,423)
113311 = nonpalsum(10,501)
161161 = nonpalsum(10,598)
949949 = nonpalsum(10,1417)
8422248 = nonpalsum(10,4136)
13022031 = nonpalsum(10,5138)
14166141 = nonpalsum(10,5358)
16644661 = nonpalsum(10,5806)
49900994 = nonpalsum(10,10045)
464939464 = nonpalsum(10,30649)
523434325 = nonpalsum(10,32519)
576656675 = nonpalsum(10,34132)
602959206 = nonpalsum(10,34902)
[...]

The palindromes don’t seem to stop arriving. But something unexpected happens when you try to turn gold into gold. If you sum palindromes to get palindromes, you’re soon hit by what you might call a palindrought, where no palindromes appear:


1 = 1
3 = 1 + 2
6 = 1 + 2 + 3
111 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33
353 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33 + 44 + 55 + 66 + 77
7557 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33 + 44 + 55 + 66 + 77 + 88 + 99 + 101 + 111 + 121 + 131 + 141 + 151 + 161 + 171 + 181 + 191 + 202 + 212 + 222 + 232 + 242 + 252 + 262 + 272 + 282 + 292 + 303 + 313 + 323 + 333 + 343 + 353 + 363 + 373 + 383
2376732 = palsum(1,21512)

That’s sequence A046488 at the OEIS. And I suspect that the sequence is complete and that the palindrought never ends. For some evidence of that, here’s an interesting pattern that emerges if you look at palsums of 1 to repdigits 9[…]9:


50045040 = palsum(1,99999)
50045045040 = palsum(1,9999999)
50045045045040 = palsum(1,999999999)
50045045045045040 = palsum(1,99999999999)
50045045045045045040 = palsum(1,9999999999999)
50045045045045045045040 = palsum(1,999999999999999)
50045045045045045045045040 = palsum(1,99999999999999999)
50045045045045045045045045040 = palsum(1,9999999999999999999)
50045045045045045045045045045040 = palsum(1,999999999999999999999)

As the sums get bigger, the carries will stop sweeping long enough and the sums may fall into semi-regular patterns of non-palindromic numbers like 50045040. If you try higher bases like base 909, you get more palindromes by summing palindromes, but a palindrought arrives in the end there too:


1 = palsum(1)
3 = palsum(1,2)
6 = palsum(1,3)
A = palsum(1,4)
[...]
66 = palsum(1,[104]) (palindromes = 43)
LL = palsum(1,[195]) (44)
[37][37] = palsum(1,[259]) (45)
[73][73] = palsum(1,[364]) (46)
[114][114] = palsum(1,[455]) (47)
[172][172] = palsum(1,[559]) (48)
[369][369] = palsum(1,[819]) (49)
6[466]6 = palsum(1,[104][104]) (50)
L[496]L = palsum(1,[195][195]) (51)
[37][528][37] = palsum(1,[259][259]) (52)
[73][600][73] = palsum(1,[364][364]) (53)
[114][682][114] = palsum(1,[455][455]) (54)
[172][798][172] = palsum(1,[559][559]) (55)
[291][126][291] = palsum(1,[726][726]) (56)
[334][212][334] = palsum(1,[778][778]) (57)
[201][774][830][774][201] = palsum(1,[605][707][605]) (58)
[206][708][568][708][206] = palsum(1,[613][115][613]) (59)
[456][456][569][569][456][456] = palsum(1,11[455]11) (60)
22[456][454][456]22 = palsum(1,21012) (61)

Note the palindrome for palsum(1,21012). All odd bases higher than 3 seem to produce a palindrome for 1 to 21012 in that base (21012 in base 5 = 1382 in base 10, 2012 in base 7 = 5154 in base 10, and so on):


2242422 = palsum(1,21012) (base=5)
2253522 = palsum(1,21012) (b=7)
2275722 = palsum(1,21012) (b=11)
2286822 = palsum(1,21012) (b=13)
2297922 = palsum(1,21012) (b=15)
22A8A22 = palsum(1,21012) (b=17)
22B9B22 = palsum(1,21012) (b=19)
22CAC22 = palsum(1,21012) (b=21)
22DBD22 = palsum(1,21012) (b=23)

And here’s another interesting pattern created by summing squares in base 9 (where 17 = 16 in base 10, 40 = 36 in base 10, and so on):


1 = squaresum(1)
5 = squaresum(1,4)
33 = squaresum(1,17)
111 = squaresum(1,40)
122221 = squaresum(1,4840)
123333321 = squaresum(1,503840)
123444444321 = squaresum(1,50483840)
123455555554321 = squaresum(1,5050383840)
123456666666654321 = squaresum(1,505048383840)
123456777777777654321 = squaresum(1,50505038383840)
123456788888888887654321 = squaresum(1,5050504838383840)

Then a palindrought strikes again. But you don’t get a palindrought in the triangular numbers, or numbers created by summing the integers, palindromic and non-palindromic alike:


1 = 1
3 = 1 + 2
6 = 1 + 2 + 3
55 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
66 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11
171 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18
595 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34
666 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36
3003 = palsum(1,77)
5995 = palsum(1,109)
8778 = palsum(1,132)
15051 = palsum(1,173)
66066 = palsum(1,363)
617716 = palsum(1,1111)
828828 = palsum(1,1287)
1269621 = palsum(1,1593)
1680861 = palsum(1,1833)
3544453 = palsum(1,2662)
5073705 = palsum(1,3185)
5676765 = palsum(1,3369)
6295926 = palsum(1,3548)
35133153 = palsum(1,8382)
61477416 = palsum(1,11088)
178727871 = palsum(1,18906)
1264114621 = palsum(1,50281)
1634004361 = palsum(1,57166)
5289009825 = palsum(1,102849)
6172882716 = palsum(1,111111)
13953435931 = palsum(1,167053)
16048884061 = palsum(1,179158)
30416261403 = palsum(1,246642)
57003930075 = palsum(1,337650)
58574547585 = palsum(1,342270)
66771917766 = palsum(1,365436)
87350505378 = palsum(1,417972)
[...]

If 617716 = palsum(1,1111) and 6172882716 = palsum(1,111111), what is palsum(1,11111111)? Try it for yourself — there’s an easy formula for the triangular numbers.

Magistra Rules the Waves

One of my favourite integer sequences has the simple formula n(i) = n(i-1) + digitsum(n(i-1)). If it’s seeded with 1, its first few terms go like this:

n(1) = 1
n(2) = n(1) + digitsum(n(1)) = 1 + digitsum(1) = 2
n(3) = 2 + digitsum(2) = 4
n(4) = 4 + digitsum(4) = 8
n(5) = 8 + digitsum(8) = 16
n(6) = 16 + digitsum(16) = 16 + 1+6 = 16 + 7 = 23
n(7) = 23 + digitsum(23) = 23 + 2+3 = 23 + 5 = 28
n(8) = 28 + digitsum(28) = 28 + 2+8 = 28 + 10 = 38

As a sequence, it looks like this:

1, 2, 4, 8, 16, 23, 28, 38, 49, 62, 70, 77, 91, 101, 103, 107, 115, 122, 127, 137, 148, 161, 169, 185, 199, 218, 229, 242, 250, 257, 271, 281, 292, 305, 313, 320, 325, 335, 346, 359, 376, 392, 406, 416, 427, 440, 448, 464, 478, 497, 517, 530, 538, 554, 568, 587, 607, 620, 628, 644, 658, 677, 697, 719, 736, 752, 766, 785, 805, 818, 835, 851, 865, 884, 904, 917, 934, 950, 964, 983, 1003…

Given a number at random, is there a quick way to say whether it appears in the sequence seeded with 1? Not that I know, with one exception. If the number is divisible by 3, it doesn’t appear, at least in base 10. In base 2, that rule doesn’t apply:

n(1) = 1
n(2) = 1 + digitsum(1) = 10 = 1 + 1 = 2
n(3) = 10 + digitsum(10) = 10 + 1 = 11 = 2 + 1 = 3
n(4) = 11 + digitsum(11) = 11 + 1+1 = 101 = 3 + 2 = 5
n(5) = 101 + digitsum(101) = 101 + 1+0+1 = 111 = 5 + 2 = 7
n(6) = 111 + digitsum(111) = 111 + 11 = 1010 = 7 + 3 = 10
n(7) = 1010 + digitsum(1010) = 1010 + 10 = 1100 = 10 + 2 = 12
n(8) = 1100 + digitsum(1100) = 1100 + 10 = 1110 = 12 + 2 = 14

1, 2, 3, 5, 7, 10, 12, 14, 17, 19, 22, 25, 28, 31, 36, 38, 41, 44, 47, 52, 55, 60, 64, 65, 67, 70, 73, 76, 79, 84, 87, 92, 96, 98, 101, 105, 109, 114, 118, 123, 129, 131, 134, 137, 140, 143, 148, 151, 156, 160, 162, 165, 169, 173, 178, 182, 187, 193, 196, 199, 204, 208, 211, 216, 220, 225, 229, 234, 239, 246, 252, 258, 260, 262, 265, 268, 271, 276, 279, 284, 288, 290, 293, 297, 301, 306, 310, 315, 321, 324, 327, 332, 336, 339, 344, 348, 353, 357, 362, 367, 374…

What patterns are there in these sequences? It’s easier to check when they’re represented graphically, so I converted them into patterns à la the Ulam spiral, where n is represented as a dot on a spiral of integers. This is the spiral for base 10:

ulambase10Base 10


And these are the spirals for bases 2 and 3:

ulambase2

Base 2


ulambase3

Base 3


These sequences look fairly random to me: there are no obvious patterns in the jumps from n(i) to n(i+1), i.e. in the values for digitsum(n(i)). Now try the spirals for bases 9 and 33:

ulambase9

Base 9


ulambase33

Base 33


Patterns have appeared: there is some regularity in the jumps. You can see these regularities more clearly if you represent digitsum(n(i)) as a graph, with n(i) on the x axis and digitsum(n(i)) on the y axis. If the graph starts with n(i) = 1 on the lower left and proceeds left-right, left-right up the screen, it looks like this in base 10:

base10

Base 10 (click to enlarge)


Here are bases 2 and 3:

base2

Base 2


base3

Base 3


The jumps seem fairly random. Now try bases 9, 13, 16, 17, 25, 33 and 49:

base9

Base 9


base13

Base 13


base16

Base 16


base17

Base 17


base25

Base 25


base33

Base 33


base49

Base 49


In some bases, the formula n(i) = n(i-1) + digitsum(n(i-1)) generates mild randomness. In others, it generates strong regularity, like waves rolling ashore under a steady wind. I don’t understand why, but regularity seems to occur in bases that are one more than a power of 2 and also in some bases that are primes or squares.


Elsewhere other-posted:

Mathematica Magistra Mundi
8200_idf_insignia