Graph durch Euler

This is the famous Ulam spiral, in which prime numbers are represented on filled squares on a square spiral:

The Ulam spiral


I like the way the spiral sits between chaos and calm. It’s not wholly random and it’s not wholly regular — it’s betwixt and between. You get a similar chaos-and-calm vibe from a graph for a function called Euler phi. And primes are at work there too. Here’s the graph from Wikipedia:

Graph of eulerphi(n) = φ(n) (see Euler’s totient function)


But what is the Euler phi function? For any integer n, eulerphi(n) gives you the count of numbers < n that are relatively prime to n. That is, the count of numbers < n that have no common factors with n other than one. You can see how eulerphi(n) works by considering whether you can simplify the fraction a/b, where a = 1..n-1 and b = n:

φ(6) = 2
1/6 (1)
2/6 → 1/3
3/6 → 1/2
4/6 → 2/3
5/6, ∴ φ(6) = 2


φ(7) = 6
1/7 (1)
2/7 (2)
3/7 (3)
4/7 (4)
5/7 (5)
6/7, ∴ φ(7) = 6


φ(12) = 4
1/12 (1)
2/12 → 1/6
3/12 → 1/4
4/12 → 1/3
5/12 (2)
6/12 → 1/2
7/12 (3)
8/12 → 2/3
9/12 → 3/4
10/12 → 5/6
11/12, ∴ φ(12) = 4


φ(13) = 12
1/13 (1)
2/13 (2)
3/13 (3)
4/13 (4)
5/13 (5)
6/13 (6)
7/13 (7)
8/13 (8)
9/13 (9)
10/13 (10)
11/13 (11)
12/13, ∴ φ(13) = 12


As you can see, eulerphi(n) = n-1 for primes. Now you know what the top line of the Eulerphi graph is. It’s the primes. Here’s a bigger version of the graph:

Graph of eulerphi(n) = φ(n)


Unlike the Ulam spiral, however, the Eulerphi graph is cramped. But it’s easy to stretch it. You can represent φ(n) as a fraction between 0 and 1 like this: phifrac(n) = φ(n) / (n-1). Using phifrac(n), you can create Eulerphi bands, like this:

Eulerphi band, n <= 1781


Eulerphi band, n <= 3561


Eulerphi band, n <= 7121


Eulerphi band, n <= 14241


Or you can create Eulerphi discs, like this:

Eulerphi disc, n <= 1601


Eulerphi disc, n <= 3201


Eulerphi disc, n <= 6401


Eulerphi disc, n <= 12802


Eulerphi disc, n <= 25602


But what is the bottom line of the Eulerphi bands and inner ring of the Eulerphi discs, where φ(n) is smallest relative to n? Well, the top line or outer ring is the primes and the bottom line or inner ring is the primorials (and their multiples). The function primorial(n) is the multiple of the first n primes:

primorial(1) = 2
primorial(2) = 2*3 = 6
primorial(3) = 2*3*5 = 30
primorial(4) = 2*3*5*7 = 210
primorial(5) = 2*3*5*7*11 = 2310
primorial(6) = 2*3*5*7*11*13 = 30030
primorial(7) = 2*3*5*7*11*13*17 = 510510
primorial(8) = 2*3*5*7*11*13*17*19 = 9699690
primorial(9) = 2*3*5*7*11*13*17*19*23 = 223092870
primorial(10) = 2*3*5*7*11*13*17*19*23*29 = 6469693230


Here are the numbers returning record lows for φfrac(n) = φ(n) / (n-1):

