I’m a Beweaver

Here are some examples of what I call woven sums for sum(n1..n2), where the digits of n1 are interwoven with the digits of n2:

1599 = sum(19..59) = 19 + 20 + 21 + 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
2716 = sum(21..76)
159999 = sum(199..599)
275865 = sum(256..785)
289155 = sum(295..815)
15050747 = sum(1004..5577)
15058974 = sum(1087..5594)
15999999 = sum(1999..5999)
39035479 = sum(3057..9349)


In other words, the digits of n1 occupy digit-positions 1,3,5… and the digits of n2 occupy dig-pos 2,4,6…

But I can’t find woven sums where the digits of n2 are interwoven with the digits of n1, i.e. the digits of n2 occupy dig-pos 1,3,5… and the digits of n1 occupy dig-pos 2,4,6… Except when n1 has fewer digits than n2, e.g. 210 = sum(1..20).


Elsewhere Other-Accessible…

Nuts for Numbers — a look at numbers like 2772 = sum(22..77) and 10470075 = sum(1075..4700).

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

Period Panes

In his Penguin Dictionary of Curious and Interesting Numbers (1986), David Wells says that 142857 is “beloved of all recreational mathematicians”. He then says it’s the decimal period of the reciprocal of the fourth prime: “1/7 = 0·142857142857142…” And the reciprocal has maximum period. There are 6 = 7-1 digits before repetition begins, unlike the earlier prime reciprocals:


1/2 = 0·5
1/3 = 0·333...
1/5 = 0·2
1/7 = 0·142857 142857 142...

In other words, all possible remainders appear when you calculate the decimals of 1/7:


1*10 / 7 = 1 remainder 3 → 0·1
3*10 / 7 = 4 remainder 2 → 0·14
2*10 / 7 = 2 remainder 6 → 0·142
6*10 / 7 = 8 remainder 4 → 0·1428
4*10 / 7 = 5 remainder 5 → 0·14285
5*10 / 7 = 7 remainder 1 → 0·142857
1*10 / 7 = 1 remainder 3 → 0·142857 1
3*10 / 7 = 4 remainder 2 → 0·142857 14
2*10 / 7 = 2 remainder 6 → 0·142857 142...

That happens again with 1/17 and 1/19, but Wells says that “surprisingly, there is no known method of predicting which primes have maximum period.” It’s a simple question that involves some deep mathematics. Looking at prime reciprocals is like peering through a small window into a big room. Some things are easy to see, some are difficult and some are presently impossible.

In his discussion of 142857, Wells mentions one way of peering through a period pane: “The sequence of digits also makes a striking pattern when the digits are arranged around a circle.” Here is the pattern, with ten points around the circle representing the digits 0 to 9:

The digits of 1/7 = 0·142857142…


But I prefer, for further peers through the period-panes, to create the period-panes using remainders rather than digits. That is, the number of points around the circle is determined by the prime itself rather than the base in which the reciprocal is calculated:

The remainders of 1/7 = 1, 3, 2, 6, 4, 5…


Period-panes can look like butterflies or bats or bivalves or spiders or crabs or even angels. Try the remainders of 1/13. This prime reciprocal doesn’t have maximum period: 1/13 = 0·076923 076923 076923… So there are only six remainders, creating this pattern:

remainders(1/13) = 1, 10, 9, 12, 3, 4


The multiple 2/13 has different remainders and creates a different pattern:

remainders(2/13) = 2, 7, 5, 11, 6, 8


But 1/17, 1/19 and 1/23 all have maximum period and yield these period-panes:

remainders(1/17) = 1, 10, 15, 14, 4, 6, 9, 5, 16, 7, 2, 3, 13, 11, 8, 12


remainders(1/19) = 1, 10, 5, 12, 6, 3, 11, 15, 17, 18, 9, 14, 7, 13, 16, 8, 4, 2


remainders(1/23) = 1, 10, 8, 11, 18, 19, 6, 14, 2, 20, 16, 22, 13, 15, 12, 5, 4, 17, 9, 21, 3, 7


