People invented numbers, and the rules you learned in school are one choice. Change a single rule and you get a different number system, just as solid, that mathematicians have used for over a century. In that one, 1 ÷ 7 is a whole number.
Grab a calculator. This takes two minutes, and you'll see it happen.
1. Square 5. Then keep going.
5 × 5 = 25
25 × 25 = 625
625 × 625 = 390625
390625 × 390625 = 152587890625
Look at the end of each answer. It stops changing. …625 shows up and never leaves, then …90625, then …890625. Each step locks in at least one more digit on the right, sometimes several at once.
Keep squaring forever and the ending freezes into one endless number that runs off to the left:
…918212890625
and here's the weird part: that number is its own square. Check the last few digits yourself:
90625 × 90625 = 8212890625 ← ends in 90625 again
2. It has a twin
There's exactly one other ending like that (besides 0 and 1). It starts from 6:
9376 × 9376 = 87909376 ← ends in 9376 again
Now add the two endings:
90625 + 9376 = 100001
Carry that on forever and the twins …918212890625 and …081787109376 add up to exactly 1. Multiply them and you get exactly 0. Two numbers, neither of them zero, that multiply to zero.
3. Now 1 ÷ 7
Everyone knows this one:
1 ÷ 7 = 0.142857142857…
The digits 142857 repeat to the right, forever. Now divide these by 7:
1001 ÷ 7 = 143
1000000001 ÷ 7 = 142857143
1000000000000001 ÷ 7 = 142857142857143
Same digits. Except now they grow to the left.
Carry it on forever and you get …142857142857143, a number with no decimal point that, times 7, is exactly 1. In the world where digits run left forever, 1 ÷ 7 is a whole number.
(Try 1001 ÷ 11 and 1000000001 ÷ 13 against 1 ÷ 11 and 1 ÷ 13. Same trick.)
This isn't crank maths. It's 129 years old.
These are the 10-adic numbers, the base-10 cousin of the p-adic numbers Kurt Hensel introduced in 1897. One rule changes: two numbers count as close when their endings match. In that world, …999999 is -1, …666667 is 1/3, and …890625 is a perfectly good number that equals its own square (it's called an automorphic number).
Your calculator can only ever see the last few digits, so it can't play here. So I built something that can.
Past Forever: infinite loops that finish
Past Forever is a tiny language where you write the loop that never ends, and it hands you the answer after forever. Then your program keeps going.
x = 5
forever: x = x × x
show x
show x × x = x
…918212890625
yes (proved)
x = 1 / 7
show x
show x × 7
…857142857143 (this is 1/7)
1
x = 0 step = 9
forever: x = x + step step = step × 10
show x
show x + 1
…999999999999 (this is -1)
0
It never stores infinitely many digits. It finds the pattern and proves where it goes. That's why your calculator rounds, and Past Forever doesn't.
It's allowed to say "I don't know"
Every forever loop ends in one of three honest answers:
| answer | example | what it prints |
|---|---|---|
| a number, with proof | square 5 forever | …918212890625 |
| never settles, with proof | square 6 forever |
never settles (the last two digits go 36, 96, 16, 56 forever) |
| can't see the end | 196, reverse and add forever | can't see the end |
Searches over infinitely many numbers work too:
found = no n = 0
forever: n = n + 1 if n × n ends in 7: found = yes
show found
no (proved)
That checked every square there is. Ask why found and it shows its work: the last digit of a square repeats every 10 steps, so 10 cases cover forever, and none of them ends in 7.
Hunting liars
Point it at a whole range at once:
hunt c from 0 to 99:
x = 0
forever: x = x × x + c
show x
hunt c from 0 to 99: tried 100 numbers, 5 kinds of answer
settles 10 0, 10, 20, 30, 40, 50, 60, 70, …
ring of 6 10 1, 11, 21, 31, 41, 51, 61, 71, …
goes wild 40 2, 3, 7, 8, 12, 13, 17, 18, …
ring of 2 30 4, 5, 9, 14, 15, 19, 24, 25, …
ring of 3 10 6, 16, 26, 36, 46, 56, 66, 76, …
Some of the wild ones are liars. Their last digits go round a calm ring of 2, digit after digit, and then one digit breaks the pattern. With c = 85205078123, the last 13 digits behave perfectly before it goes wild. The calmest liar found so far, c = 1280715354564332311432, keeps it up for 31 digits.
Break it (please)
A language that says "proved" had better be right. Every build, a robot referee throws 3,000 random loops at it and checks every answer against plain arithmetic. Outside AIs were invited to break it, and two found real gaps: a loop that starts on its own answer, and a change hidden past digit 40. Both are fixed, and both are in the Hall of Fame.
Your turn. Get in the Hall of Fame by finding:
- a loop where it says
provedand is wrong, - a loop where it says
can't see the endbut you can, or - a liar calmer than 31 digits.
Try it in your browser, no install, works on a phone: connabyss.github.io/past-forever
Honest notes
-
The maths is old. 10-adic numbers (Hensel, 1897), automorphic numbers, and Cantor's ordinals (it can count to
forever + 1). What's new, as far as I found, is a language you can run where code keeps going after a forever loop. - "proved" means proved by the rules in forever.js. No mathematician has reviewed them yet. The referee is a strong check, not a proof.
- I built it with Claude Code (Anthropic's AI) in about a day, and Claude helped write this post. I asked it for a strange new language that would grow out of playing with numbers, and picked the idea of a loop that finishes. The liars turned up while hunting with it.
So, what's the strangest loop you can think of? Write it in the comments and I'll run it through Past Forever.



Top comments (0)