φ(4) = 2 (2/3 = 0.666…)
4 = 2^2
φ(6) = 2 (2/5 = 0.4)
6 = 2.3
φ(12) = 4 (4/11 = 0.363636…)
12 = 2^2.3
[…]
φ(30) = 8 (8/29 = 0.275862…)
30 = 2.3.5
φ(60) = 16 (16/59 = 0.27118…)
60 = 2^2.3.5
[…]
φ(210) = 48 (48/209 = 0.229665…)
210 = 2.3.5.7
φ(420) = 96 (96/419 = 0.2291169…)
420 = 2^2.3.5.7
φ(630) = 144 (144/629 = 0.228934…)
630 = 2.3^2.5.7
[…]
φ(2310) = 480 (480/2309 = 0.2078822…)
2310 = 2.3.5.7.11
φ(4620) = 960 (960/4619 = 0.20783719…)
4620 = 2^2.3.5.7.11
[…]
30030 = 2.3.5.7.11.13
φ(60060) = 11520 (11520/60059 = 0.191811385…)
60060 = 2^2.3.5.7.11.13
φ(90090) = 17280 (17280/90089 = 0.1918103209…)
90090 = 2.3^2.5.7.11.13
[…]
φ(510510) = 92160 (92160/510509 = 0.18052571061…)
510510 = 2.3.5.7.11.13.17
φ(1021020) = 184320 (184320/1021019 = 0.18052553…)
1021020 = 2^2.3.5.7.11.13.17
φ(1531530) = 276480 (276480/1531529 = 0.180525474868579…)
1531530 = 2.3^2.5.7.11.13.17
φ(2042040) = 368640 (368640/2042039 = 0.18052544540040616…)
2042040 = 2^3.3.5.7.11.13.17

Primal Polynomial

n² + n + 17 is one of the best-known polynomial formulas for primes. Its values for n = 0 to 15 are all prime, starting with 17 and ending with 257. — David Wells in The Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “17”

• 17, 19, 23, 29, 37, 47, 59, 73, 89, 107, 127, 149, 173, 199, 227, 257

Primal Pellicles

Numbers have thin skins. And they’re easily replaced. Take 71624133. Here it is permuting its pellicles:

71624133 in base 10 = 100010001001110010111000101 in base 2 = 11222202212211200 in b3 = 10101032113011 in b4 = 121313433013 in b5 = 11035053113 in b6 = 1526536500 in b7 = 421162705 in b8 = 158685750 in b9 = 374802A9 in b11 = 1BBA1199 in b12 = 11AB9B59 in b13 = 9726137 in b14 = 644BE73 in b15 = F3855B7 in b16

But if digits are the skin of 71624133, what are its bones? Well, you could say the skeleton of a number, something that doesn’t change from base to base, is its prime factorization:

71624133 = 32 × 72 × 162413

But the primes themselves are numbers, so they’re wearing pellicles too. And it turns out that, in base 10, the pellicles of the prime factors of 71624133 match the pellicle of 71624133 itself:

71624133 = 32.72.162413

Here’s a list of primal pellicles in base 10:

735 = 3.5.72
3792 = 24.3.79
1341275 = 52.13.4127
13115375 = 53.7.13.1153
22940075 = 52.229.4007
29373375 = 3.53.29.37.73
71624133 = 32.72.162413
311997175 = 52.7.172.31.199
319953792 = 27.3.53.79.199
1019127375 = 32.53.7.127.1019
1147983375 = 3.53.7.11.83.479
1734009275 = 52.173.400927
5581625072 = 24.5581.62507
7350032375 = 53.7.23.73.5003
17370159615 = 34.5.17.59.61.701
33061224492 = 22.33.306122449
103375535837 = 72.37.103.553583
171167303912 = 23.11.172.6730391
319383665913 = 3.133.19.383.6659
533671737975 = 34.52.17.53.367.797
2118067737975 = 32.52.7.79.211.80677
3111368374257 = 3.112.132.683.74257
3216177757191 = 3.73.191.757.21617
3740437158475 = 52.37.4043715847
3977292332775 = 3.52.292.233.277.977
4417149692375 = 53.7.23.4969.44171
7459655393232 = 24.32.72.23.45965539
7699132721175 = 3.52.72.27211.76991
7973529228735 = 3.5.7.972.2287.3529
10771673522535 = 34.5.67.71.107.52253

You can find them at the Online Encyclopedia of Integer Sequences under A121342, “Composite numbers that are a concatenation of their distinct prime divisors in some order.” But what about pairs of primal pellicles, that is, pairs of numbers where the prime factors of each form the pellicle of the other?

35 = 5.775 = 3.52
1275 = 3.52.173175 = 52.127
131715 = 32.5.2927329275 = 52.13171
3199767 = 3.359.297135932971 = 3.19.67.972
14931092 = 22.11.61.5563116155632 = 24.3.109.1492

And here are a few primal pellicles I’ve found in other bases:

Primal Pellicles in Base 2

1111011011110 = 10.1110.110110111 in b2 = 7902 = 2.32.439 in b10
1110001100110111 = 1110.10111.100011001 in b2 = 58167 = 32.23.281 in b10
1111011011011110 = 10.1110.110110110111 in b2 = 63198 = 2.32.3511 in b10
11101001100001101 = 1110.101.101001100001 in b2 = 119565 = 32.5.2657 in b10
1111011011011011110 = 10.1110.110110110110111 in b2 = 505566 = 2.32.28087 in b10
1111011111101111011 = 1110.1011.10111.11011111 in b2 = 507771 = 32.11.23.223 in b10


Primal Pellicles in Base 3

121022 = 210.12.102 in b3 = 440 = 23.5.11 in b10
212212 = 22.21.212 in b3 = 644 = 22.7.23 in b10
20110112 = 210.201.1011 in b3 = 4712 = 23.19.31 in b10
21110110 = 10.212.1101 in b3 = 5439 = 3.72.37 in b10
121111101 = 122.111.1101 in b3 = 12025 = 52.13.37 in b10
222112121 = 22.21.221121 in b3 = 19348 = 22.7.691 in b10
2202122021 = 22.2021.22021 in b3 = 54412 = 22.61.223 in b10
120212201221 = 2.122.21.201.1202 in b3 = 312550 = 2.52.7.19.47 in b10


Primal Pellicles in Base 7

2525 = 2.52.25 in b7 = 950 = 2.52.19 in b10
3210 = 2.34.10 in b7 = 1134 = 2.34.7 in b10
5252 = 2.52.52 in b7 = 1850 = 2.52.37 in b10
332616 = 33.16.326 in b7 = 58617 = 33.13.167 in b10
336045 = 32.5.3604 in b7 = 59715 = 32.5.1327 in b10
2251635 = 22.3.5.16.252 in b7 = 281580 = 22.3.5.13.192 in b10


Primal Pellicles in Base 11

253 = 22.3.52 in b11 = 300 = 22.3.52 in b10
732 = 2.32.72 in b11 = 882 = 2.32.72 in b10
2123 = 23.33.12 in b11 = 2808 = 23.33.13 in b10
3432 = 25.3.43 in b11 = 4512 = 25.3.47 in b10
3710 = 32.72.10 in b11 = 4851 = 32.72.11 in b10
72252 = 23.72.225 in b11 = 105448 = 23.72.269 in b10


Primal Pellicles in Base 15

275 = 24.5.7 in b15 = 560 = 24.5.7 in b10
2D5 = 2.52.D in b15 = 650 = 2.52.13 in b10
2CD5 = 2.52.CD in b15 = 9650 = 2.52.193 in b10
7BE3 = 3.72.BE in b15 = 26313 = 3.72.179 in b10
21285 = 24.52.128 in b15 = 105200 = 24.52.263 in b10

Lime Time

What do you get if you list every successive pair of entries in this sequence?

1, 2, 1, 3, 2, 3, 1, 4, 3, 4, 1, 5, 2, 5, 3, 5, 4, 5, 1, 6, 5, 6, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 1, 8, 3, 8, 5, 8, 7, 8, 1, 9, 2, 9, 4, 9, 5, 9, 7, 9, 8, 9, 1, 10, 3, 10, 7, 10, 9, 10, 1, 11, 2, 11, 3, 11, 4, 11, 5, 11, 6, 11, 7, 11, 8, 11, 9, 11, 10, 11, 1, 12, 5, 12, 7, 12, 11, 12, 1, 13, … — A038568 at the Online Encyclopedia of Integer Sequence

You get the rational fractions ordered by denominator in their simplest form: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5… There are no pairs like 2/4 and 5/35, because those can be simplified: 2/4 → 1/2; 15/35 → 3/7. You can get the same set of rational fractions by listing every successive pair in this sequence, the Stern-Brocot sequence:

1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19, … — A002487 at the OEIS

But the fractions don’t come ordered by denominator this time. In fact, they seem to come at random: 1/2, 1/3, 2/3, 1/4, 3/5, 2/5, 3/4, 1/5, 4/7, 3/8, 5/7, 2/7, 5/8… But they’re not random at all. There’s a complicated way of generating them and a simple way. An amazingly simple way, I think:

Moshe Newman proved that the fraction a(n+1)/a(n+2) can be generated from the previous fraction a(n)/a(n+1) = x by 1/(2*floor(x) + 1 – x). The successor function f(x) = 1/(floor(x) + 1 – frac(x)) can also be used. — A002487, “Stern-Brocot Sequence”, at the OEIS

In another form, the Stern-Brocot sequence is generated by what’s called the Calkin-Wilf Tree. Now suppose you use the Stern-Brocot sequence to supply the x co-ordinate of an L-graph whose arms run from 0 to 1. And you use the Calkin-Wilf Tree to supply the y co-ordinate of the L-tree. What do you get? As I described in “I Like Gryke”, you get this fractal:

Limestone fractal


I call it a limestone fractal or pavement fractal or gryke fractal, because it reminds me of the fissured patterns you see in the limestone pavements of the Yorkshire Dales:

Fissured limestone pavement, Yorkshire Dales (Wikipedia)


But what happens when you plot the (x,y) of the Stern-Brocot sequence and the Calkin-Wilf Tree on a circle instead? You get an interestingly distorted limestone fractal:

Limestone fractal on circle


You can also plot the (x,y) around the perimeter of a polygon, then stretch the polygon into a circle. Here’s a square:

Limestone fractal on square

Limestone square stretched to circle


And here are a pentagon, hexagon, heptagon and octagon — note the interesting perspective effects:

Limestone fractal on pentagon

Limestone pentagon stretched to circle


Limestone fractal on hexagon

Limestone hexagon stretched to circle


Limestone fractal on heptagon

Limestone heptagon stretched to circle


Limestone fractal on octagon

Limestone octagon stretched to circle


And finally, here are animations of limestone polygons stretching to circles:

Limestone square stretched to circle (animated at EZgif)


Limestone pentagon to circle (animated)


Limestone hexagon to circle (animated)


Limestone heptagon to circle (animated)


Limestone octagon to circle (animated)


Previously Pre-Posted (Please Peruse)

I Like Gryke — a first look at the limestone fractal

Summer-Time Twos

I wondered how often the digits of n2 appeared in sum(n1,n2). For example:

17 → 117 = sum(9,17)
20200 = sum(5,20); 204,4; 207,3; 209,2 (c=4)

As I looked at higher n2, I found that the 2-views continued:

63 → 363 = sum(58,63); 638,53; 1638,28; 1763,23; 1863,18 (c=5)
88 → 1288 = sum(73,88); 2788,48; 2881,46; 3388,33; 3880,9; 3888,8 (c=6)
20020009 = sum(14,200); 20022,13; 20034,12; 20045,11; 20055,10; 20064,9;
200
72,8; 20079,7; 20085,6; 20090,5; 20094,4; 20097,3; 20099,2 (c=13)
558 → 39558 = sum(483,558); 55833,448; 95583,348; 105558,318; 125580,247; 126558,243; 143558,158; 152558,83; 155583,28; 155808,18; 155825,17; 155841,16; 155856,15; 155870,14; 155883,13; 155895,12 (c=16)
20002000010 = sum(45,2000); 2000054,44; 2000097,43; 2000139,42; 2000180,41; 2000220,40; 2000259,39; 2000297,38; 2000334,37; 2000370,36; 2000405,35; 2000439,34; 2000472,33; 2000504,32; 2000535,31; 2000565,30;
2000594,29; 2000622,28; 2000649,27; 2000675,26; 2000700,25; 2000724,24; 2000747,23; 2000769,22; 2000790,21; 2000810,20; 2000829,19; 2000847,18; 2000864,17; 2000880,16; 2000895,15; 2000909,14; 2000922,13; 2000934,
12; 2000945,11; 2000955,10; 2000964,9; 2000972,8; 2000979,7; 2000985,6; 2000990,5; 2000994,4; 2000997,3; 2000999,2 (c=44)

