# Agogic Arithmetic

This is one of my favorite integer sequences:

• 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, 1326, 1378, 1431, ... — A000217 at OEIS

And it’s easy to work out the rule that generates the sequence. It’s the sequence of triangular numbers, of course, which you get by summing the integers:

1
1 + 2 = 3
3 + 3 = 6
6 + 4 = 10
10 + 5 = 15
15 + 6 = 21
21 + 7 = 28
28 + 8 = 36
36 + 9 = 45
[...]

I like this sequence too, but it isn’t a sequence of integers and it’s much harder to work out the rule that generates it:

• 1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520, 7381/2520, 83711/27720, 86021/27720, 1145993/360360, 1171733/360360...

But you could say that it’s the inverse of the triangular numbers, because you generate it like this:

1
1 + 1/2 = 3/2
3/2 + 1/3 = 11/6
11/6 + 1/4 = 25/12
25/12 + 1/5 = 137/60
137/60 + 1/6 = 49/20
49/20 + 1/7 = 363/140
363/140 + 1/8 = 761/280
761/280 + 1/9 = 7129/2520
[...]

It’s the harmonic series, which is defined at Wikipedia as “the infinite series formed by summing all positive unit fractions”. I can’t understand its subtleties or make any important discoveries about it, but I thought I could ask (and begin to answer) a question that perhaps no-one else in history had ever asked: When are the leading digits of the k-th harmonic number, hs(k), equal to the digits of k in base 10?

hs(1) = 1
hs(43) = 4.349...
hs(714) = 7.1487...
hs(715) = 7.1501...
hs(9763) = 9.76362...
hs(122968) = 12.296899...
hs(122969) = 12.296907...
hs(1478366) = 14.7836639...
hs(17239955) = 17.23995590...
hs(196746419) = 19.6746419...
hs(2209316467) = 22.0931646788...

Do those numbers have any true mathematical significance? I doubt it. But they were fun to find, even though I wasn’t the first person in history to ask about them:

• 1, 43, 714, 715, 9763, 122968, 122969, 1478366, 17239955, 196746419, 2209316467, 24499118645, 268950072605 — A337904 at OEIS, Numbers k such that the decimal expansion of the k-th harmonic number starts with the digits of k, in the same order.

# 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)…