Last active
November 23, 2021 01:28
-
-
Save purplejacket/1871131 to your computer and use it in GitHub Desktop.
Fermat's last theorem - halting problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Theory of computation: halting problem: will the following program ever halt? | |
outer_loop: | |
for (let bound=3; ; bound++) | |
for (let n=3; n<=bound; n++) | |
for (let a=1; a<=bound; a++) | |
for (let b=1; b<=bound; b++) | |
for (let c=1; c<=bound; c++) | |
if (a**n + b**n == c**n) | |
break outer_loop; | |
/* | |
c.f. | |
http://mathworld.wolfram.com/HaltingProblem.html | |
http://en.wikipedia.org/wiki/Halting_problem | |
http://www.netfunny.com/rhf/jokes/new89/halting.760.html | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment