Skip to content

Instantly share code, notes, and snippets.

@iamCristYe
Created July 25, 2019 07:38
Show Gist options
  • Save iamCristYe/f9805ff6f29b83fedd98f69985836a91 to your computer and use it in GitHub Desktop.
Save iamCristYe/f9805ff6f29b83fedd98f69985836a91 to your computer and use it in GitHub Desktop.
for (let NEPTURAVSH = 1000000000; NEPTURAVSH < 2000000000; NEPTURAVSH++) {
let N = parseInt(NEPTURAVSH.toString()[0]);
let E = parseInt(NEPTURAVSH.toString()[1]);
let P = parseInt(NEPTURAVSH.toString()[2]);
let T = parseInt(NEPTURAVSH.toString()[3]);
let U = parseInt(NEPTURAVSH.toString()[4]);
let R = parseInt(NEPTURAVSH.toString()[5]);
let A = parseInt(NEPTURAVSH.toString()[6]);
let V = parseInt(NEPTURAVSH.toString()[7]);
let S = parseInt(NEPTURAVSH.toString()[8]);
let H = parseInt(NEPTURAVSH.toString()[9]);
if (N+E+P+T+U+R+A+V+S+H!=45) continue;
let THE=100*T+10*H+E;
let EARTH=10000*E+1000*A+100*R+10*T+H;
let VENUS=10000*V+1000*E+100*N+10*U+S;
let SATURN=100000*S+10000*A+1000*T+100*U+10*R+N;
let URANUS=100000*U+10000*R+1000*A+100*N+10*U+S;
let NEPTUNE=1000000*N+100000*E+10000*P+1000*T+100*U+10*N+E;
if(THE+EARTH+VENUS+SATURN+URANUS==NEPTUNE) console.log(NEPTURAVSH)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment