998,001
I learned something today that just blows… my… mind. If you take 1 and divide it by 998,001, you get an irrational number; but not just any irrational number! If you look at the digits after the decimal point and group them into threes, they make a sequence of numbers that starts with 000 and goes through to 999 – sequentially! Well, all except 998.
And after the pattern reaches 999, it starts again at 000 and continues back to 999 (except for 998). Then it starts again at 000 and… Well, you get the picture. It just keeps going on and on forever. A tweet had come across my feed which had brought this to my attention:
OMG 😱 If you divide 1 by 998,001 you get all three-digit numbers from 000 to 999 in order, except for 998.
— Math Lady Hazel 🇦🇷 (@mathladyhazel) August 26, 2020
Of course, I just had to write a little program to verify this. It was just too wild for me to accept without proof. So, first I made a little snippet of JavaScript code [of course] which runs through the manual steps I would perform for long division – the old-school way, not any of this “new-math” stuff – and then convert each triple-digit segment to integer and make sure they were sequential:
let n = 1,
d = 998001,
s = '',
c = 3*999 + 1;
while(n && c--){
s += Math.floor(n/d);
n = n%d*10;
}
s.substr(1)
.replace(/\d{3}/g, d => `${d} `)
.trim()
.split(' ')
.map(d => parseInt(d,10))
.forEach((x, i, a) => {
if(x && x !== a[i-1] + 1 && x !== 999) {
console.log(`NOPE! ${x}`);
}
});
It checks out! Then I thought to myself, “What happens after the ‘999’? Does it stop? Does it keep going? Does it repeat?” Why, YES! It repeats! It cycles back to “000” and then just keeps repeating on… forever.
Anyhow, being a total nerd, this kind of thing Rocks. My. World.