2021-06-15 00:49:18 -07:00
|
|
|
|
---
|
|
|
|
|
id: 5900f45d1000cf542c50ff70
|
2022-03-01 00:52:39 +05:30
|
|
|
|
title: 'Problema 241: Perfezione dei quozienti'
|
2021-06-15 00:49:18 -07:00
|
|
|
|
challengeType: 5
|
|
|
|
|
forumTopicId: 301888
|
|
|
|
|
dashedName: problem-241-perfection-quotients
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
2022-03-01 00:52:39 +05:30
|
|
|
|
Per un numero intero positivo $n$, sia $σ(n)$ la somma di tutti i divisori di $n$, per esempio $σ(6) = 1 + 2 + 3 + 6 = 12$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
2022-03-01 00:52:39 +05:30
|
|
|
|
Un numero perfetto, come forse già sai, è un numero per cui $σ(n) = 2n$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
2022-03-01 00:52:39 +05:30
|
|
|
|
Definiamo il quoziente perfetto di iun numero intero positivo come $p(n) = \frac{σ(n)}{n}$.
|
|
|
|
|
|
|
|
|
|
Trova la somma di tutti i numeri interi positivi $n ≤ {10}^{18}$ per cui $p(n)$ ha la forma $k + \frac{1}{2}$, dove $k$ è un numero intero.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
2022-03-01 00:52:39 +05:30
|
|
|
|
`perfectionQuotients()` dovrebbe restituire `482316491800641150`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
```js
|
2022-03-01 00:52:39 +05:30
|
|
|
|
assert.strictEqual(perfectionQuotients(), 482316491800641150);
|
2021-06-15 00:49:18 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
2022-03-01 00:52:39 +05:30
|
|
|
|
function perfectionQuotients() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-01 00:52:39 +05:30
|
|
|
|
perfectionQuotients();
|
2021-06-15 00:49:18 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|