But what about other bases?

Base 9

15 in b9 → 115 = sum(5,15) (n=14 in b10) (c=1)
18 in b9 → 118 = sum(11,17); 180,1 (n=17 in b10) (c=2)
20 in b9 → 203 = sum(4,18); 206,3; 208,2 (n=18 in b10) (c=3)
45 in b9 → 445 = sum(32,41); 745,25; 1045,15; 1145,5 (n=41 in b10) (c=4)
55 in b9 → 555 = sum(41,50); 1055,35; 1355,25; 1555,15; 1655,5 (n=50 in b10) (c=5)
65 in b9 → 665 = sum(50,59); 1265,45; 1665,35; 2065,25; 2265,15; 2365,5 (n=59 in b10) (c=6)
75 in b9 → 775 = sum(59,68); 1475,55; 2075,45; 2475,35; 2750,26; 2775,25; 3075,15; 3175,5 (n=68 in b10) (c=8)
85 in b9 → 885 = sum(68,77); 1685,65; 2385,55; 2885,45; 3385,35; 3685,25; 3853,17; 3885,15; 4085,5 (n=77 in b10) (c=9)
200 in b9 → 20003 = sum(13,162); 20016,13; 20028,12; 20040,11; 20050,10; 20058,8; 20066,7; 20073,6; 20078,5; 20083,4; 20086,3; 20088,2 (n=162 in b10) (c=12)
415 in b9 → 13415 = sum(311,338); 25415,345; 36415,315; 41525,302; 46415,275; 55415,245; 63415,215; 64155,212; 70415,175; 75415,145; 80415,115; 83415,75; 85415,45; 86415,15 (n=338 in b10) (c=14)
[…]
2000 in b9 → 2000028 = sum(38,1458); 2000070,41; 2000120,40; 2000158,38; 2000206,37; 2000243,36; 2000278,35; 2000323,34; 2000356,33; 2000388,32; 2000430,31; 2000460,30; 2000488,28; 2000526,27; 2000553,26; 2000578,25; 2000613,24; 2000636,23; 2000658,22; 2000680,21; 2000710,20; 2000728,18; 2000746,17; 2000763,16; 2000778,15; 2000803,14; 2000816,13; 2000828,12; 2000840,11; 2000850,10; 2000858,8; 2000866,7; 2000873,6; 2000878,5; 2000883,4; 2000886,3; 2000888,2 (n=1458 in b10) (c=37)


Base 11

16 in b11 → 116 = sum(6,16) (n=17 in b10) (c=1)
20 in b11 → 201 = sum(5,22); 205,4; 208,3; 20A,2 (n=22 in b10) (c=4)
56 in b11 → 556 = sum(50,61); 956,36; 1156,26; 1356,16; 1456,6 (n=61 in b10) (c=5)
66 in b11 → 666 = sum(61,72); 1066,46; 1466,36; 1669,2A; 1766,26; 1966,16; 1A66,6 (n=72 in b10) (c=7)
86 in b11 → 886 = sum(83,94); 1486,66; 1A86,56; 2486,46; 2886,36; 3086,26; 3286,16; 3386,6 (n=94 in b10) (c=8)
96 in b11 → 996 = sum(94,105); 1696,76; 2296,66; 2896,56; 3296,46; 3696,36; 3996,26; 4096,16; 4196,6 (n=105 in b10) (c=9)
A6 in b11 → AA6 = sum(105,116); 18A6,86; 25A6,76; 31A6,66; 37A6,56; 41A6,46; 45A6,36; 48A6,26; 4AA6,16; 50A6,6 (n=116 in b10) (c=10)
200 in b11 → 1200A = sum(156,242); 20001,15; 20015,14; 20028,13; 2003A,12; 20050,11; 20060,10; 2006A,A; 20078,9; 20085,8; 20091,7; 20097,6; 200A1,5; 200A5,4; 200A8,3; 200AA,2 (n=242 in b10) (c=16)
[…]
A66 in b11 → 1AA66 = sum(1260,1282); A1A66,966; 109A66,946; 182A66,866; 198A66,846; 23A666,786; 253A66,766; 267A66,746; 314A66,666; 326A66,646; 375A66,566; 385A66,546; 416A66,466; 424A66,446; 457A66,366; 463A66,346; 46A666,326; 488A66,266; 492A66,246; 4A6666,186; 4A9A66,166; 501A66,146; 50AA66,66; 510A66,46 (n=1282 in b10) (c=24)
2000 in b11 → 2000005 = sum(52,2662); 2000051,47; 2000097,46; 2000131,45; 2000175,44; 2000208,43; 200024A,42; 2000290,41; 2000320,40; 200035A,3A; 2000398,39; 2000425,38; 2000461,37; 2000497,36; 2000521,35; 2000555,34; 2000588,33; 200060A,32; 2000640,31; 2000670,30; 200069A,2A; 2000718,29; 2000745,28; 2000771,27; 2000797,26; 2000811,25; 2000835,24; 2000858,23; 200087A,22; 20008A0,21; 2000910,20; 200092A,1A; 2000948,19; 2000965,18; 2000981,17; 2000997,16; 2000A01,15; 2000A15,14; 2000A28,13; 2000A3A,12; 2000A50,11; 2000A60,10; 2000A6A,A; 2000A78,9; 2000A85,8; 2000A91,7; 2000A97,6; 2000AA1,5; 2000AA5,4; 2000AA8,3; 2000AAA,2 (n=2662 in b10) (c=51)


Base 3

12 in b3 → 112 = sum(2,12); 120,1 (n=5 in b10) (c=2)
20 in b3 → 120 = sum(4,6); 200,10; 202,2 (n=6 in b10) (c=3)
122 in b3 → 10122 = sum(11,17); 11122,22; 11220,21; 12122,2; 12200,1 (n=17 in b10) (c=5)
1212 in b3 → 121212 = sum(41,50); 1001212,1012; 1101212,212; 1112120,200; 1121212,112; 1201212,12 (n=50 in b10) (c=6)
1222 in b3 → 122222 = sum(44,53); 1101222,1002; 1111222,222; 1112220,221; 1212222,102; 1221222,2; 1222000,1 (n=53 in b10) (c=7)
2000 in b3 → 1112000 = sum(28,54); 1120000,1000; 2000020,21; 2000110,20; 2000122,12; 2000210,11; 2000220,10; 2000222,2 (n=54 in b10) (c=8)
[…]
20000 in b3 → 111120000 = sum(82,162); 111200000,10000; 200000010,111; 200000120,110; 200000222,102; 200001100,101; 200001200,100; 200001222,22; 200002020,21; 200002110,20; 200002122,12; 200002210,11; 200002220,10; 200002222,2 (n=162 in b10) (c=14)


Base 4

13 in b4 → 130 = sum(1,13) (n=7 in b10) (c=1)
20 in b4 → 201 = sum(3,8); 203,2 (n=8 in b10) (c=2)
200 in b4 → 20001 = sum(6,32); 20012,11; 20022,10; 20031,3; 20033,2 (n=32 in b10) (c=5)
2000 in b4 → 2000021 = sum(11,128); 2000103,22; 2000130,21; 2000210,20; 2000223,13; 2000301,12; 2000312,11; 2000322,10; 2000331,3; 2000333,2 (n=128 in b10) (c=10)
20000 in b4 → 200000003 = sum(23,512); 200000121,112; 200000232,111; 200001002,110; 200001111,103; 200001213,102; 200001320,101; 200002020,100; 200002113,33; 200002211,32; 200002302,31; 200002332,30; 200003021,23; 200003103,22; 200003130,21; 200003210,20; 200003223,13; 200003301,12; 200003312,11; 200003322,10; 200003331,3; 200003333,2 (n=512 in b10) (c=22)