It gets mixed again with the prime 73, which doesn’t have maximum period and yields a plethora of period-panes (some patterns repeat with different n * 1/73, so I haven’t included them):

remainders(1/73)


remainders(2/73)


remainders(3/73)


remainders(4/73)


remainders(5/73)


remainders(6/73)


remainders(9/73)


remainders(11/73) (identical to pattern of 5/73)


remainders(12/73)


remainders(18/73)


101 yields a plethora of period-panes, but they’re variations on a simple theme. They look like flapping wings in this animated gif:

remainders of n/101 (animated)


The remainders of 137 yield more complex period-panes:

remainders of n/137 (animated)


And what about different bases? Here are period-panes for the remainders of 1/17 in bases 2 to 16:

remainders(1/17) in base 2


remainders(1/17) in b3


remainders(1/17) in b4


remainders(1/17) in b5


remainders(1/17) in b6


remainders(1/17) in b7


remainders(1/17) in b8


remainders(1/17) in b9


remainders(1/17) in b10


remainders(1/17) in b11


remainders(1/17) in b12


remainders(1/17) in b13


remainders(1/17) in b14


remainders(1/17) in b15


remainders(1/17) in b16


remainders(1/17) in bases 2 to 16 (animated)


But the period-panes so far have given a false impression. They’ve all been symmetrical. That isn’t the case with all the period-panes of n/19:

remainders(1/19) in b2


remainders(1/19) in b3


remainders(1/19) in b4 = 1, 4, 16, 7, 9, 17, 11, 6, 5 (asymmetrical)


remainders(1/19) in b5 = 1, 5, 6, 11, 17, 9, 7, 16, 4 (identical pattern to that of b4)


remainders(1/19) in b6


remainders(1/19) in b7


remainders(1/19) in b8


remainders(1/19) in b9


remainders(1/19) in b10 (identical pattern to that of b2)


remainders(1/19) in b11


remainders(1/19) in b12


remainders(1/19) in b13


remainders(1/19) in b14


remainders(1/19) in b15


remainders(1/19) in b16


remainders(1/19) in b17


remainders(1/19) in b18


remainders(1/19) in bases 2 to 18 (animated)


Here are a few more period-panes in different bases:

remainders(1/11) in b2


remainders(1/11) in b7


remainders(1/13) in b6


remainders(1/43) in b6


remainders in b2 for reciprocals of 29, 37, 53, 59, 61, 67, 83, 101, 107, 131, 139, 149 (animated)


And finally, to performativize the pun of “period pane”, here are some period-panes for 1/29, whose maximum period will be 28 (NASA says that the “Moon takes about one month to orbit Earth … 27.3 days to complete a revolution, but 29.5 days to change from New Moon to New Moon”):

remainders(1/29) in b4


remainders(1/29) in b5


remainders(1/29) in b8


remainders(1/29) in b9


remainders(1/29) in b11


remainders(1/29) in b13


remainders(1/29) in b14


remainders(1/29) in various bases (animated)


Grow Fourth

Write the integers in groups of one, two, three, four… numbers like this:

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, 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


Now delete every second group:

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, 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…

↓↓↓

1, 4,5,6, 11,12,13,14,15, 22,23,24,25,26,27,28, 37,38,39,40,41,42,43,44,45, 56,57,58,59,60,61,62,63,64,65,66…


The sum of the first n remaining groups equals n^4:

1 = 1 = 1^4

1 + 4+5+6 = 16 = 2^4

1 + 4+5+6 + 11+12+13+14+15 = 81 = 3^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 = 256 = 4^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 = 625 = 5^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 = 1296 = 6^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 = 2401 = 7^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 + 106+107+108+109+110+111+112+113+114+115+116+117+118+119+120 = 4096 = 8^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 + 106+107+108+109+110+111+112+113+114+115+116+117+118+119+120 + 137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153 = 6561 = 9^4


From David Wells’ Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “81”

Back to LIFE

As pre-previously described on OotÜ-F, the English mathematician John Conway invented the Game of Life. It’s played on a grid of squares with counters. First you put counters on the grid in any pattern you please, random or regular, then you add or remove counters according to three simple rules applied to each square of the grid:

1. If an empty square has exactly three counters as neighbors, put a new counter on the square.
2. If a counter has two or three neighbors, leave it where it is.
3. If a counter has less than two or more than three neighbors, remove it from the grid.

There are lots of variants on Life and I wondered what would happen if you turned the grid into a kind of two-dimensional Pascal’s triangle. You start with 1 in the central square, then apply this rule to each square, [x,y], of the grid:

1. Add all numbers in the eight squares surrounding [x,y], then put that value in [x,y] (as soon as you’ve summed all other squares).

When a square is on the edge of the grid, its [x] or [y] value wraps to the opposite edge. Here’s this Pascal’s Life in action:

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

Pascal's square #1


0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

Pascal's square #2


0 0 0 0 0 0 0
0 1 2 3 2 1 0
0 2 2 4 2 2 0
0 3 4 8 4 3 0
0 2 2 4 2 2 0
0 1 2 3 2 1 0
0 0 0 0 0 0 0

Pascal's square #3


01 03 06 07 06 03 01
03 06 12 12 12 06 03
06 12 27 27 27 12 06
07 12 27 24 27 12 07
06 12 27 27 27 12 06
03 06 12 12 12 06 03
01 03 06 07 06 03 01

Pascal's square #4


021 038 056 067 056 038 021
038 070 100 124 100 070 038
056 100 132 168 132 100 056
067 124 168 216 168 124 067
056 100 132 168 132 100 056
038 070 100 124 100 070 038
021 038 056 067 056 038 021

Pascal's square #5


0285 0400 0560 0615 0560 0400 0285
0400 0541 0755 0811 0755 0541 0400
0560 0755 1070 1140 1070 0755 0560
0615 0811 1140 1200 1140 0811 0615
0560 0755 1070 1140 1070 0755 0560
0400 0541 0755 0811 0755 0541 0400
0285 0400 0560 0615 0560 0400 0285

Pascal's square #6


2996 3786 4697 5176 4697 3786 2996
3786 4785 5892 6525 5892 4785 3786
4697 5892 7153 7941 7153 5892 4697
5176 6525 7941 8840 7941 6525 5176
4697 5892 7153 7941 7153 5892 4697
3786 4785 5892 6525 5892 4785 3786
2996 3786 4697 5176 4697 3786 2996

Pascal's square #7


As you can see, the numbers quickly get big, so I adjusted the rule: sum the eight neighbors of [x,y], then put sum modulo 10 in [x,y]. The modulus of a number, n is its remainder when it’s divided by another number. For example, 3 modulo 10 = 3, 7 modulo 10 = 7, 10 modulo 10 = 0, 24 modulo 10 = 4, and so on. Pascal’s Life modulo 10 looks like this:

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

Pascal's square (n mod 10) #1


0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

Pascal's square (n mod 10) #2


0 0 0 0 0 0 0
0 1 2 3 2 1 0
0 2 2 4 2 2 0
0 3 4 8 4 3 0
0 2 2 4 2 2 0
0 1 2 3 2 1 0
0 0 0 0 0 0 0

Pascal's square (n mod 10) #3


1 3 6 7 6 3 1
3 6 2 2 2 6 3
6 2 7 7 7 2 6
7 2 7 4 7 2 7
6 2 7 7 7 2 6
3 6 2 2 2 6 3
1 3 6 7 6 3 1

Pascal's square (n mod 10) #4


1 8 6 7 6 8 1
8 0 0 4 0 0 8
6 0 2 8 2 0 6
7 4 8 6 8 4 7
6 0 2 8 2 0 6
8 0 0 4 0 0 8
1 8 6 7 6 8 1

Pascal's square (n mod 10) #5


5 0 0 5 0 0 5
0 1 5 1 5 1 0
0 5 0 0 0 5 0
5 1 0 0 0 1 5
0 5 0 0 0 5 0
0 1 5 1 5 1 0
5 0 0 5 0 0 5

Pascal's square (n mod 10) #6


6 6 7 6 7 6 6
6 5 2 5 2 5 6
7 2 3 1 3 2 7
6 5 1 0 1 5 6
7 2 3 1 3 2 7
6 5 2 5 2 5 6
6 6 7 6 7 6 6

Pascal's square (n mod 10) #7


7 5 3 3 3 5 7
5 9 5 1 5 9 5
3 5 1 7 1 5 3
3 1 7 6 7 1 3
3 5 1 7 1 5 3
5 9 5 1 5 9 5
7 5 3 3 3 5 7

Pascal's square (n mod 10) #8


Now add graphics and use n modulo 2 (where all even numbers → 0 and all odd numbers → 1). If you start with a 17×17 square with a square pattern of 1s, you’ll see it evolve like this when 0s are represented in black and 1s are represented in red:

n mod 2 on 17×17 square #1


n mod 2 #2


n mod 2 #3


n mod 2 #4


n mod 2 #5


n mod 2 #6


n mod 2 #7


n mod 2 #8


n mod 2 #9


n mod 2 #10


n mod 2 #11


n mod 2 #12


n mod 2 #13


n mod 2 #14


n mod 2 #15


n mod 2 #16


n mod 2 (animated)


As you can see, the original square re-appears. So do other patterns. Here’s an animated gif for n modulo 2 seeded with a pattern of 1s spelling LIFE:


Now try a spiral as the seed:

Spiral with n mod 2 #1


Spiral with n mod 2 #2


Spiral with n mod 2 #3


Spiral with n mod 2 #4


Spiral with n mod 2 #5


Spiral with n mod 2 #6


Spiral with n mod 2 #7


Spiral with n mod 2 #8


Spiral with n mod 2 #9


Spiral with n mod 2 #10


Spiral with n mod 2 #11


Spiral mod 2 (animated)


Now try the same pattern using modulo 3, where 0s are represented in black, 1s are represented in red and 2s in green. The pattern returns with different colors, i.e. with different underlying digits:

Spiral mod 3 on 27×27 square #1


Spiral mod 3 #2


Spiral mod 3 #3


Spiral mod 3 #4


Spiral mod 3 #5


Spiral mod 3 #6


Spiral mod 3 #7


Spiral mod 3 #8


Spiral mod 3 #9


Spiral mod 3 #10


Spiral mod 3 #11

[…]

Spiral mod 3 #19

[…]

Spiral mod 3 #28

[…]

Spiral mod 3 #37

[…]

Spiral mod 3 #46


Spiral mod 3 (animated)


LIFE mod 3 (animated)


Now try n modulo 5, with 0s represented in black, 1s represented in red, 2s in green, 3s in yellow and 4s in dark blue. Again the pattern returns in different colors:

Spiral mod 5 on 25×25 square #1


Spiral mod 5 #2


Spiral mod 5 #3


Spiral mod 5 #4


Spiral mod 5 #5


Spiral mod 5 #6

[…]

Spiral mod 5 #26

[…]

Spiral mod 5 #31

[…]

Spiral mod 5 #76

[…]

Spiral mod 5 #81


Spiral mod 5 (animated)


Finally, try a svastika modulo 7, with 0s represented in black, 1s represented in red, 2s in green, 3s in yellow, 4s in dark blue, 5s in purple and 6s in light blue:

Svastika mod 7 on 49×49 square #1


Svastika mod 7 #2


Svastika mod 7 #3


Svastika mod 7 #4


Svastika mod 7 #5


Svastika mod 7 #6


Svastika mod 7 #7


Svastika mod 7 #8

[…]

Svastika mod 7 #15

[…]

Svastika mod 7 #22

[…]

Svastika mod 7 #29

[…]

Svastika mod 7 #36

[…]

Svastika mod 7 #43


Svastika mod 7 (animated)


Previously Pre-Posted…

Eternal LIFE — a first look at the Game of Life

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)

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)