<commit_before>---
title: "2, 3, 4, 82000, ?"
layout: post
---

I know what you're thinking.
"I need more arbitrary math in my life for the sake of being a nerd."
Alright, maybe you've never thought that, but I recently watched a
[Numberphile video](https://www.youtube.com/watch?v=LNS1fabDkeA) about a quite
interesting sequence of numbers.
(Incidentally, if you have thought that, you are really in for a treat.)
The sequence begins **2, 3, 4, 82000**, which follows a well-defined mathematical
rule.
It piqued my interest partially just because I enjoy the Numberphile youtube channel,
but mainly because the number 82000 seems to come out of nowhere in this sequence.
No one knows what the next number of the sequence is or if there even is a next
number!

So how is this sequence defined, anyway?
First, I'll quote
[The On-line Encyclopedia of Integer Sequences](https://oeis.org/A258107) which
defines the sequence such that the n<sup>th</sup> integer is the smallest
"number > 1 whose representation in all bases up to n consists only
of zeros and ones.''
To understand this, we need to figure out what it means to write a number in a
certain base.

In everyday life, we write numbers in base-10, where each of the digits can be
any number between 0 and 9.
Most likely this choice was made because we have 10 fingers, but it's not the
only system people have chosen in the past.
The Babylonians had a base-60 system, the Mayans used a base-20 system
("four score and seven years" is essentially 87 in base-20),
and some Indian tribes have
used base-8, just to list a few different systems.

Let's consider base-8 as an example for the moment.
The digits 372 in base-8 denote the number $$3*8^2 + 7 * 8^1 + 2 * 8^0 = 250$$.
Generally, a number in base-$$b$$ with digits $$d_1 \dotsb d_n $$ denotes
the number $$ d_1 b^{n-1} + d_2 b^{n-2} + \dotsb + d_n b^0 $$.
That's all we need to know to understand this fascinating sequence of integers.

It turns out that base-1 is the same as counting, since $$ 1^n = 1$$, meaning that
a number in base-1 is the same as the sum of its digits.
The sequence therefore starts with base-2.
In base-2 (binary), the smallest number whose representation in all bases up to 2
consists of only zeros and ones turns out to be the number 2.
In base-2, the number 2 has the representation $$ (10)_2 $$, so the first element
of the sequence is 2.
You may have realized that base-2 is a trivial case, since the only available
numbers in base-2 are zero and one.

Continuing, the next number of the sequence is the smallest number that is
represented in bases 2 and 3 with only zeros and ones, which is the number 3.
Likewise, the following number is number 4.
Below is a table summarizing the first three integers in the sequence:

| Decimal number | base-2 | base-3 | base-4 |
| :---: | :---: | :---: | :---: |
| 2 | <span style="color: green">10</span> |  |  |
| 3 | <span style="color: green">11</span> | <span style="color: green">10</span> |  |
| 4 | <span style="color: green">100</span> | <span style="color: green">11</span> | <span style="color: green">10</span> |

Here's where the sequence gets interesting.
You might expect the next integer in the sequence would be the number 5, but let's
look at its representation in bases 2 through 5 (which is the rule for the sequence):

| Decimal number | base-2 | base-3 | base-4 | base-5 |
| :---: | :---: | :---: | :---: | :---: |
| 5 | <span style="color: green">101</span> | <span style="color: red">12</span> | <span style="color: green">11</span> | <span style="color: green">10</span> |

Notice that in base-3, the representation of 5 has a two, which is against the rule.

As it turns out, the smallest number satisfying bases 2 through 5 is 82,000.

| 82000 in different bases |
| :---: | --- |
| base-2 | 10100000001010000 |
| base-3 | 11011111001 |
| base-4 | 110001100 |
| base-5 | 10111000 |

In all of these bases, 82000's representation only has zeros and ones.

So what's the next number following the rule for bases 2 through 6?
At the moment it's not known what it is, nor if there even is a next number!
I've written a program to "intelligently" brute-force to try to find it, but
no luck so far.
Pretty soon I'll make a post describing my code and my search progress.



<commit_msg>Add one clarifying sentence to 82000<commit_after>---
title: "2, 3, 4, 82000, ?"
layout: post
---

I know what you're thinking.
"I need more arbitrary math in my life for the sake of being a nerd."
Alright, maybe you've never thought that, but I recently watched a
[Numberphile video](https://www.youtube.com/watch?v=LNS1fabDkeA) about a quite
interesting sequence of numbers.
(Incidentally, if you have thought that, you are really in for a treat.)
The sequence begins **2, 3, 4, 82000**, which follows a well-defined mathematical
rule.
It piqued my interest partially just because I enjoy the Numberphile youtube channel,
but mainly because the number 82000 seems to come out of nowhere in this sequence.
No one knows what the next number of the sequence is or if there even is a next
number!

So how is this sequence defined, anyway?
First, I'll quote
[The On-line Encyclopedia of Integer Sequences](https://oeis.org/A258107) which
defines the sequence such that the n<sup>th</sup> integer is the smallest
"number > 1 whose representation in all bases up to n consists only
of zeros and ones.''
To understand this, we need to figure out what it means to write a number in a
certain base.

In everyday life, we write numbers in base-10, where each of the digits can be
any number between 0 and 9.
Most likely this choice was made because we have 10 fingers, but it's not the
only system people have chosen in the past.
The Babylonians had a base-60 system, the Mayans used a base-20 system
("four score and seven years" is essentially 87 in base-20),
and some Indian tribes have
used base-8, just to list a few different systems.

Let's consider base-8 as an example for the moment.
The digits 372 in base-8 denote the number $$3*8^2 + 7 * 8^1 + 2 * 8^0 = 250$$.
Generally, a number in base-$$b$$ with digits $$d_1 \dotsb d_n $$ denotes
the number $$ d_1 b^{n-1} + d_2 b^{n-2} + \dotsb + d_n b^0 $$.
That's all we need to know to understand this fascinating sequence of integers.

It turns out that base-1 is the same as counting, since $$ 1^n = 1$$, meaning that
a number in base-1 is the same as the sum of its digits.
The sequence therefore starts with base-2.
In base-2 (binary), the smallest number whose representation in all bases up to 2
consists of only zeros and ones turns out to be the number 2.
In base-2, the number 2 has the representation $$ (10)_2 $$, so the first element
of the sequence is 2.
You may have realized that base-2 is a trivial case, since the only available
numbers in base-2 are zero and one.

Continuing, the next number of the sequence is the smallest number that is
represented in bases 2 and 3 with only zeros and ones, which is the number 3.
Likewise, the following number is number 4.
Below is a table summarizing the first three integers in the sequence:

| Decimal number | base-2 | base-3 | base-4 |
| :---: | :---: | :---: | :---: |
| 2 | <span style="color: green">10</span> |  |  |
| 3 | <span style="color: green">11</span> | <span style="color: green">10</span> |  |
| 4 | <span style="color: green">100</span> | <span style="color: green">11</span> | <span style="color: green">10</span> |

Here's where the sequence gets interesting.
You might expect the next integer in the sequence would be the number 5, but let's
look at its representation in bases 2 through 5 (which is the rule for the sequence):

| Decimal number | base-2 | base-3 | base-4 | base-5 |
| :---: | :---: | :---: | :---: | :---: |
| 5 | <span style="color: green">101</span> | <span style="color: red">12</span> | <span style="color: green">11</span> | <span style="color: green">10</span> |

Notice that in base-3, the representation of 5 has a two, which is against the rule.

As it turns out, the smallest number satisfying bases 2 through 5 is 82,000.

| 82000 in different bases |
| :---: | --- |
| base-2 | 10100000001010000 |
| base-3 | 11011111001 |
| base-4 | 110001100 |
| base-5 | 10111000 |

In all of these bases, 82000's representation only has zeros and ones.

So what's the next number following the rule for bases 2 through 6?
Unfortunately 82000 in base-6 is 1431344, which clearly is not made of only
zeros and ones.
At the moment it's not known what it is, nor if there even is a next number!
I've written a program to "intelligently" brute-force to try to find it, but
no luck so far.
Pretty soon I'll make a post describing my code and my search progress.




{'fraction_non_alphanumeric': 0.10001150880423525, 'fraction_numerical': 0.04649556911036943, 'mean_word_length': 3.790518191841235, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 49, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3484571', 'n_tokens_mistral': 2882, 'n_tokens_neox': 2528, 'n_words': 1351}