Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,18 @@
|
|||
const limit = 1000000;
|
||||
|
||||
let divisorSum = new Array(limit + 1).fill(1);
|
||||
let divisorCount = new Array(limit + 1).fill(1);
|
||||
|
||||
for (let index = 2; index <= limit / 2; index++) {
|
||||
for (let number = 2 * index; number <= limit; number += index) {
|
||||
if (divisorSum[number] === number) {
|
||||
console.log(
|
||||
`${number.toString().padStart(8, ' ')} equals the sum of its first ` +
|
||||
`${divisorCount[number].toString().padStart(3, ' ')} divisors`
|
||||
);
|
||||
}
|
||||
|
||||
divisorSum[number] += index;
|
||||
divisorCount[number]++;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue