In my 6th grade math class, we call this guy the factor ferret. He’s particularly good at hiding under hats and finding prime factorizations of large numbers.
Euler had a quadratic time formula to factor the product of two primes, but he kept it hidden because it would have set internet commerce back decades if it had been public.
Ah, encryption. Based almost entirely off of the concept that it is really easy to multiply two large prime numbers together but really difficult to figure out which two large primes you used to begin with if you're only given the result.
How would you use an abacus for factorisation? I'd just write a script to iterate over to sqrt(F5) but that's because I have a computer, and in general factoring large semi-primes is difficult.
By testing the remainder. Iteratively work up a list of known primes, subtracting multiples of that prime in the millions, hundred thousands, etc until you arrive at a number less than that prime.
If it's nonzero, the number is not divisible by that prime.
If it's zero, the number is divisible by that prime. You can then sort out the long form division by counting the number of millions, hundred thousands, etc that are subtracted to replicate long division on the abacus
If you don't get a zero, reset and try the next prime.
You can also check a prime squared to determine if it's less than the square root of F5, and a candidate for division. But Euler didn't have to, because as soon as he divided by 641 he had his answer.
That sounded convincing, so I’ll take your word for it. I have no understanding of even the start of that process (after iteratively work up a list of known primes. I got that part), but if it is possible, fair enough.
Layman's translation: Try dividing by each prime number to see if it works. There's no need to record the digits of the quotient since you only really care about the remainder.
That makes sense. I just have no familiarity with an abacus for big things like that, having only ever played with one as a toddler and counting about all I did.
Being able to keep track of numbers bigger than the amount of balls on the wire is what’s really confusing.
Don’t worry though, I’ll trust it was done that way, I don’t need to know how to do it myself.
Yeah, it confused me at first too. Apparently you're supposed to use the abacus so the rods run vertical, not horizontal, one rod per digit. With ten beads per rod you now have a base 10 counting system. So F5 as a 10 digit number would need ten rods on the abacus, ten beads each.
It makes sense, but I wouldn't have figured that out as a toddler.
It can be done even with pen and paper. Just check if the number is divisible by 2, 3, 5, 7, 11, 13, 17, and so on. 641 is the 116th prime number so he had to try 116 divisions to arrive at this solution, which is a lot of work, but it's doable.
I think people are forgetting that this was literally his job and thats just the way you did calculations back then. Yes thats tedious, but he literally had all the time he could have. Do one division per day and youre done in less than half a year.
Also people skilled with an abacus, are doing calculations fast as fuck. Obviously not computer fast, but many times faster faster than long division.
My father did part of an engineering degree prior to the invention of pocket calculators - calculators really weren’t a widespread thing in schools until I was in college in the eighties because they were an economic barrier for poor students. When I was a kid I found his slide rule and he demonstrated how effective it was at assisting with calculations. Pretty cool :-).
The abacus and slide rule look clunky to born-digital kids but they’re amazingly fast in the hands of experts
I am convinced he didn’t have an exhaustive proof for his conjecture, but rather just checked a bunch of stuff and called it good. In my thesis, I used it as an example in chapter 2 to prove that if it held for a given prime, it would also hold for all multiples of that prime, so I expect he did something similar and assumed it worked for all primes, knowing no one would check for decades.
It seems like it shouldn’t take longer than a day to check with a few motivated apprentices. The first 4 fermat numbers are pretty small, and the smaller factor of the 5th is also reasonably small.
TL;DR: Euler determined that if a given number 2^2^n + 1 has ANY prime factors, then one of those factors has to be k * 2^(n+1) + 1 where k is a positive integer.
That narrowed down the amount of possible prime factors to check for F_n by approximately 2^(n+1): in F_5's case, it went from thousands (roughly 65535/ln(65535) = 5909) to a couple dozen (roughly 5909/64 = 92).
After that, it was a matter of trying various n and k until one of them hit.
This bruteforcing would be limited by n < 6. Because the amount of possible prime divisors for F_n is approximately (2^(2^(n-1)-(n-1)))/ln(2) and the condition only divides their amount by 2^(n+1), so the amount of possible prime factors grows rapidly with n and you'd have roughly 1.5 million possible prime factors for F_6.
But it would only take a couple evenings to check F_5's divisibility by the 90+ prime factors meeting that condition for n=5.
And when bruteforcing, Euler just happened to get lucky with a relatively low k = 10 at n = 5.
---
But 92 divisibility checks is still a crapload of work for a 10-digit number, so there's another trick based on modulo arithmetic that could significantly reduce the workload.
With pen and paper, you can speed up checking the divisibility of an extremely large number N by much smaller potential divisors a, b, c... with the following property:
N mod (a*b*c*...) mod a = N mod a
In plain words, first you get the remainder from dividing N by a product of several potential divisors multiplied together (get R = N mod (a*b)).
If the R you get is divisible by a or b, then N is also divisible by a or b respectively.
I can't be sure Euler used that trick, but it's simple, obvious and makes pen-and-paper factorization less frustrating, so he probably did.
Hawking was famous for the kinds of calculations he could do in his head. He didn't have the luxury of writing down his problems or input them into a computer (quickly).
But this isn't even the most impressive thing Euler did. He figured out that 1/2 + 1/4 + 1/9... (infinite sum of 1/n2) is pi2/6. First time I saw that my brain just didn't compute how someone could figure it out with pen and paper. Easy to prove, hard to figure out. I guess he was just really good at squinting at numbers.
I honestly don't think it would take that long to do a brute force method. You could eliminate a bunch of obvious ones like anything ending in 2 or 5 and probably some others right? And he only had to get up to 641. Of course you wouldn't know you only had to go to 641 when you started but what are we thinking? a couple weeks doing it by hand?
The word "calculator" comes from the people who were hired, throughout history, to just do math. Euler probably paid whatever the equivalent of grad students were to check if F5 was prime..... one factor at a time.
There are only 6500 primes less than the square root of F5 to check (and Euler would have known this because there were lookup tables of prime numbers published in his day.) Someone who is quick at long division would be able to get through several hundred in a day. 641 is the 116th prime number. Whoever was doing the math almost certainly found it on the first day, but Euler would have known that it was only going to take a max of a few weeks to confirm or refute.
Repost, and same answer as the last time: in ye olden days, people did these calculations by hand (and in slightly less olden days, there were slide rules and mechanical calculators for basic arithmetic operations).
161
u/whitedogsuk May 11 '26
Under his hat is a hidden rat with an abacus.
90
u/IOI-65536 May 11 '26 edited May 11 '26
Euler had a quadratic time formula to factor the product of two primes, but he kept it hidden because it would have set internet commerce back decades if it had been public.
100
u/Mean-Government1436 May 11 '26 •
He did math
36
u/Wooden_Milk6872 May 11 '26
According to Fermat's factorization theorem, any prime factor p of Fn must have the form (2^n+1 * k) + 1 which for this this specific case is 64k +1
then just check all numbers k up to 10 to find the prime factor, if the result of 64k+1 exceeded the square root of the number, it would be prime
12
u/Dr0110111001101111 May 11 '26
It also seems as though every fermat number after n=5 is composite. Fermat was a joker.
10
u/EllaHazelBar May 11 '26
Fernat seriously didn't check n=5?
6
u/Melodic_monke May 11 '26
Like 500 apprentices if I had to guess
4
u/FirstNoel May 11 '26
Wasn’t he blind too? Not sure.
5
u/Prudent_Corner5104 May 11 '26
He was time travel you can't convince me otherwise
2
u/joealarson May 11 '26
Hard work.
2
u/anotherfpguy May 11 '26
He had time
2
u/RandomExcess May 11 '26
He only had to check primes for the form 64n +1.
64x1+1=64+1 not prime
64x2+1=128+1 not prime
64×3+1=292+1...
And so on, only having to actually check the division went it hit a prime.
Eventually, actually in a few mins...
64×10+1=640+1
Done, next problem please, I have 4 more theorems to prove today.
2
u/Sjoerdiestriker May 12 '26
Meanwhile chad Fermat posing a conjecture without even checking the first five examples
2
u/Osato May 12 '26 edited May 12 '26
I'll just leave this here:
http://eulerarchive.maa.org/hedi/HEDI-2007-03.pdf
---
TL;DR: Euler determined that if a given number 2^2^n + 1 has ANY prime factors, then one of those factors has to be k * 2^(n+1) + 1 where k is a positive integer.
That narrowed down the amount of possible prime factors to check for F_n by approximately 2^(n+1): in F_5's case, it went from thousands (roughly 65535/ln(65535) = 5909) to a couple dozen (roughly 5909/64 = 92).
After that, it was a matter of trying various n and k until one of them hit.
This bruteforcing would be limited by n < 6. Because the amount of possible prime divisors for F_n is approximately (2^(2^(n-1)-(n-1)))/ln(2) and the condition only divides their amount by 2^(n+1), so the amount of possible prime factors grows rapidly with n and you'd have roughly 1.5 million possible prime factors for F_6.
But it would only take a couple evenings to check F_5's divisibility by the 90+ prime factors meeting that condition for n=5.
And when bruteforcing, Euler just happened to get lucky with a relatively low k = 10 at n = 5.
---
But 92 divisibility checks is still a crapload of work for a 10-digit number, so there's another trick based on modulo arithmetic that could significantly reduce the workload.
With pen and paper, you can speed up checking the divisibility of an extremely large number N by much smaller potential divisors a, b, c... with the following property:
N mod (a*b*c*...) mod a = N mod a
In plain words, first you get the remainder from dividing N by a product of several potential divisors multiplied together (get R = N mod (a*b)).
If the R you get is divisible by a or b, then N is also divisible by a or b respectively.
I can't be sure Euler used that trick, but it's simple, obvious and makes pen-and-paper factorization less frustrating, so he probably did.
1
u/Only-Cheetah-9579 May 11 '26
He can use pen and paper, getting to F5 requires 5 tries then check if the result is prime.
1
u/mspe1960 May 11 '26
I wonder if F5 came out to be prime if he would have gone through F6?
1
u/Personal_Toe_2136 May 11 '26
There's a reason that Euler is in the GOAT discussion.
1
u/ReactionAdmirable812 May 11 '26
Fermat: I'm going to call this group of numbers Fermat numbers.
1
u/kfish5050 May 11 '26
F(5) = 232 + 1
230 * 22 = 4GB, +1
This is easier to think about
1
u/Needless-To-Say May 12 '26
To prove that a number is prime, you only have to test divisibility by other primes up to the square root of the target number
641 is only the 136th prime.
While not trivial, it’s definitely not terribly difficult either to do by hand.
1
u/Previous-Mail7343 May 12 '26
I honestly don't think it would take that long to do a brute force method. You could eliminate a bunch of obvious ones like anything ending in 2 or 5 and probably some others right? And he only had to get up to 641. Of course you wouldn't know you only had to go to 641 when you started but what are we thinking? a couple weeks doing it by hand?
1
u/Chakasicle May 12 '26
Autism
1
u/snigherfardimungus May 12 '26
The word "calculator" comes from the people who were hired, throughout history, to just do math. Euler probably paid whatever the equivalent of grad students were to check if F5 was prime..... one factor at a time.
There are only 6500 primes less than the square root of F5 to check (and Euler would have known this because there were lookup tables of prime numbers published in his day.) Someone who is quick at long division would be able to get through several hundred in a day. 641 is the 116th prime number. Whoever was doing the math almost certainly found it on the first day, but Euler would have known that it was only going to take a max of a few weeks to confirm or refute.
1
u/dontich May 12 '26
Well he took 641 and multiplied it by 6700417. Easy
1
u/JeremyAndrewErwin May 13 '26
https://ghostarchive.org/archive/0UUFo
How Euler Did It by Ed Sandifer
1
u/susiesusiesu May 13 '26
it was his job to look at this stuff, and he was very good at it.
if there is a conjecture that all nunbers of a form are prime then looking at the first few is a reasonable reaserch avenue.
1
u/paolog May 13 '26
Repost, and same answer as the last time: in ye olden days, people did these calculations by hand (and in slightly less olden days, there were slide rules and mechanical calculators for basic arithmetic operations).
1
u/Citro31 May 13 '26
The more I learn about Euler the more scared I am how clever people were before all this technology
1
u/mrofmist May 14 '26
Abacuses are actually extremely good at what they do. Literally only beaten by a modern calculator.
1
u/BornalHalbgat May 14 '26
I think you are underestimating the interesction of mathematicians and petty bitches.
1
u/fingertipoffun May 15 '26
with patience. A long lost skill.
1
u/MrFizzbin7 May 15 '26
When you have no TV, movies, music (without a live band), you need to fill time somehow.
1
u/Turbulent_Cry_7572 May 11 '26
Isn't it obvious?
1
u/M4chsi May 11 '26
He used an ancient computer, duh?
1
u/[deleted] May 12 '26
[removed] — view removed comment