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”

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)

Summer Set Sequence

I wondered what would happen if you added to a set of numbers, (a, b, c), the first number that wasn’t equal to the sum of any subset of the numbers: a + b, a + c, c + b, a + b + c. If the set begins with 1, the first number not equal to any subset of (1) is 2. So the set becomes (1, 2). 3 = 1 + 2, so 3 is not added. But 4 is added, making the set (1, 2, 4). The sequence of additions goes like this:

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536…

It’s the powers of 2, because some subset of the powers of 2 < 2^p will equal any number from 1 to (2^p)-1, therefore the first addition will be 2^p = the cumulative sum + 1:

1 (cumulative sum=1), 2 (cs=3), 4 (cs=7), 8 (cs=15), 16 (cs=31), 32 (cs=63), 64 (cs=127), 128 (cs=255), 256 (cs=511), 512 (cs=1023), 1024 (cs=2047), 2048 (cs=4095), 4096 (cs=8191), 8192 (cs=16383), 16384 (cs=32767), 32768 (cs=65535)…

If you seed the sequence with the set (2), the first addition is 3, but after that the powers of 2 re-appear:

2, 3, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536…

It becomes more complicated if the sequence is seeded with the set (3):

3, 4, 5, 6, 16, 17, 49, 50, 148, 149, 445, 446, 1336, 1337, 4009, 4010, 12028, 12029, 36085, 36086…

You can predict the pattern by looking at the cumulative sums again:

3, 4, 5, 6 (cumulative sum=18), 16, 17 (cs=51), 49, 50 (cs=150), 148, 149 (cs=447), 445, 446 (cs=1338), 1336, 1337 (cs=4011), 4009, 4010 (cs=12030), 12028, 12029 (cs=36087), 36085, 36086 (cs=108258)…

The sequence begins with a block of four consecutive numbers, followed by separate blocks of two consecutive numbers. The first number in each 2-block is predicted by the cumulative sum of the last number in the previous block, according to the formula n = cumulative sum – seed + 1. When the seed is 3, n = cs-3+1.

If the seed is 4, the sequences goes like this:

4, 5, 6, 7, 8, 27, 28, 29, 111, 112, 113, 447, 448, 449, 1791, 1792, 1793, 7167, 7168, 7169…

Now the sequence begins with a block of five consecutive numbers, followed by separate blocks of three consecutive numbers. The formula is n = cs-4+1:

4, 5, 6, 7, 8 (cumulative sum=30), 27, 28, 29 (cs=114), 111, 112, 113 (cs=450), 447, 448, 449 (cs=1794), 1791, 1792, 1793 (cs=7170), 7167, 7168, 7169 (cs=28674)…

And here’s the sequence seeded with (5):

5, 6, 7, 8, 9, 10, 41, 42, 43, 44, 211, 212, 213, 214, 1061, 1062, 1063, 1064, 5311, 5312, 5313, 5314…

5, 6, 7, 8, 9, 10 (cs=45), 41, 42, 43, 44 (cs=215), 211, 212, 213, 214 (cs=1065), 1061, 1062, 1063, 1064 (cs=5315), 5311, 5312, 5313, 5314 (cs=26565)…