Created
November 23, 2021 13:35
-
-
Save Hayao0819/e7fd78a0e1b63f57ab3ae173d2acd80c to your computer and use it in GitHub Desktop.
x^y=y^xの組み合わせを見つける
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
// RunProcess(最小指数, 最大指数, 底) | |
function RunProcess(startNum, processMax, ProcX){ | |
for (let i = BigInt(startNum); i <= processMax; i++) { | |
let AnswerA, AnswerB | |
ProcX=BigInt(ProcX) | |
// ProcY=BigInt(processMax)-BigInt(i) | |
ProcY=BigInt(i) | |
console.log(`検証: ${ProcX} ** ${ProcY}`) | |
if (ProcX === ProcY ){ | |
continue; | |
} | |
AnswerA = ProcX ** ProcY | |
AnswerB = ProcY ** ProcX | |
if (AnswerA === AnswerB){ | |
console.log(`結果: ${ProcX} ^ ${ProcY} == ${AnswerA}`) | |
} | |
} | |
} | |
const AllMax = 1000n | |
for (let x = BigInt(0); x <= AllMax; x++) { | |
RunProcess(0,AllMax, x) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment