How to resolve the algorithm Euler's sum of powers conjecture step by step in the Wren programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Euler's sum of powers conjecture step by step in the Wren programming language
Table of Contents
Problem Statement
There is a conjecture in mathematics that held for over two hundred years before it was disproved by the finding of a counterexample in 1966 by Lander and Parkin. This conjecture is called Euler's sum of powers conjecture and can be stated as such: In 1966, Leon J. Lander and Thomas R. Parkin used a brute-force search on a CDC 6600 computer restricting numbers to those less than 250. The task consists in writing a program to search for an integer solution of
x
0
5
x
1
5
x
2
5
x
3
5
=
y
5
{\displaystyle x_{0}^{5}+x_{1}^{5}+x_{2}^{5}+x_{3}^{5}=y^{5}}
where all
x
i
{\displaystyle x_{i}}
and
y
{\displaystyle y}
are distinct integers between 0 and 250 (exclusive). Show an answer here. Related tasks are:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Euler's sum of powers conjecture step by step in the Wren programming language
Source code in the wren programming language
var start = System.clock
var n = 250
var m = 30
var p5 = List.filled(n+m+1, 0)
var s = 0
while (s < n) {
var sq = s * s
p5[s] = sq * sq * s
s = s + 1
}
var max = p5[n-1]
while (s < p5.count) {
p5[s] = max + 1
s = s + 1
}
for (a in 1...n-3) {
for (b in a + 1...n-2) {
for (c in b + 1...n-1) {
var d = c + 1
var t = p5[a] + p5[b] + p5[c]
var e = d + (t % m)
s = t + p5[d]
while (s <= max) {
e = e - m
while (p5[e+m] <= s) e = e + m
if (p5[e] == s) {
System.print("%(a)⁵ + %(b)⁵ + %(c)⁵ + %(d)⁵ = %(e)⁵")
System.print("Took %(System.clock - start) seconds")
return
}
d = d + 1
e = e + 1
s = t + p5[d]
}
}
}
}
You may also check:How to resolve the algorithm Floyd-Warshall algorithm step by step in the C programming language
You may also check:How to resolve the algorithm Achilles numbers step by step in the Julia programming language
You may also check:How to resolve the algorithm Guess the number/With feedback (player) step by step in the BCPL programming language
You may also check:How to resolve the algorithm Vector products step by step in the Ksh programming language
You may also check:How to resolve the algorithm Gaussian elimination step by step in the Modula-3 programming language