Base 8

17 in b8 → 170 = sum(1,17) (n=15 in b10) (c=1)
20 in b8 → 202 = sum(4,16); 205,3; 207,2 (n=16 in b10) (c=3)
200 in b8 → 20011 = sum(11,128); 20023,12; 20034,11; 20044,10; 20053,7; 20061,6; 20066,5; 20072,4; 20075,3; 20077,2 (n=128 in b10) (c=10)
2000 in b8 → 2000020 = sum(32,1024); 2000057,37; 2000115,36; 2000152,35; 2000206,34; 2000241,33; 2000273,32; 2000324,31; 2000354,30; 2000403,27; 2000431,26; 2000456,25; 2000502,24; 2000525,23; 2000547,22; 200057
0,21; 2000610,20; 2000627,17; 2000645,16; 2000662,15; 2000676,14; 2000711,13; 2000723,12; 2000734,11; 2000744,10; 2000753,7; 2000761,6; 2000766,5; 2000772,4; 2000775,3; 2000777,2 (n=1024 in b10) (c=31)


Base 16

1F in b16 → 1F0 = sum(1,1F) (n=31 in b10) (c=1)
20 in b16 → 201 = sum(6,32); 206,5; 20A,4; 20D,3; 20F,2 (n=32 in b10) (c=5)
200 in b16 → 20003 = sum(23,512); 20019,16; 2002E,15; 20042,14; 20055,13; 20067,12; 20078,11; 20088,10; 20097,F; 200A5,E; 200B2,D; 200BE,C; 200C9,B; 200D3,A; 200DC,9; 200E4,8; 200EB,7; 200F1,6; 20
0
F6,5; 200FA,4; 200FD,3; 200FF,2 (n=512 in b10) (c=22)
[…]
EE4 in b16 → 42EE4A = sum(961,EE4); 6EE413,16; 6EE428,15; 6EE43C,14; 6EE44F,13; 6EE461,12; 6EE472,11; 6EE482,10; 6EE491,F; 6EE49F,E; 6EE4AC,D; 6EE4B8,C; 6EE4C3,B; 6EE4CD,A; 6EE4D6,9; 6EE4DE,8; 6EE4E5,7; 6EE4EB,6; 6EE4F0,5; 6EE4F4,4; 6EE4F7,3; 6EE4F9,2; 6EE4FA,1 (n=3812 in b10) (c=23)
2000 in b16 → 2000001 = sum(5B,2000); 200005B,5A; 20000B4,59; 200010C,58; 2000163,57; 20001B9,56; 200020E,55; 2000262,54; 20002B5,53; 2000307,52; 2000358,51; 20003A8,50; 20003F7,4F; 2000445,4E; 2000492,4D; 20004DE,4C; 2000529,4B; 2000573,4A; 20005BC,49; 2000604,48; 200064B,47; 2000691,46; 20006D6,45; 200071A,44; 200075D,43; 200079F,42; 20007E0,41; 2000820,40; 200085F,3F; 200089D,3E; 20008DA,3D; 2000916,3C; 2000951,3B; 200098B,3A; 20009C4,39; 20009FC,38; 2000A33,37; 2000A69,36; 2000A9E,35; 2000AD2,34; 2000B05,33; 2000B37,32; 2000B68,31; 2000B98,30; 2000BC7,2F; 2000BF5,2E; 2000C22,2D; 2000C4E,2C; 2000C79,2B; 2000CA3,2A; 2000CCC,29; 2000CF4,28; 2000D1B,27; 2000D41,26; 2000D66,25; 2000D8A,24; 2000DAD,23; 2000DCF,22; 2000DF0,21; 2000E10,20; 2000E2F,1F; 2000E4D,1E; 2000E6A,1D; 2000E86,1C; 2000EA1,1B; 2000EBB,1A; 2000ED4,19; 2000EEC,18; 2000F03,17; 2000F19,16; 2000F2E,15; 2000F42,14; 2000F55,13; 2000F67,12; 2000F78,11; 2000F88,10; 2000F97,F; 2000FA5,E; 2000FB2,D; 2000FBE,C; 2000FC9,B; 2000FD3,A; 2000FDC,9; 2000FE4,8; 2000FEB,7; 2000FF1,6; 2000FF6,5; 2000FFA,4; 2000FFD,3; 2000FFF,2 (n=8192 in b10) (c=90)


