Blancmange Butterfly

Blancmange butterfly. Is that a ’60s psychedelic band? No, it’s one of the shapes you can get by playing with blancmange curves. As I described in “White Rites”, a blancmange curve is a fractal created by summing the heights of successively smaller and more numerous zigzags, like this:

blanc_all

Zigzags 1 to 10


blancmange_all

Zigzags 1 to 10 (animated)


blanc_solid

Blancmange curve


In the blancmange curves below, the height (i.e., the y co-ordinate) has been normalized so that all the images are the same height:









Construction of a normalized blancmange curve (animated)


This is the solid version:









Solid normalized blancmange curve (animated)


I wondered what happens when you wrap a blancmange curve around a circle. Well, this happens:









Construction of a blancmange circle (animated)


You get what might be called a blancmange butterfly. The solid version looks like this (patterns in the circles are artefacts of the graphics program I used):









Solid blancmange circle (animated)


Next I tried using arcs rather zigzags to construct the blancmange curves and blancmange circles:









Arching blancmange curve (i.e., constructed with arcs) (animated)


And below is the circular version of a blancmange curve constructed with arcs. The arching circular blancmanges look even more like buttocks and then intestinal villi (the fingerlike projections lining our intestines):









Arching blancmange circle (animated)


The variations on blancmange curves don’t stop there — in fact, they’re infinite. Below is a negative arching blancmange curve, where the heights of the original arching blancmange curve are subtracted from the (normalized) maximum height:








Negative arching blancmange curve (animated)


And here’s an arching blancmange curve that’s alternately negative and positive:








Negative-positive arching blancmange curve (animated)


The circular version looks like this:










Negative-positive arching blancmange circle (animated)


Finally, here’s an arching blancmange curve that’s alternately positive and negative:









Positive-negative arching blancmange curve (animated)


And the circular version:











Positive-negative arching blancmange circle (animated)


Elsewhere Other-Accessible…

White Rites — more variations on blancmange curves

Nuts for Numbers

I was looking at palindromes created by sums of consecutive integers. And I came across this beautiful result:

2772 = sum(22..77)


2772 = 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77

You could call 2772 a nutty sum, because 77 is held inside 22 like a kernel inside a nutshell. Here some more nutty sums, sum(n1..n2), where n2 is a kernel in the shell of n1:

1599 = sum(19..59)
2772 = sum(22..77)
22113 = sum(23..211)
159999 = sum(199..599)
277103 = sum(203..771)
277722 = sum(222..777)
267786 = sum(266..778)
279777 = sum(277..797)
1152217 = sum(117..1522)
1152549 = sum(149..1525)
1152767 = sum(167..1527)
4296336 = sum(436..2963)
5330303 = sum(503..3303)
6235866 = sum(626..3586)
8418316 = sum(816..4183)
10470075 = sum(1075..4700)
11492217 = sum(1117..4922)
13052736 = sum(1306..5273)
13538277 = sum(1377..5382)
14557920 = sum(1420..5579)
15999999 = sum(1999..5999)
25175286 = sum(2516..7528)
26777425 = sum(2625..7774)
27777222 = sum(2222..7777)
37949065 = sum(3765..9490)
53103195 = sum(535..10319)
111497301 = sum(1101..14973)

Of course, you can go the other way and find nutty sums where sum(n1..n2) produces n1 as a kernel inside the shell of n2:

147 = sum(4..17)
210 = sum(1..20)
12056 = sum(20..156)
13467 = sum(34..167)
22797 = sum(79..227)
22849 = sum(84..229)
26136 = sum(61..236)
1145520 = sum(145..1520)
1208568 = sum(208..1568)
1334667 = sum(334..1667)
1540836 = sum(540..1836)
1931590 = sum(315..1990)
2041462 = sum(414..2062)
2041863 = sum(418..2063)
2158083 = sum(158..2083)
2244132 = sum(244..2132)
2135549 = sum(554..2139)
2349027 = sum(902..2347)
2883558 = sum(883..2558)
2989637 = sum(989..2637)

When you look at nutty sums in other bases, you’ll find that the number “210” is always triangular and always a nutty sum in bases > 2:

210 = sum(1..20) in b3 → 21 = sum(1..6) in b10
210 = sum(1..20) in b4 → 36 = sum(1..8) in b10
210 = sum(1..20) in b5 → 55 = sum(1..10) in b10
210 = sum(1..20) in b6 → 78 = sum(1..12) in b10
210 = sum(1..20) in b7 → 105 = sum(1..14) in b10
210 = sum(1..20) in b8 → 136 = sum(1..16) in b10
210 = sum(1..20) in b9 → 171 = sum(1..18) in b10
210 = sum(1..20) in b10
210 = sum(1..20) in b11 → 253 = sum(1..22) in b10
210 = sum(1..20) in b12 → 300 = sum(1..24) in b10
210 = sum(1..20) in b13 → 351 = sum(1..26) in b10
210 = sum(1..20) in b14 → 406 = sum(1..28) in b10
210 = sum(1..20) in b15 → 465 = sum(1..30) in b10
210 = sum(1..20) in b16 → 528 = sum(1..32) in b10
210 = sum(1..20) in b17 → 595 = sum(1..34) in b10
210 = sum(1..20) in b18 → 666 = sum(1..36) in b10
210 = sum(1..20) in b19 → 741 = sum(1..38) in b10
210 = sum(1..20) in b20 → 820 = sum(1..40) in b10
[…]

