Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
11
Task/Own-digits-power-sum/JavaScript/own-digits-power-sum.js
Normal file
11
Task/Own-digits-power-sum/JavaScript/own-digits-power-sum.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
function is_odps(n) {
|
||||
const digits = [...String(n)].map(Number);
|
||||
const len = digits.length;
|
||||
return n == digits.map(x => x ** len).reduce((x, y) => x + y);
|
||||
}
|
||||
|
||||
for (let i = 100; i < 100000000; i++) {
|
||||
if (is_odps(i)) {
|
||||
console.log(i);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue