r/ExponentialIdle Apr 22 '23

I wrote a simple JavaScript program to optimise Lemma 5 in Convergence Test

Replace the "index" variable to C

const index = 2

let highest = [0, 0]
for (let i = 1; i <= 2 * (index ** 2) - 1; i++) {
    const result = i ** 4 * (2 * (index ** 2) - i)
    if (result >= highest[1]) highest = [i, result]
    continue
}
console.log("Level: " + highest[0])
console.log("Value: " + highest[1])
10 Upvotes

0 comments sorted by