Previously Pre-Posted (Please Peruse)

Summer-Time Hues
Summer-Climb Views
Summult-Time Hues

Punctuated Pairimeters

Imagine using the digits of n in two different bases to generate two fractions, a/b and c/d, where a/b < 1 and c/d < 1 (see Appendix for a sample program). Now use the fractions to find a pair of points on the perimeter of a circle, (x1, y1) and (x2, y2), then calculate and mark the midpoint of (x1, y1) and (x2, y2). If the bases have a prime factor in common, pretty patterns will appear from this punctuated pairimetry:

b1 = 2; b2 = 6


b1 = 2; b2 = 10


b1 = 2; b2 = 14


b1 = 4; b2 = 10


b1 = 4; b2 = 20


b1 = 4; b2 = 28


b1 = 6; b2 = 42


b1 = 12; b2 = 39


b1 = 24; b2 = 28


b1 = 28; b2 = 40


b1 = 32; b2 = 36


b1 = 42; b2 = 78


Appendix: Sample Program for Pairimetry

GetXY(xyi)=

fr = 0
recip = 1
bs = base[xyi]
for gi = 1 to di[xyi]
recip = recip/bs
fr += d[xyi,gi] * recip
next gi

x[xyi] = xcenter + sin(pi2 * fr) * radius
y[xyi] = ycenter + cos(pi2 * fr) * radius

endproc

Dinc(i1) =

d[i1,1]++;
if d[i1,1] == base[i1] then

i2 = 1

while d[i1,i2] == base[i1]

d[i1,i2] = 0
i2++;
d[i1,i2]++;

endwhile

if i2 > di[i1] then di[i1] = i2 endif

endif

endproc

Drawfigure =

base = x = y = di = array(2)
d = array(2,100)
radius = 100
pi2 = pi * 2
base[1] = 2
base[2] = 6
di[1] = 1
di[2] = 1

while true

for i = 1 to 2
call Dinc(i)
call GetXY(i)
next i

plot (x[1]+x[2]) / 2, (y[1] + y[2]) / 2

endwhile

endproc

call drawfigure

Summult-Time Hues

sum(3,6) = 3 * 6 = 18
3 * 2.3 = 2.3^2
sum(15,35) = 15 * 35 = 525
3.5 * 5.7 = 3.5^2.7
sum(85,204) = 85 * 204 = 17340
5.17 * 2^2.3.17 = 2^2.3.5.17^2
sum(493,1189) = 493 * 1189 = 586177
17.29 * 29.41 = 17.29^2.41
sum(2871,6930) = 2871 * 6930 = 19896030
3^2.11.29 * 2.3^2.5.7.11 = 2.3^4.5.7.11^2.29
sum(16731,40391) = 16731 * 40391 = 675781821
3^2.11.13^2 * 13^2.239 = 3^2.11.13^4.239
[…]


Elsewhere Other-Accessible

1, 18, 525, 17340, 586177, 19896030, 675781821, 22956120408, 779829016225, 26491211221770, 899921240562957, 30570830315362260, 1038508305678375841, 35278711540581704598, 1198437683944896688125, 40711602541832856049200, 1382996048733983114022337 — A011906 at the Online Encyclopedia of Integer Sequences

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