Why is 210 always a nutty sum like that? Because the formula for sum(n1..n2) is (n1*n2) * (n2-n1+1) / 2. In all bases > 2, the sum of 1 to 20 (where 20 = 2 * b) is therefore:

(1+20) * (20-1+1) / 2 = 21 * 20 / 2 = 21 * 10 = 210

And here are nutty sums of both kinds (n1 inside n2 and n2 inside n1) for base 8:

210 = sum(1..20) in b8 → 136 = sum(1..16) in b10
12653 = sum(26..153) → 5547 = sum(22..107)
23711 = sum(71..231) → 10185 = sum(57..153)
2022323 = sum(223..2023) → 533715 = sum(147..1043)
2032472 = sum(247..2032) → 537914 = sum(167..1050)
2271564 = sum(715..2264) → 619380 = sum(461..1204)
2307422 = sum(742..2302) → 626450 = sum(482..1218)
125265253 = sum(2526..15253) → 22375083 = sum(1366..6827)


3246710 = sum(310..2467) in b8 → 871880 = sum(200..1335)
in b10
5326512 = sum(512..3265) → 1420618 = sum(330..1717)
15540671 = sum(1571..5406) → 3588537 = sum(889..2822)
21625720 = sum(2120..6257) → 4664272 = sum(1104..3247)

And for base 9:

125 = sum(2..15) in b9 → 104 = sum(2..14) in b10
210 = sum(1..20) → 171 = sum(1..18)
12858 = sum(28..158) → 8720 = sum(26..134)
1128462 = sum(128..1462) → 609824 = sum(107..1109)
1288588 = sum(288..1588) → 708344 = sum(242..1214)
1475745 = sum(475..1745) → 817817 = sum(392..1337)
2010707 = sum(107..2007) → 1070017 = sum(88..1465)
2034446 = sum(344..2046) → 1085847 = sum(283..1500)
2040258 = sum(402..2058) → 1089341 = sum(326..1511)
2063410 = sum(341..2060) → 1104768 = sum(280..1512)
2215115 = sum(215..2115) → 1191281 = sum(176..1553)
2255505 = sum(555..2205) → 1217840 = sum(455..1625)
2475275 = sum(475..2275) → 1348880 = sum(392..1688)
2735455 = sum(735..2455) → 1499927 = sum(599..1832)


1555 = sum(15..55) in b9 → 1184 = sum(14..50) in b10
155858 = sum(158..558) → 96200 = sum(134..458)
1148181 = sum(181..1481) → 622720 = sum(154..1126)
2211313 = sum(213..2113) → 1188525 = sum(174..1551)
2211747 = sum(247..2117) → 1188880 = sum(205..1555)
6358585 = sum(685..3585) → 3404912 = sum(563..2669)
7037453 = sum(703..3745) → 3745245 = sum(570..2795)
7385484 = sum(784..3854) → 3953767 = sum(643..2884)
13518167 = sum(1367..5181) → 6685072 = sum(1033..3799)
15588588 = sum(1588..5588) → 7794224 = sum(1214..4130)
17603404 = sum(1704..6034) → 8859865 = sum(1300..4405)
26750767 = sum(2667..7507) → 13201360 = sum(2005..5515)


Post-Performative Post-Scriptum…

Viz ’s Mr Logic would be a fan of nutty sums. And unlike real nuts, they wouldn’t prove fatal:

Mr Logic Goes Nuts (strip from Viz comic)

(click for full-size)

Square Pairs

Girard knew and Fermat a few years later proved the beautiful theorem that every prime of the form 4n + 1; that is, the primes 5, 13, 17, 29, 37, 41, 53… is the sum of two squares in exactly one way. Primes of the form 4n + 3, such as 3, 7, 11, 19, 23, 31, 43, 47… are never the sum of two squares. — David Wells, The Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “13”.


Elsewhere other-accessible…

Fermat’s theorem on sums of two squares
Pythagorean primes

Bi-Bell Basics

Here’s what you might call a Sisyphean sequence. It struggles upward, then slips back, over and over again:

1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2...


The struggle goes on for ever. Every time it reaches a new maximum, it will fall back to 1 at the next step. And in fact 1, 2, 3 and all other integers occur infinitely often in the sequence, because it represents the digit-sums of binary numbers:

1 ← 1
1 = 1+0 ← 10 in binary = 2 in base ten
2 = 1+1 ← 11 = 3
1 = 1+0+0 ← 100 = 4
2 = 1+0+1 ← 101 = 5
2 = 1+1+0 ← 110 = 6
3 = 1+1+1 ← 111 = 7
1 = 1+0+0+0 ← 1000 = 8
2 = 1+0+0+1 ← 1001 = 9
2 = 1+0+1+0 ← 1010 = 10
3 = 1+0+1+1 ← 1011 = 11
2 = 1+1+0+0 ← 1100 = 12
3 = 1+1+0+1 ← 1101 = 13
3 = 1+1+1+0 ← 1110 = 14
4 = 1+1+1+1 ← 1111 = 15
1 = 1+0+0+0+0 ← 10000 = 16
2 = 1+0+0+0+1 ← 10001 = 17
2 = 1+0+0+1+0 ← 10010 = 18
3 = 1+0+0+1+1 ← 10011 = 19
2 = 1+0+1+0+0 ← 10100 = 20


Now here’s a related sequence in which all integers do not occur infinitely often:

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


The sequence represents the sum of the values of occupied columns in the binary numbers, reading from right to left:

10 in binary = 2 in base ten
21 (column values from right to left)
2*1 + 1*0 = 2


11 = 3
21
2*1 + 1*1 = 3


100 = 4
321 (column values from right to left)
3*1 + 2*0 + 1*0 = 3


101 = 5
321
3*1 + 2*0 + 1*1 = 4


110 = 6
321
3*1 + 2*1 + 1*0 = 5


111 = 7
321
3*1 + 2*1 + 1*1 = 6


1000 = 8
4321
4*1 + 3*0 + 2*0 + 1*0 = 4


1001 = 9
4321
4*1 + 3*0 + 2*0 + 1*1 = 5


1010 = 10
4321
4*1 + 3*0 + 2*1 + 1*0 = 6


1011 = 11
4321
4*1 + 3*0 + 2*1 + 1*1 = 7


1100 = 12
4321
4*1 + 3*1 + 2*0 + 1*0 = 7


1101 = 13
4321
4*1 + 3*1 + 2*0 + 1*1 = 8


1110 = 14
4321
4*1 + 3*1 + 2*1 + 1*0 = 9


1111 = 15
4321
4*1 + 3*1 + 2*1 + 1*1 = 10


10000 = 16
54321
5*1 + 4*0 + 3*0 + 2*0 + 1*0 = 5


In that sequence, although no number occurs infinitely often, some numbers occur more often than others. If you represent the count of sums up to a certain digit-length as a graph, you get a famous shape:

Bell curve formed by the count of column-sums in base 2


Bi-bell curves for 1 to 16 binary digits (animated)


In “Pi in the Bi”, I looked at that way of forming the bell curve and called it the bi-bell curve. Now I want to go further. Suppose that you assign varying values to the columns and try other bases. For example, what happens if you assign the values 2^p + 1 to the columns, reading from right to left, then use base 3 to generate the sums? These are the values of 2^p + 1:

2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025...


And here’s an example of how you generate a column-sum in base 3:

2102 in base 3 = 65 in base ten
9532 (column values from right to left)
2*9 + 1*5 + 0*3 + 2*2 = 27


The graphs for these column-sums using base 3 look like this as the digit-length rises. They’re no longer bell-curves (and please note that widths and heights have been normalized so that all graphs fit the same space):

Graph for the count of column-sums in base 3 using 2^p + 1 (digit-length <= 7)

(width and height are normalized)


Graph for base 3 and 2^p + 1 (dl<=8)


Graph for base 3 and 2^p + 1 (dl<=9)


Graph for base 3 and 2^p + 1 (dl<=10)


Graph for base 3 and 2^p + 1 (dl<=11)


Graph for base 3 and 2^p + 1 (dl<=12)


Graph for base 3 and 2^p + 1 (animated)


Now try base 3 and column-values of 2^p + 2 = 3, 4, 6, 10, 18, 34, 66, 130, 258, 514, 1026…

Graph for base 3 and 2^p + 2 (dl<=7)


Graph for base 3 and 2^p + 2 (dl<=8)


Graph for base 3 and 2^p + 2 (dl<=9)


Graph for base 3 and 2^p + 2 (dl<=10)


Graph for base 3 and 2^p + 2 (animated)


Now try base 5 and 2^p + 1 for the columns. The original bell curve has become like a fractal called the blancmange curve:

Graph for base 5 and 2^p + 1 (dl<=7)


Graph for base 5 and 2^p + 1 (dl<=8)


Graph for base 5 and 2^p + 1 (dl<=9)


Graph for base 5 and 2^p + 1 (dl<=10)


Graph for base 5 and 2^p + 1 (animated)


And finally, return to base 2 and try the Fibonacci numbers for the columns:

Graph for base 2 and Fibonacci numbers = 1,1,2,3,5… (dl<=7)


Graph for base 2 and Fibonacci numbers (dl<=9)


Graph for base 2 and Fibonacci numbers (dl<=11)


Graph for base 2 and Fibonacci numbers (dl<=13)


Graph for base 2 and Fibonacci numbers (dl<=15)


Graph for base 2 and Fibonacci numbers (animated)


Previously Pre-Posted…

Pi in the Bi — bell curves generated by binary digits

The Odd Couple

12,285

Together with 14,595 the smallest pair of odd amicable numbers, discovered by [the American mathematician] B.H. Brown in 1939. — The Penguin Dictionary of Curious and Interesting Numbers, David Wells (1986)