chore(i18n,learn): processed translations (#45165)

This commit is contained in:
camperbot
2022-02-19 12:56:08 +05:30
committed by GitHub
parent 8138a07d52
commit ba14990876
134 changed files with 1540 additions and 1511 deletions

View File

@ -1,6 +1,6 @@
---
id: 5900f3761000cf542c50fe89
title: 'Problem 10: Summation of primes'
title: 'Problema 10: Somma dei numeri primi'
challengeType: 5
forumTopicId: 301723
dashedName: problem-10-summation-of-primes
@ -8,37 +8,37 @@ dashedName: problem-10-summation-of-primes
# --description--
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
La somma dei numeri primi sotto 10 è 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below `n`.
Trova la somma di tutti i numeri primi sotto `n`.
# --hints--
`primeSummation(17)` should return a number.
`primeSummation(17)` dovrebbe restituire un numero.
```js
assert(typeof primeSummation(17) === 'number');
```
`primeSummation(17)` should return 41.
`primeSummation(17)` dovrebbe restituire 41.
```js
assert.strictEqual(primeSummation(17), 41);
```
`primeSummation(2001)` should return 277050.
`primeSummation(2001)` dovrebbe ritornare 277050.
```js
assert.strictEqual(primeSummation(2001), 277050);
```
`primeSummation(140759)` should return 873608362.
`primeSummation(140759)` dovrebbe restituire 873608362.
```js
assert.strictEqual(primeSummation(140759), 873608362);
```
`primeSummation(2000000)` should return 142913828922.
`primeSummation(2000000)` dovrebbe restituire 142913828922.
```js
assert.strictEqual(primeSummation(2000000), 142913828922);

View File

@ -1,6 +1,6 @@
---
id: 5900f3781000cf542c50fe8a
title: 'Problem 11: Largest product in a grid'
title: 'Problema 11: Prodotto più grande nella griglia'
challengeType: 5
forumTopicId: 301734
dashedName: problem-11-largest-product-in-a-grid
@ -8,7 +8,7 @@ dashedName: problem-11-largest-product-in-a-grid
# --description--
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
Nella griglia 20×20 qui sotto, quattro numeri lungo una linea diagonale sono stati contrassegnati in rosso.
<div style='text-align: center;'>
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08<br>
@ -33,25 +33,25 @@ In the 20×20 grid below, four numbers along a diagonal line have been marked in
01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48<br>
</div>
The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
Il prodotto di questi numeri è 26 × 63 × 78 × 14 = 1788696.
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in a given `arr` grid?
Qual è il prodotto più grande di quattro numeri adiacenti nella stessa direzione (su, giù, sinistra, destra, o diagonalmente) in una griglia `arr` data?
# --hints--
`largestGridProduct(testGrid)` should return a number.
`largestGridProduct(testGrid)` dovrebbe restituire un numero.
```js
assert(typeof largestGridProduct(testGrid) === 'number');
```
`largestGridProduct(testGrid)` should return 14169081.
`largestGridProduct(testGrid)` dovrebbe restituire 14169081.
```js
assert.strictEqual(largestGridProduct(testGrid), 14169081);
```
`largestGridProduct(grid)` should return 70600674.
`largestGridProduct(grid)` dovrebbe restituire 70600674.
```js
assert.strictEqual(largestGridProduct(grid), 70600674);

View File

@ -1,6 +1,6 @@
---
id: 5900f3781000cf542c50fe8b
title: 'Problem 12: Highly divisible triangular number'
title: 'Problema 12: Numero triangolare altamente divisibile'
challengeType: 5
forumTopicId: 301746
dashedName: problem-12-highly-divisible-triangular-number
@ -8,11 +8,11 @@ dashedName: problem-12-highly-divisible-triangular-number
# --description--
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
La sequenza di numeri triangolari è generata sommando i numeri naturali. Quindi il numero del 7° triangolo sarebbe 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. I primi dieci termini saranno:
<div style='text-align: center;'>1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...</div>
Let us list the factors of the first seven triangle numbers:
Elenchiamo i fattori dei primi sette numeri triangolari:
<div style='padding-left: 4em;'><b>1:</b> 1</div>
<div style='padding-left: 4em;'><b>3:</b> 1, 3</div>
@ -22,43 +22,43 @@ Let us list the factors of the first seven triangle numbers:
<div style='padding-left: 4em;'><b>21:</b> 1, 3, 7, 21</div>
<div style='padding-left: 4em;'><b>28:</b> 1, 2, 4, 7, 14, 28</div>
We can see that 28 is the first triangle number to have over five divisors.
Possiamo vedere che 28 è il primo numero triangolare ad avere più di cinque divisori.
What is the value of the first triangle number to have over `n` divisors?
Qual è il valore del primo numero triangolare che ha oltre `n` divisori?
# --hints--
`divisibleTriangleNumber(5)` should return a number.
`divisibleTriangleNumber(5)` dovrebbe restituire un numero.
```js
assert(typeof divisibleTriangleNumber(5) === 'number');
```
`divisibleTriangleNumber(5)` should return 28.
`divisibleTriangleNumber(5)` dovrebbe restituire 28.
```js
assert.strictEqual(divisibleTriangleNumber(5), 28);
```
`divisibleTriangleNumber(23)` should return 630.
`divisibleTriangleNumber(23)` dovrebbe restituire 630.
```js
assert.strictEqual(divisibleTriangleNumber(23), 630);
```
`divisibleTriangleNumber(167)` should return 1385280.
`divisibleTriangleNumber(167)` dovrebbe restituire 1385280.
```js
assert.strictEqual(divisibleTriangleNumber(167), 1385280);
```
`divisibleTriangleNumber(374)` should return 17907120.
`divisibleTriangleNumber(374)` dovrebbe restituire 17907120.
```js
assert.strictEqual(divisibleTriangleNumber(374), 17907120);
```
`divisibleTriangleNumber(500)` should return 76576500.
`divisibleTriangleNumber(500)` dovrebbe restituire 76576500.
```js
assert.strictEqual(divisibleTriangleNumber(500), 76576500);

View File

@ -1,6 +1,6 @@
---
id: 5900f37a1000cf542c50fe8c
title: 'Problem 13: Large sum'
title: 'Problema 13: Grande somma'
challengeType: 5
forumTopicId: 301757
dashedName: problem-13-large-sum
@ -8,7 +8,7 @@ dashedName: problem-13-large-sum
# --description--
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
Ottieni le prime 10 cifre della somma dei seguenti cento numeri a 50 cifre.
<div style='padding-left: 4em;'>
37107287533902102798797998220837590246510135740250<br>
@ -115,19 +115,19 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n
# --hints--
`largeSum(testNums)` should return a number.
`largeSum(testNums)` dovrebbe restituire un numero.
```js
assert(typeof largeSum(testNums) === 'number');
```
`largeSum(testNums)` should return 8348422521.
`largeSum(testNums)` dovrebbe restituire 8348422521.
```js
assert.strictEqual(largeSum(testNums), 8348422521);
```
`largeSum(fiftyDigitNums)` should return 5537376230.
`largeSum(fiftyDigitNums)` dovrebbe restituire 5537376230.
```js
assert.strictEqual(largeSum(fiftyDigitNums), 5537376230);

View File

@ -1,6 +1,6 @@
---
id: 5900f37a1000cf542c50fe8d
title: 'Problem 14: Longest Collatz sequence'
title: 'Problema 14: la sequenza di Collatz più lunga'
challengeType: 5
forumTopicId: 301768
dashedName: problem-14-longest-collatz-sequence
@ -8,61 +8,61 @@ dashedName: problem-14-longest-collatz-sequence
# --description--
The following iterative sequence is defined for the set of positive integers:
La seguente sequenza iterativa è definita per il set degli interi positivi:
<div style='padding-left: 4em;'><var>n</var><var>n</var>/2 (<var>n</var> is even)</div>
<div style='padding-left: 4em;'><var>n</var><var>n</var>/2 (<var>n</var> è pari)</div>
<div style='padding-left: 4em;'><var>n</var> → 3<var>n</var> + 1 (<var>n</var> is odd)</div>
<div style='padding-left: 4em;'><var>n</var> → 3<var>n</var> + 1 (<var>n</var> è dispari)</div>
Using the rule above and starting with 13, we generate the following sequence:
Usando le regole qua sopra e iniziando con 13, generiamo la seguente sequenza:
<div style='text-align: center;'>13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1</div>
It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
Puoi vedere che questa sequenza (iniziando con 13 e finedno con 1) contiene 10 termini. Anche se non è ancora stato provato (Problema di Collatz), si pensa che con qualsiasi numeri si parta, si finisce a 1.
Which starting number, under the given `limit`, produces the longest chain?
Quale numero iniziale, sotto il dato limite `limit`, produce la catena più lunga?
**Note:** Once the chain starts the terms are allowed to go above one million.
**Nota:** Una volta che la catena inizia i termini possono superare `limit`.
# --hints--
`longestCollatzSequence(14)` should return a number.
`longestCollatzSequence(14)` dovrebbe restituire un numero.
```js
assert(typeof longestCollatzSequence(14) === 'number');
```
`longestCollatzSequence(14)` should return 9.
`longestCollatzSequence(14)` dovrebbe restituire 9.
```js
assert.strictEqual(longestCollatzSequence(14), 9);
```
`longestCollatzSequence(5847)` should return 3711.
`longestCollatzSequence(5847)` dovrebbe restituire 3711.
```js
assert.strictEqual(longestCollatzSequence(5847), 3711);
```
`longestCollatzSequence(46500)` should return 35655.
`longestCollatzSequence(46500)` dovrebbe restituire 35655.
```js
assert.strictEqual(longestCollatzSequence(46500), 35655);
```
`longestCollatzSequence(54512)` should return 52527.
`longestCollatzSequence(54512)` dovrebbe restituire 52527.
```js
assert.strictEqual(longestCollatzSequence(54512), 52527);
```
`longestCollatzSequence(100000)` should return 77031.
`longestCollatzSequence(100000)` dovrebbe restituire 77031.
```js
assert.strictEqual(longestCollatzSequence(100000), 77031);
```
`longestCollatzSequence(1000000)` should return 837799.
`longestCollatzSequence(1000000)` dovrebbe restituire 837799.
```js
assert.strictEqual(longestCollatzSequence(1000000), 837799);

View File

@ -1,6 +1,6 @@
---
id: 5900f37b1000cf542c50fe8e
title: 'Problem 15: Lattice paths'
title: 'Problema 15: Percorsi nel reticolo'
challengeType: 5
forumTopicId: 301780
dashedName: problem-15-lattice-paths
@ -8,33 +8,33 @@ dashedName: problem-15-lattice-paths
# --description--
Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
Iniziando nell'angolo in alto a sinistra di una griglia 2x2, e avendo l'abilità di muoversi solo verso destra e verso il basso, ci sono esattamente 6 strade verso l'angolo in basso a sinistra.
<img class="img-responsive center-block" alt="a diagram of 6 2 by 2 grids showing all the routes to the bottom right corner" src="https://cdn-media-1.freecodecamp.org/project-euler/1Atixoj.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="un diagramma di 6 griglie 2 per 2 che mostra tutte le strade per raggiungere l'angolo in basso a destra" src="https://cdn-media-1.freecodecamp.org/project-euler/1Atixoj.gif" style="background-color: white; padding: 10px;" />
How many such routes are there through a given `gridSize`?
Quante strade di questo tipo ci sono data la dimensione della griglia `gridSize`?
# --hints--
`latticePaths(4)` should return a number.
`latticePaths(4)` dovrebbe restituire un numero.
```js
assert(typeof latticePaths(4) === 'number');
```
`latticePaths(4)` should return 70.
`latticePaths(4)` dovrebbe restituire 70.
```js
assert.strictEqual(latticePaths(4), 70);
```
`latticePaths(9)` should return 48620.
`latticePaths(9)` dovrebbe restituire 48620.
```js
assert.strictEqual(latticePaths(9), 48620);
```
`latticePaths(20)` should return 137846528820.
`latticePaths(20)` dovrebbe restituire 137846528820.
```js
assert.strictEqual(latticePaths(20), 137846528820);

View File

@ -1,6 +1,6 @@
---
id: 5900f37d1000cf542c50fe8f
title: 'Problem 16: Power digit sum'
title: 'Problema 16: Somma delle cifre della potenza'
challengeType: 5
forumTopicId: 301791
dashedName: problem-16-power-digit-sum
@ -8,31 +8,31 @@ dashedName: problem-16-power-digit-sum
# --description--
2<sup>15</sup> = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
2<sup>15</sup> = 32768 e la somma delle sue cifre è 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2<sup><code>exponent</code></sup>?
Qual'è la somma delle cifre del numero 2<sup><code>exponent</code></sup>?
# --hints--
`powerDigitSum(15)` should return a number.
`powerDigitSum(15)` dovrebbe restituire un numero.
```js
assert(typeof powerDigitSum(15) === 'number');
```
`powerDigitSum(15)` should return 26.
`powerDigitSum(15)` dovrebbe restituire 26.
```js
assert.strictEqual(powerDigitSum(15), 26);
```
`powerDigitSum(128)` should return 166.
`powerDigitSum(128)` dovrebbe restituire 166.
```js
assert.strictEqual(powerDigitSum(128), 166);
```
`powerDigitSum(1000)` should return 1366.
`powerDigitSum(1000)` dovrebbe restituire 1366.
```js
assert.strictEqual(powerDigitSum(1000), 1366);

View File

@ -1,6 +1,6 @@
---
id: 5900f37d1000cf542c50fe90
title: 'Problem 17: Number letter counts'
title: 'Problema 17: conteggio delle lettere dei numeri'
challengeType: 5
forumTopicId: 301804
dashedName: problem-17-number-letter-counts
@ -8,33 +8,33 @@ dashedName: problem-17-number-letter-counts
# --description--
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
Se i numeri da 1 a 5 fossero scritti in parole in inglese: one, two, three, four, five, allora ci sono 3 + 3 + 5 + 4 + 4 = 19 lettere usate in totale.
If all the numbers from 1 to given `limit` inclusive were written out in words, how many letters would be used?
Se tutti i numeri da 1 al dato limite inclusivo `limit` fossero scritti in parole in inglese, quante lettere sarebbero usate?
**Note:** Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
**Nota:** Non contare gli spazi o i trattini. Per esempio, 342 (three hundred and forty-two) contiene 23 lettere e 115 (one hundred and fifteen) contiene 20 lettere. L'uso di "and" scrivendo i numeri segue l'uso britannico.
# --hints--
`numberLetterCounts(5)` should return a number.
`numberLetterCounts(5)` dovrebbe restituire un numero.
```js
assert(typeof numberLetterCounts(5) === 'number');
```
`numberLetterCounts(5)` should return 19.
`numberLetterCounts(5)` dovrebbe restituire 19.
```js
assert.strictEqual(numberLetterCounts(5), 19);
```
`numberLetterCounts(150)` should return 1903.
`numberLetterCounts(150)` dovrebbe restituire 1903.
```js
assert.strictEqual(numberLetterCounts(150), 1903);
```
`numberLetterCounts(1000)` should return 21124.
`numberLetterCounts(1000)` dovrebbe restituire 21124.
```js
assert.strictEqual(numberLetterCounts(1000), 21124);

View File

@ -1,6 +1,6 @@
---
id: 5900f37e1000cf542c50fe91
title: 'Problem 18: Maximum path sum I'
title: 'Problema 18: Somma massima del percorso I'
challengeType: 5
forumTopicId: 301815
dashedName: problem-18-maximum-path-sum-i
@ -8,7 +8,7 @@ dashedName: problem-18-maximum-path-sum-i
# --description--
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
Cominciando dalla parte superiore del triangolo sottostante e spostandosi verso i numeri adiacenti sulla riga sottostante, il totale massimo dall'alto al basso è 23.
<span style='display: block; text-align: center;'>
<strong style='color: red;'>3</strong><br>
@ -17,9 +17,9 @@ By starting at the top of the triangle below and moving to adjacent numbers on t
8 5 <strong style='color: red;'>9</strong> 3
</span>
That is, 3 + 7 + 4 + 9 = 23.
Cioè, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
Trova il totale massimo dall'alto al basso del triangolo qui sotto:
75
95 64
@ -37,23 +37,23 @@ Find the maximum total from top to bottom of the triangle below:
63 66 04 68 89 53 67 30 73 16 69 87 40 31
04 62 98 27 23 09 70 98 73 93 38 53 60 04 23
**NOTE:** As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)
**NOTA:** Poiché ci sono solo 16384 percorsi, è possibile risolvere questo problema provando ogni percorso. Tuttavia, Problema 67, è la stessa sfida con un triangolo contenente cento righe; non può essere risolto a forza bruta, e richiede un metodo intelligente! ;o)
# --hints--
`maximumPathSumI(testTriangle)` should return a number.
`maximumPathSumI(testTriangle)` dovrebbe restituire un numero.
```js
assert(typeof maximumPathSumI(testTriangle) === 'number');
```
`maximumPathSumI(testTriangle)` should return 23.
`maximumPathSumI(testTriangle)` dovrebbe restituire 23.
```js
assert.strictEqual(maximumPathSumI(testTriangle), 23);
```
`maximumPathSumI(numTriangle)` should return 1074.
`maximumPathSumI(numTriangle)` dovrebbe restituire 1074.
```js
assert.strictEqual(maximumPathSumI(numTriangle), 1074);

View File

@ -1,6 +1,6 @@
---
id: 5900f37f1000cf542c50fe92
title: 'Problem 19: Counting Sundays'
title: 'Problema 19: Contando le domeniche'
challengeType: 5
forumTopicId: 301827
dashedName: problem-19-counting-sundays
@ -8,37 +8,37 @@ dashedName: problem-19-counting-sundays
# --description--
You are given the following information, but you may prefer to do some research for yourself.
Ti sono fornite le seguenti informazioni, ma potresti voler fare un po' di ricerca per conto tuo.
<ul>
<li>1 Jan 1900 was a Monday.</li>
<li>Thirty days has September,<br>April, June and November.<br>All the rest have thirty-one,<br>Saving February alone,<br>Which has twenty-eight, rain or shine.<br>And on leap years, twenty-nine.</li>
<li>A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.</li>
<li>Il 1 Gennaio 1900 era un lunedì.</li>
<li>Trenta giorni a novembre,<br>con april, giugno e settembre,<br>di ventotto ce n'è uno,<br>tutti gli altri ne han trentuno.</li>
<li>Un anno bisestile si verifica su qualsiasi anno divisibile per 4, ma non in un anno divisibile per 100 a meno che non sia divisibile per 400.</li>
</ul>
How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
Quante domeniche sono cadute il primo del mese durante il ventesimo secolo (dal 1 Gen 1901 al 31 Dic 2000)?
# --hints--
`countingSundays(1943, 1946)` should return a number.
`countingSundays(1943, 1946)` dovrebbe restituire un numero.
```js
assert(typeof countingSundays(1943, 1946) === 'number');
```
`countingSundays(1943, 1946)` should return 6.
`countingSundays(1943, 1946)` dovrebbe restituire 6.
```js
assert.strictEqual(countingSundays(1943, 1946), 6);
```
`countingSundays(1995, 2000)` should return 10.
`countingSundays(1995, 2000)` dovrebbe restituire 10.
```js
assert.strictEqual(countingSundays(1995, 2000), 10);
```
`countingSundays(1901, 2000)` should return 171.
`countingSundays(1901, 2000)` dovrebbe restituire 171.
```js
assert.strictEqual(countingSundays(1901, 2000), 171);

View File

@ -1,6 +1,6 @@
---
id: 5900f3801000cf542c50fe93
title: 'Problem 20: Factorial digit sum'
title: 'Problema 20: somma delle cifre del fattoriale'
challengeType: 5
forumTopicId: 301839
dashedName: problem-20-factorial-digit-sum
@ -8,46 +8,46 @@ dashedName: problem-20-factorial-digit-sum
# --description--
`n`! means `n` × (`n` 1) × ... × 3 × 2 × 1
`n`! significa `n` × (`n` 1) × ... × 3 × 2 × 1
For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Ad esempio, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
e la somma delle cifre nel numero 10! è 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Find the sum of the digits `n`!
Trova la somma delle cifre del numero `n`!
# --hints--
`sumFactorialDigits(10)` should return a number.
`sumFactorialDigits(10)` dovrebbe restituire un numero.
```js
assert(typeof sumFactorialDigits(10) === 'number');
```
`sumFactorialDigits(10)` should return 27.
`sumFactorialDigits(10)` dovrebbe restituire 27.
```js
assert.strictEqual(sumFactorialDigits(10), 27);
```
`sumFactorialDigits(25)` should return 72.
`sumFactorialDigits(25)` dovrebbe restituire 72.
```js
assert.strictEqual(sumFactorialDigits(25), 72);
```
`sumFactorialDigits(50)` should return 216.
`sumFactorialDigits(50)` dovrebbe restituire 216.
```js
assert.strictEqual(sumFactorialDigits(50), 216);
```
`sumFactorialDigits(75)` should return 432.
`sumFactorialDigits(75)` dovrebbe restituire 432.
```js
assert.strictEqual(sumFactorialDigits(75), 432);
```
`sumFactorialDigits(100)` should return 648.
`sumFactorialDigits(100)` dovrebbe restituire 648.
```js
assert.strictEqual(sumFactorialDigits(100), 648);

View File

@ -1,6 +1,6 @@
---
id: 5900f3811000cf542c50fe94
title: 'Problem 21: Amicable numbers'
title: 'Problema 21: Numeri amichevoli'
challengeType: 5
forumTopicId: 301851
dashedName: problem-21-amicable-numbers
@ -8,41 +8,41 @@ dashedName: problem-21-amicable-numbers
# --description--
Let d(`n`) be defined as the sum of proper divisors of `n` (numbers less than `n` which divide evenly into `n`).
Si definisce d(`n`) la somma dei divisori propri di `n` (numeri inferiori a `n` che dividono `n` senza resto).
If d(`a`) = `b` and d(`b`) = `a`, where `a``b`, then `a` and `b` are an amicable pair and each of `a` and `b` are called amicable numbers.
Se d(`a`) = `b` e d(`b`) = `a`, dove `a``b`, allora `a` e `b` sono una coppia amichevole e `a` e `b` sono chiamati numeri amichevoli.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
Ad esempio, i divisori propri di 220 sono 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 e 110; quindi d(220) = 284. I divisori propri di 284 sono 1, 2, 4, 71 e 142; quindi d(284) = 220.
Evaluate the sum of all the amicable numbers under `n`.
Valutare la somma di tutti i numeri amichevoli inferiori a `n`.
# --hints--
`sumAmicableNum(1000)` should return a number.
`sumAmicableNum(1000)` dovrebbe restituire un numero.
```js
assert(typeof sumAmicableNum(1000) === 'number');
```
`sumAmicableNum(1000)` should return 504.
`sumAmicableNum(1000)` dovrebbe restituire 504.
```js
assert.strictEqual(sumAmicableNum(1000), 504);
```
`sumAmicableNum(2000)` should return 2898.
`sumAmicableNum(2000)` dovrebbe restituire 2898.
```js
assert.strictEqual(sumAmicableNum(2000), 2898);
```
`sumAmicableNum(5000)` should return 8442.
`sumAmicableNum(5000)` dovrebbe restituire 8442.
```js
assert.strictEqual(sumAmicableNum(5000), 8442);
```
`sumAmicableNum(10000)` should return 31626.
`sumAmicableNum(10000)` dovrebbe restituire 31626.
```js
assert.strictEqual(sumAmicableNum(10000), 31626);

View File

@ -1,6 +1,6 @@
---
id: 5a51eabcad78bf416f316e2a
title: 'Problem 22: Names scores'
title: 'Problema 22: Punteggi dei nomi'
challengeType: 5
forumTopicId: 301862
dashedName: problem-22-names-scores
@ -8,33 +8,33 @@ dashedName: problem-22-names-scores
# --description--
Using `names`, an array defined in the background containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
Usando `names`, un array definito in background contenente oltre cinquemila nomi, inizia ordinandolo in ordine alfabetico. Quindi calcolando il valore alfabetico per ogni nome, moltiplica questo valore per la sua posizione alfabetica nella lista per ottenere un punteggio per il nome.
For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = 49714.
Ad esempio, quando la lista è ordinata in ordine alfabetico, COLIN, che vale 3 + 15 + 12 + 9 + 14 = 53, è il 938-mo nome dell'elenco. Pertanto, COLIN otterrebbe un punteggio di 938 × 53 = 49714.
What is the total of all the name scores in the array?
Qual è il totale di tutti i punteggi dei nomi nell'array?
# --hints--
`namesScores(test1)` should return a number.
`namesScores(test1)` dovrebbe restituire un numero.
```js
assert(typeof namesScores(test1) === 'number');
```
`namesScores(test1)` should return 791.
`namesScores(test1)` dovrebbe restituire 791.
```js
assert.strictEqual(namesScores(test1), 791);
```
`namesScores(test2)` should return 1468.
`namesScores(test2)` dovrebbe restituire 1468.
```js
assert.strictEqual(namesScores(test2), 1468);
```
`namesScores(names)` should return 871198282.
`namesScores(names)` dovrebbe restituire 871198282.
```js
assert.strictEqual(namesScores(names), 871198282);

View File

@ -1,6 +1,6 @@
---
id: 5900f3831000cf542c50fe96
title: 'Problem 23: Non-abundant sums'
title: 'Problema 23: Somme non abbondanti'
challengeType: 5
forumTopicId: 301873
dashedName: problem-23-non-abundant-sums
@ -8,41 +8,41 @@ dashedName: problem-23-non-abundant-sums
# --description--
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
Un numero perfetto è un numerp per cui la somma dei suoi divisori propri è uguale al numero stesso. Per esempio, la somma dei divisori propri di 28 sarebbe 1 + 2 + 4 + 7 + 14 = 28, il che significa che 28 è un numero perfetto.
A number `n` is called deficient if the sum of its proper divisors is less than `n` and it is called abundant if this sum exceeds `n`.
Un numero `n` è chiamato deficiente se la somma dei suoi divisori è minore di `n` ed è chiamato abbondante se la somma eccede `n`.
As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.
Visto che 12 è il numero abbondante più piccolo, 1 + 2 + 3 + 4 + 6 = 16, il numero più piccolo che può essere scritto come somma di due numeri abbondanti è 24. Tramite l'analisi matematica, si può mostrare che tutti gli interi più grandi di 28123 possono essere scritti come somma di due numeri abbondanti. Eppure, questo limite superiore non può essere ridotto ulteriormente tramite analisi, anche se è noto che il numero più grande che non può essere espresso come somma di due numeri abbondanti è più piccolo di questo limite.
Find the sum of all positive integers &lt;= `n` which cannot be written as the sum of two abundant numbers.
Trova la somma di tutti i numeri interi positivi &lt;= `n` che non possono essere scritti come somma di due numeri abbondanti.
# --hints--
`sumOfNonAbundantNumbers(10000)` should return a number.
`sumOfNonAbundantNumbers(10000)` dovrebbe restituire un numero.
```js
assert(typeof sumOfNonAbundantNumbers(10000) === 'number');
```
`sumOfNonAbundantNumbers(10000)` should return 3731004.
`sumOfNonAbundantNumbers(10000)` dovrebbe restituire 3731004.
```js
assert(sumOfNonAbundantNumbers(10000) === 3731004);
```
`sumOfNonAbundantNumbers(15000)` should return 4039939.
`sumOfNonAbundantNumbers(15000)` dovrebbe restituire 4039939.
```js
assert(sumOfNonAbundantNumbers(15000) === 4039939);
```
`sumOfNonAbundantNumbers(20000)` should return 4159710.
`sumOfNonAbundantNumbers(20000)` dovrebbe restituire 4159710.
```js
assert(sumOfNonAbundantNumbers(20000) === 4159710);
```
`sumOfNonAbundantNumbers(28123)` should return 4179871.
`sumOfNonAbundantNumbers(28123)` dovrebbe restituire 4179871.
```js
assert(sumOfNonAbundantNumbers(28123) === 4179871);

View File

@ -1,6 +1,6 @@
---
id: 5900f3841000cf542c50fe97
title: 'Problem 24: Lexicographic permutations'
title: 'Problema 24: permutazioni lessicografiche'
challengeType: 5
forumTopicId: 301885
dashedName: problem-24-lexicographic-permutations
@ -8,39 +8,39 @@ dashedName: problem-24-lexicographic-permutations
# --description--
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
Una permutazione è un arrangiamento di oggetti ordinato. Per esempio, 3124 è una possibile permutazione delle cifre 1, 2, 3 e 4. Se tutte le permutazioni sono elencate numericamente o alfabeticamente, lo chiamiamo ordine lessicografico. Le permutazioni lessicografiche di 0, 1 e 2 sono:
<div style='text-align: center;'>012   021   102   120   201   210</div>
What is the `n`th lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
Qual è l'`n`-sima permutazione lessicografica delle cifre 0, 1, 2, 3, 4, 5, 6, 7, 8 e 9?
# --hints--
`lexicographicPermutations(699999)` should return a number.
`lexicographicPermutations(699999)` dovrebbe restituire un numero.
```js
assert(typeof lexicographicPermutations(699999) === 'number');
```
`lexicographicPermutations(699999)` should return 1938246570.
`lexicographicPermutations(699999)` dovrebbe restituire 1938246570.
```js
assert(lexicographicPermutations(699999) == 1938246570);
```
`lexicographicPermutations(899999)` should return 2536987410.
`lexicographicPermutations(899999)` dovrebbe restituire 2536987410.
```js
assert(lexicographicPermutations(899999) == 2536987410);
```
`lexicographicPermutations(900000)` should return 2537014689.
`lexicographicPermutations(900000)` dovrebbe restituire 2537014689.
```js
assert(lexicographicPermutations(900000) == 2537014689);
```
`lexicographicPermutations(999999)` should return 2783915460.
`lexicographicPermutations(999999)` dovrebbe restituire 2783915460.
```js
assert(lexicographicPermutations(999999) == 2783915460);

View File

@ -1,6 +1,6 @@
---
id: 5900f3851000cf542c50fe98
title: 'Problem 25: 1000-digit Fibonacci number'
title: 'Problema 25: numero di Fibonacci a 1000 cifre'
challengeType: 5
forumTopicId: 301897
dashedName: problem-25-1000-digit-fibonacci-number
@ -8,45 +8,45 @@ dashedName: problem-25-1000-digit-fibonacci-number
# --description--
The Fibonacci sequence is defined by the recurrence relation:
La sequenza di Fibonacci è definita dalla relazione ricorsiva:
<div style='padding-left: 4em;'>F<sub>n</sub> = F<sub>n1</sub> + F<sub>n2</sub>, where F<sub>1</sub> = 1 and F<sub>2</sub> = 1.</div>
<div style='padding-left: 4em;'>F<sub>n</sub> = F<sub>n1</sub> + F<sub>n2</sub>, dove F<sub>1</sub> = 1 e F<sub>2</sub> = 1.</div>
Hence the first 12 terms will be:
Quindi i primi 12 termini saranno:
<div style='padding-left: 4em; display: inline-grid; grid-template-rows: auto; row-gap: 7px;'><div>F<sub>1</sub> = 1</div><div>F<sub>2</sub> = 1</div><div>F<sub>3</sub> = 2</div><div>F<sub>4</sub> = 3</div><div>F<sub>5</sub> = 5</div><div>F<sub>6</sub> = 8</div><div>F<sub>7</sub> = 13</div><div>F<sub>8</sub> = 21</div><div>F<sub>9</sub> = 34</div><div>F<sub>10</sub> = 55</div><div>F<sub>11</sub> = 89</div><div>F<sub>12</sub> = 144</div></div>
The 12th term, F<sub>12</sub>, is the first term to contain three digits.
Il dodicesimo termine, F<sub>12</sub>, è il primo termine a contenere tre cifre.
What is the index of the first term in the Fibonacci sequence to contain `n` digits?
Qual è l'indice del primo termine nella sequenza di Fibonacci contenente `n` cifre?
# --hints--
`digitFibonacci(5)` should return a number.
`digitFibonacci(5)` dovrebbe restituire un numero.
```js
assert(typeof digitFibonacci(5) === 'number');
```
`digitFibonacci(5)` should return 21.
`digitFibonacci(5)` dovrebbe restituire 21.
```js
assert.strictEqual(digitFibonacci(5), 21);
```
`digitFibonacci(10)` should return 45.
`digitFibonacci(10)` dovrebbe restituire 45.
```js
assert.strictEqual(digitFibonacci(10), 45);
```
`digitFibonacci(15)` should return 69.
`digitFibonacci(15)` dovrebbe restituire 69.
```js
assert.strictEqual(digitFibonacci(15), 69);
```
`digitFibonacci(20)` should return 93.
`digitFibonacci(20)` dovrebbe restituire 93.
```js
assert.strictEqual(digitFibonacci(20), 93);

View File

@ -1,6 +1,6 @@
---
id: 5900f3861000cf542c50fe99
title: 'Problem 26: Reciprocal cycles'
title: 'Problema 26: Cicli reciproci'
challengeType: 5
forumTopicId: 301908
dashedName: problem-26-reciprocal-cycles
@ -8,41 +8,41 @@ dashedName: problem-26-reciprocal-cycles
# --description--
A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
Una frazione unitaria contiene 1 nel numeratore. La rappresentazione decimale delle frazioni unitarie con i denominatori da 2 a 10 è indicata con:
<div style='padding-left: 4em; display: inline-grid; grid-template-rows: auto; row-gap: 7px;'><div><sup>1</sup>/<sub>2</sub> = 0.5</div><div><sup>1</sup>/<sub>3</sub> = 0.(3)</div><div><sup>1</sup>/<sub>4</sub> = 0.25</div><div><sup>1</sup>/<sub>5</sub> = 0.2</div><div><sup>1</sup>/<sub>6</sub> = 0.1(6)</div><div><sup>1</sup>/<sub>7</sub> = 0.(142857)</div><div><sup>1</sup>/<sub>8</sub> = 0.125</div><div><sup>1</sup>/<sub>9</sub> = 0.(1)</div><div><sup>1</sup>/<sub>10</sub> = 0.1</div></div>
<div style='padding-left: 4em; display: inline-grid; grid-template-rows: auto; row-gap: 7px;'><div><sup>1</sup>/<sub>2</sub> = 0.5</div><div><sup>1</sup>/<sub>3</sub> = 0.(3)</div><div><sup>1</sup>/<sub>4</sub> = 0.25</div><div><sup>1</sup>/<sub>5</sub> = 0.2</div><div><sup>1</sup>/<sub>6</sub> = 0.1(6)</div><div><sup>1</sup>/<sub>7</sub> = 0.(142857)</div><div><sup>1</sup>/<sub>8</sub> = 0.125</div><div><sup>1</sup>/<sub>9</sub> = 0.(1)</div><div><sup>1</sup>/<sub>10</sub> = 0.1</div></div>
Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that <sup>1</sup>/<sub>7</sub> has a 6-digit recurring cycle.
Dove 0.1(6) significa 0.1666..., e ha un periodo di una cifra. Si può vedere che <sup>1</sup>/<sub>7</sub> ha un periodo di 6 cifre.
Find the value of `d` &lt; `n` for which <sup>1</sup>/<sub>d</sub> contains the longest recurring cycle in its decimal fraction part.
Trova il valore di `d` &lt; `n` per il quale <sup>1</sup>/<sub>d</sub> contiene il periodo più lungo nella sua parte di frazione decimale.
# --hints--
`reciprocalCycles(700)` should return a number.
`reciprocalCycles(700)` dovrebbe restituire un numero.
```js
assert(typeof reciprocalCycles(700) === 'number');
```
`reciprocalCycles(700)` should return 659.
`reciprocalCycles(700)` dovrebbe restituire 659.
```js
assert(reciprocalCycles(700) == 659);
```
`reciprocalCycles(800)` should return 743.
`reciprocalCycles(800)` dovrebbe restituire 743.
```js
assert(reciprocalCycles(800) == 743);
```
`reciprocalCycles(900)` should return 887.
`reciprocalCycles(900)` dovrebbe restituire 887.
```js
assert(reciprocalCycles(900) == 887);
```
`reciprocalCycles(1000)` should return 983.
`reciprocalCycles(1000)` dovrebbe restituire 983.
```js
assert(reciprocalCycles(1000) == 983);

View File

@ -1,6 +1,6 @@
---
id: 5900f3871000cf542c50fe9a
title: 'Problem 27: Quadratic primes'
title: 'Problema 27: Primi quadratici'
challengeType: 5
forumTopicId: 301919
dashedName: problem-27-quadratic-primes
@ -8,51 +8,51 @@ dashedName: problem-27-quadratic-primes
# --description--
Euler discovered the remarkable quadratic formula:
Eulero ha scoperto la notevole formula quadratica:
<div style='margin-left: 4em;'>$n^2 + n + 41$</div>
It turns out that the formula will produce 40 primes for the consecutive integer values $0 \\le n \\le 39$. However, when $n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41$ is divisible by 41, and certainly when $n = 41, 41^2 + 41 + 41$ is clearly divisible by 41.
Si scopre che la formula produrrà 40 primi per i valori interi consecutivi $0 \\le n \\le 39$. Tuttavia, quando $n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41$ è divisibile per 41, e quando $n = 41, 41^2 + 41 + 41 $ è chiaramente divisibile per 41.
The incredible formula $n^2 - 79n + 1601$ was discovered, which produces 80 primes for the consecutive values $0 \\le n \\le 79$. The product of the coefficients, 79 and 1601, is 126479.
Si è scoperta l'incredibile formula $n^2 - 79n + 1601$ che produce 80 primi per i valori consecutivi $0 \\le n \\le 79$. Il prodotto dei coefficienti, 79 e 1601, è 126479.
Considering quadratics of the form:
Considerando le quadratiche della forma:
<div style='margin-left: 4em;'>
$n^2 + an + b$, where $|a| < range$ and $|b| \le range$<br>
where $|n|$ is the modulus/absolute value of $n$<br>
e.g. $|11| = 11$ and $|-4| = 4$<br>
$n^2 + an + b$, dove $|a| < range$ e $|b| \le range$<br>
dove $|n|$ è il valore assoluto di $n$<br>
ad esempio $|11| = 11$ e $|-4| = 4$<br>
</div>
Find the product of the coefficients, $a$ and $b$, for the quadratic expression that produces the maximum number of primes for consecutive values of $n$, starting with $n = 0$.
Trova il prodotto dei coefficienti, $a$ e $b$ per l'espressione quadratica che produce il numero massimo di primi per valori consecutivi di $n$, a partire da $n = 0$.
# --hints--
`quadraticPrimes(200)` should return a number.
`quadraticPrimes(200)` dovrebbe restituire un numero.
```js
assert(typeof quadraticPrimes(200) === 'number');
```
`quadraticPrimes(200)` should return -4925.
`quadraticPrimes(200)` dovrebbe restituire -4925.
```js
assert(quadraticPrimes(200) == -4925);
```
`quadraticPrimes(500)` should return -18901.
`quadraticPrimes(500)` dovrebbe restituire -18901.
```js
assert(quadraticPrimes(500) == -18901);
```
`quadraticPrimes(800)` should return -43835.
`quadraticPrimes(800)` dovrebbe restituire -43835.
```js
assert(quadraticPrimes(800) == -43835);
```
`quadraticPrimes(1000)` should return -59231.
`quadraticPrimes(1000)` dovrebbe restituire -59231.
```js
assert(quadraticPrimes(1000) == -59231);

View File

@ -1,6 +1,6 @@
---
id: 5900f3881000cf542c50fe9b
title: 'Problem 28: Number spiral diagonals'
title: 'Problema 28: le diagonali della spirale di numeri'
challengeType: 5
forumTopicId: 301930
dashedName: problem-28-number-spiral-diagonals
@ -8,7 +8,7 @@ dashedName: problem-28-number-spiral-diagonals
# --description--
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
Iniziando con il numero 1 e muovendo a destra in direzione oraria una spirale 5 per 5 è formata come segue:
<div style='padding-left: 4em;'>
<div style='color: red; display: inline;'>21</div> 22 23 24 <div style='color: red; display: inline;'>25</div><br>
@ -18,37 +18,37 @@ Starting with the number 1 and moving to the right in a clockwise direction a 5
<div style='color: red; display: inline;'>17</div> 16 15 14 <div style='color: red; display: inline;'>13</div><br>
</div>
It can be verified that the sum of the numbers on the diagonals is 101.
Può essere verificato che la somma di tutti i numeri sulle diagonali è 101.
What is the sum of the numbers on the diagonals in an `n` by `n` spiral formed in the same way?
Quale è la somma dei numeri sulle diagnonali di una spirale `n` per `n` formata nello stesso modo?
# --hints--
`spiralDiagonals(101)` should return a number.
`spiralDiagonals(101)` dovrebbe restituire un numero.
```js
assert(typeof spiralDiagonals(101) === 'number');
```
`spiralDiagonals(101)` should return 692101.
`spiralDiagonals(101)` dovrebbe restituire 692101.
```js
assert(spiralDiagonals(101) == 692101);
```
`spiralDiagonals(303)` should return 18591725.
`spiralDiagonals(303)` dovrebbe restituire 18591725.
```js
assert(spiralDiagonals(303) == 18591725);
```
`spiralDiagonals(505)` should return 85986601.
`spiralDiagonals(505)` dovrebbe restituire 85986601.
```js
assert(spiralDiagonals(505) == 85986601);
```
`spiralDiagonals(1001)` should return 669171001.
`spiralDiagonals(1001)` dovrebbe restituire 669171001.
```js
assert(spiralDiagonals(1001) == 669171001);

View File

@ -1,6 +1,6 @@
---
id: 5900f3891000cf542c50fe9c
title: 'Problem 29: Distinct powers'
title: 'Problema 29: Potenze distinte'
challengeType: 5
forumTopicId: 301941
dashedName: problem-29-distinct-powers
@ -8,7 +8,7 @@ dashedName: problem-29-distinct-powers
# --description--
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
Considera tutte le combinazioni intere di $a^b$ per 2 ≤ a ≤ 5 e 2 ≤ b ≤ 5:
<div style='padding-left: 4em;'>
2<sup>2</sup>=4, 2<sup>3</sup>=8, 2<sup>4</sup>=16, 2<sup>5</sup>=32 <br>
@ -17,41 +17,41 @@ Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
5<sup>2</sup>=25, 5<sup>3</sup>=125, 5<sup>4</sup>=625, 5<sup>5</sup>=3125 <br>
</div>
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
Se sono successivamente posizionati in ordine numerico, con eventuali ripetizioni rimosse, otteniamo la seguente sequenza di 15 termini distinti:
<div style='padding-left: 4em;'>
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
</div>
How many distinct terms are in the sequence generated by `ab` for 2 ≤ `a``n` and 2 ≤ `b``n`?
Quanti termini distinti ci sono nella sequenza generata da $a^b$ per 2 ≤ `a``n` e 2 ≤ `b``n`?
# --hints--
`distinctPowers(15)` should return a number.
`distinctPowers(15)` dovrebbe restituire un numero.
```js
assert(typeof distinctPowers(15) === 'number');
```
`distinctPowers(15)` should return 177.
`distinctPowers(15)` dovrebbe restituire 177.
```js
assert.strictEqual(distinctPowers(15), 177);
```
`distinctPowers(20)` should return 324.
`distinctPowers(20)` dovrebbe restituire 324.
```js
assert.strictEqual(distinctPowers(20), 324);
```
`distinctPowers(25)` should return 519.
`distinctPowers(25)` dovrebbe restituire 519.
```js
assert.strictEqual(distinctPowers(25), 519);
```
`distinctPowers(30)` should return 755.
`distinctPowers(30)` dovrebbe restituire 755.
```js
assert.strictEqual(distinctPowers(30), 755);

View File

@ -1,6 +1,6 @@
---
id: 5900f38a1000cf542c50fe9d
title: 'Problem 30: Digit n powers'
title: 'Problema 30: Potenze delle cifre'
challengeType: 5
forumTopicId: 301953
dashedName: problem-30-digit-n-powers
@ -8,7 +8,7 @@ dashedName: problem-30-digit-n-powers
# --description--
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
Sorprendentemente ci sono solo tre numeri che possono essere scritti come la somma delle quarte potenze delle loro cifre:
<div style='margin-left: 4em;'>
1634 = 1<sup>4</sup> + 6<sup>4</sup> + 3<sup>4</sup> + 4<sup>4</sup><br>
@ -16,39 +16,39 @@ Surprisingly there are only three numbers that can be written as the sum of four
9474 = 9<sup>4</sup> + 4<sup>4</sup> + 7<sup>4</sup> + 4<sup>4</sup><br>
</div>
As 1 = 1<sup>4</sup> is not a sum it is not included.
Dato che 1 = 1<sup>4</sup> non è una somma, esso non è incluso.
The sum of these numbers is 1634 + 8208 + 9474 = 19316.
La somma di questi numeri è 1634 + 8208 + 9474 = 19316.
Find the sum of all the numbers that can be written as the sum of `n` powers of their digits.
Trova la somma di tutti i numeri che possono essere scritti come la somma di `n` potenze delle loro cifre.
# --hints--
`digitnPowers(2)` should return a number.
`digitnPowers(2)` dovrebbe restituire un numero.
```js
assert(typeof digitnPowers(2) === 'number');
```
`digitnPowers(2)` should return 0.
`digitnPowers(2)` dovrebbe restituire 0.
```js
assert(digitnPowers(2) == 0);
```
`digitnPowers(3)` should return 1301.
`digitnPowers(3)` dovrebbe restituire 1301.
```js
assert(digitnPowers(3) == 1301);
```
`digitnPowers(4)` should return 19316.
`digitnPowers(4)` dovrebbe restituire 19316.
```js
assert(digitnPowers(4) == 19316);
```
`digitnPowers(5)` should return 443839.
`digitnPowers(5)` dovrebbe restituire 443839.
```js
assert(digitnPowers(5) == 443839);

View File

@ -1,6 +1,6 @@
---
id: 5900f38b1000cf542c50fe9e
title: 'Problem 31: Coin sums'
title: 'Problema 31: somme di monete'
challengeType: 5
forumTopicId: 301965
dashedName: problem-31-coin-sums
@ -8,43 +8,43 @@ dashedName: problem-31-coin-sums
# --description--
In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
In Inghilterra la moneta è composta da sterline, £, e pence, p, e ci sono 8 monete in circolazione:
<div style='margin-left: 4em;'>1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).</div>
<div style='margin-left: 4em;'>1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) e £2 (200p).</div>
It is possible to make £2 in the following way:
È possibile comporre 2 £ nel modo seguente:
<div style='margin-left: 4em;'>1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p</div>
How many different ways can `n` pence be made using any number of coins?
In quanti modi diversi si possono ottenere `n` pence usando qualsiasi numero di monete?
# --hints--
`coinSums(50)` should return a number.
`coinSums(50)` dovrebbe restituire un numero.
```js
assert(typeof coinSums(50) === 'number');
```
`coinSums(50)` should return 451.
`coinSums(50)` dovrebbe restituire 451.
```js
assert(coinSums(50) == 451);
```
`coinSums(100)` should return 4563.
`coinSums(100)` dovrebbe restituire 4563.
```js
assert(coinSums(100) == 4563);
```
`coinSums(150)` should return 21873.
`coinSums(150)` dovrebbe restituire 21873.
```js
assert(coinSums(150) == 21873);
```
`coinSums(200)` should return 73682.
`coinSums(200)` dovrebbe restituire 73682.
```js
assert(coinSums(200) == 73682);

View File

@ -1,6 +1,6 @@
---
id: 5900f38c1000cf542c50fe9f
title: 'Problem 32: Pandigital products'
title: 'Problema 32: prodotti pandigitali'
challengeType: 5
forumTopicId: 301976
dashedName: problem-32-pandigital-products
@ -8,47 +8,47 @@ dashedName: problem-32-pandigital-products
# --description--
We shall say that an `n`-digit number is pandigital if it makes use of all the digits 1 to `n` exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
Possiamo dire che un numero di `n` cifre è pandigitale se usa tutte le cifre da 1 a `n` esattamente una volta; per esempio, il numero a 5 cifre 15234 è pandigitale per le cifre da 1 a 5.
The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
Il prodotto 7259 è inusuale, in quanto l'identità 39 x 186 = 7254, contenente moltiplicando, moltiplicatore, e prodotto, è pandigitale per le cifre da 1 a 9.
Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through `n` pandigital.
Trova le somme di tutti i prodotti la cui identità moltiplicando/moltiplicatore/prodotto può essere scritta come pandigitale per le cifre da 1 a `n`.
**Hint:** Some products can be obtained in more than one way so be sure to only include it once in your sum.
**Indizio:** Alcuni prodotti possono essere ottenuti in più di un modo quindi assicurati di includerli una volta sola nella tua somma.
# --hints--
`pandigitalProducts(4)` should return a number.
`pandigitalProducts(4)` dovrebbe restituire un numero.
```js
assert(typeof pandigitalProducts(4) === 'number');
```
`pandigitalProducts(4)` should return `12`.
`pandigitalProducts(4)` dovrebbe restituire `12`.
```js
assert.strictEqual(pandigitalProducts(4), 12);
```
`pandigitalProducts(6)` should return `162`.
`pandigitalProducts(6)` dovrebbe restituire `162`.
```js
assert.strictEqual(pandigitalProducts(6), 162);
```
`pandigitalProducts(7)` should return `0`.
`pandigitalProducts(7)` dovrebbe restituire `0`.
```js
assert.strictEqual(pandigitalProducts(7), 0);
```
`pandigitalProducts(8)` should return `13458`.
`pandigitalProducts(8)` dovrebbe restituire `13458`.
```js
assert.strictEqual(pandigitalProducts(8), 13458);
```
`pandigitalProducts(9)` should return `45228`.
`pandigitalProducts(9)` dovrebbe restituire `45228`.
```js
assert.strictEqual(pandigitalProducts(9), 45228);

View File

@ -1,6 +1,6 @@
---
id: 5900f38d1000cf542c50fea0
title: 'Problem 33: Digit cancelling fractions'
title: 'Problemi 33: frazioni cancellando le cifre'
challengeType: 5
forumTopicId: 301987
dashedName: problem-33-digit-cancelling-fractions
@ -8,23 +8,23 @@ dashedName: problem-33-digit-cancelling-fractions
# --description--
The fraction <sup>49</sup>/<sub>98</sub> is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that <sup>49</sup>/<sub>98</sub> = <sup>4</sup>/<sub>8</sub>, which is correct, is obtained by cancelling the 9s.
La frazione <sup>49</sup>/<sub>98</sub> è una frazione peculiare, poiché un matematico senza esperienza tentando di semplificarla potrebbe credere incorrettamente che la semplificazione <sup>49</sup>/<sub>98</sub> = <sup>4</sup>/<sub>8</sub>, che è corretta, è ottenuta cancellando i 9.
We shall consider fractions like, <sup>30</sup>/<sub>50</sub> = <sup>3</sup>/<sub>5</sub>, to be trivial examples.
Possiamo considerare frazioni come <sup>30</sup>/<sub>50</sub> = <sup>3</sup>/<sub>5</sub> un esempio triviale.
There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.
Ci sono esattamente quattro esempi non triviali di questo tipo di frazioni, con valore minore di 1, e contenenti due cifre al numeratore e denominatore.
If the product of these four fractions is given in its lowest common terms, find the value of the denominator.
Se il prodotto di queste quattro frazioni è dato nel formato semplificato, trova il valore del denominatore.
# --hints--
`digitCancellingFractions()` should return a number.
`digitCancellingFractions()` dovrebbe restituire un numero.
```js
assert(typeof digitCancellingFractions() === 'number');
```
`digitCancellingFractions()` should return 100.
`digitCancellingFractions()` dovrebbe restituire 100.
```js
assert.strictEqual(digitCancellingFractions(), 100);

View File

@ -1,6 +1,6 @@
---
id: 5900f38e1000cf542c50fea1
title: 'Problem 34: Digit factorials'
title: 'Problema 34: fattoriali delle cifre'
challengeType: 5
forumTopicId: 301998
dashedName: problem-34-digit-factorials
@ -8,15 +8,15 @@ dashedName: problem-34-digit-factorials
# --description--
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
145 è un numero curioso, visto che 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the numbers and the sum of the numbers which are equal to the sum of the factorial of their digits.
Trova i numeri e le somme dei numeri che sono uguali alla somma dei fattoriali delle loro cifre.
**Note:** as 1! = 1 and 2! = 2 are not sums they are not included.
**Nota:** dato che 1! = 1 e 2! = 2 non sono somme essi non sono inclusi.
# --hints--
`digitFactorial()` should return an object.
`digitFactorial()` dovrebbe restituire un oggetto.
```js
assert.typeOf(digitFactorial(), 'object');

View File

@ -1,6 +1,6 @@
---
id: 5900f38f1000cf542c50fea2
title: 'Problem 35: Circular primes'
title: 'Problema 35: Primi circolari'
challengeType: 5
forumTopicId: 302009
dashedName: problem-35-circular-primes
@ -8,55 +8,55 @@ dashedName: problem-35-circular-primes
# --description--
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.
Il numero 197 è chiamato un primo circolare perché tutte le rotazioni delle cifre: 197, 971 e 719, sono esse stesse prime.
There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
Ci sono tredici di questi primi sotto il 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79 e 97.
How many circular primes are there below `n`, whereas 100 ≤ `n` ≤ 1000000?
Quanti primi circolari ci sono sotto `n`, dove 100 ≤ `n` ≤ 1000000?
**Note:**
**Nota:**
Circular primes individual rotation can exceed `n`.
La rotazione individuale di primi circolari può superare `n`.
# --hints--
`circularPrimes(100)` should return a number.
`circularPrimes(100)` dovrebbe restituire un numero.
```js
assert(typeof circularPrimes(100) === 'number');
```
`circularPrimes(100)` should return 13.
`circularPrimes(100)` dovrebbe restituire 13.
```js
assert(circularPrimes(100) == 13);
```
`circularPrimes(100000)` should return 43.
`circularPrimes(100000)` dovrebbe restituire 43.
```js
assert(circularPrimes(100000) == 43);
```
`circularPrimes(250000)` should return 45.
`circularPrimes(250000)` dovrebbe restituire 45.
```js
assert(circularPrimes(250000) == 45);
```
`circularPrimes(500000)` should return 49.
`circularPrimes(500000)` dovrebbe restituire 49.
```js
assert(circularPrimes(500000) == 49);
```
`circularPrimes(750000)` should return 49.
`circularPrimes(750000)` dovrebbe restituire 49.
```js
assert(circularPrimes(750000) == 49);
```
`circularPrimes(1000000)` should return 55.
`circularPrimes(1000000)` dovrebbe restituire 55.
```js
assert(circularPrimes(1000000) == 55);

View File

@ -1,6 +1,6 @@
---
id: 5900f3901000cf542c50fea3
title: 'Problem 36: Double-base palindromes'
title: 'Problema 36: palindromi in doppia base'
challengeType: 5
forumTopicId: 302020
dashedName: problem-36-double-base-palindromes
@ -8,39 +8,39 @@ dashedName: problem-36-double-base-palindromes
# --description--
The decimal number, 585 = 1001001001<sub>2</sub> (binary), is palindromic in both bases.
Il numero decimale 585 = 1001001001<sub>2</sub> (binary) è un palindromo in entrambe le basi.
Find the sum of all numbers, less than `n`, whereas 1000 ≤ `n` ≤ 1000000, which are palindromic in base 10 and base 2.
Trova la somma di tutti i numeri, meno di `n`, dove 1000 ≤ `n` ≤ 1000000, che sono palindromi in base 10 e in base 2.
(Please note that the palindromic number, in either base, may not include leading zeros.)
(Si noti che il numero palindromico, in entrambe le basi, non può includere zeri iniziali.)
# --hints--
`doubleBasePalindromes(1000)` should return a number.
`doubleBasePalindromes(1000)` dovrebbe restituire un numero.
```js
assert(typeof doubleBasePalindromes(1000) === 'number');
```
`doubleBasePalindromes(1000)` should return 1772.
`doubleBasePalindromes(1000)` dovrebbe restituire 1772.
```js
assert(doubleBasePalindromes(1000) == 1772);
```
`doubleBasePalindromes(50000)` should return 105795.
`doubleBasePalindromes(50000)` dovrebbe restituire 105795.
```js
assert(doubleBasePalindromes(50000) == 105795);
```
`doubleBasePalindromes(500000)` should return 286602.
`doubleBasePalindromes(500000)` dovrebbe restituire 286602.
```js
assert(doubleBasePalindromes(500000) == 286602);
```
`doubleBasePalindromes(1000000)` should return 872187.
`doubleBasePalindromes(1000000)` dovrebbe restituire 872187.
```js
assert(doubleBasePalindromes(1000000) == 872187);

View File

@ -1,6 +1,6 @@
---
id: 5900f3911000cf542c50fea4
title: 'Problem 37: Truncatable primes'
title: 'Problema 37: numeri primi troncabili'
challengeType: 5
forumTopicId: 302031
dashedName: problem-37-truncatable-primes
@ -8,39 +8,39 @@ dashedName: problem-37-truncatable-primes
# --description--
The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.
Il numero 3797 ha una proprietà interessante. Essendo esso stesso un numero primo, è possibile rimuovere continuosamente cifre da sinistra a destra, e rimane primo ad ogni stadio: 3797, 797, 97, e 7. Allo stesso modo possiamo farlo da destra a sinistra: 3797, 379, 37, e 3.
Find the sum of the only `n` (8 ≤ `n` ≤ 11) primes that are both truncatable from left to right and right to left.
Trova la somma dei soli `n` (8 ≤ `n` ≤ 11) numeri primi che sono troncabili sia da sinistra a destra che da destra a sinistra.
NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.
Nota: 2, 3, 5, e 7 non sono considerati numeri primi troncabili.
# --hints--
`truncatablePrimes(8)` should return a number.
`truncatablePrimes(8)` dovrebbe restituire un numero.
```js
assert(typeof truncatablePrimes(8) === 'number');
```
`truncatablePrimes(8)` should return 1986.
`truncatablePrimes(8)` dovrebbe restituire 1986.
```js
assert(truncatablePrimes(8) == 1986);
```
`truncatablePrimes(9)` should return 5123.
`truncatablePrimes(9)` dovrebbe restituire 5123.
```js
assert(truncatablePrimes(9) == 5123);
```
`truncatablePrimes(10)` should return 8920.
`truncatablePrimes(10)` dovrebbe restituire 8920.
```js
assert(truncatablePrimes(10) == 8920);
```
`truncatablePrimes(11)` should return 748317.
`truncatablePrimes(11)` dovrebbe restituire 748317.
```js
assert(truncatablePrimes(11) == 748317);

View File

@ -1,6 +1,6 @@
---
id: 5900f3931000cf542c50fea5
title: 'Problem 38: Pandigital multiples'
title: 'Problema 38: Multipli pandigitali'
challengeType: 5
forumTopicId: 302042
dashedName: problem-38-pandigital-multiples
@ -8,31 +8,31 @@ dashedName: problem-38-pandigital-multiples
# --description--
Take the number 192 and multiply it by each of 1, 2, and 3:
Prendi il numero 192 e moltiplicalo separatemente per 1, 2, e 3:
$$\begin{align} 192 × 1 = 192\\\\ 192 × 2 = 384\\\\ 192 × 3 = 576\\\\ \end{align}$$
By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1, 2, 3).
Concatenando ogni prodotto otteniamo il pandigitale di cifre da 1 a 9, 192384576. Chiamiamo 192384576 il prodotto concatenato di 192 e (1, 2, 3).
The same can be achieved by starting with 9 and multiplying by 1, 2, 3, 4, and 5, giving the pandigital, 918273645, which is the concatenated product of 9 and (1, 2, 3, 4, 5).
Lo stesso può essere ottenuto iniziando con 9 e moltiplicandolo con 1, 2, 3, 4, e 5, dando il numero pandigitale 918273645, che è il prodotto concatenato di 9 e (1, 2, 3, 4, 5).
What is the largest 1 to `k` pandigital `k`-digit number that can be formed as the concatenated product of an integer with (1, 2, ..., `n`) where `n` > 1?
Quale è il pandigitale con cifre da 1 a `k` lungo `k` cifre che può essere formato come prodotto concatenato di un numeri intero (1, 2, ..., `n`) dove `n` > 1?
# --hints--
`pandigitalMultiples(8)` should return a number.
`pandigitalMultiples(8)` dovrebbe restituire un numero.
```js
assert(typeof pandigitalMultiples(8) === 'number');
```
`pandigitalMultiples(8)` should return `78156234`.
`pandigitalMultiples(8)` dovrebbe restituire `78156234`.
```js
assert.strictEqual(pandigitalMultiples(8), 78156234);
```
`pandigitalMultiples(9)` should return `932718654`.
`pandigitalMultiples(9)` dovrebbe restituire `932718654`.
```js
assert.strictEqual(pandigitalMultiples(9), 932718654);

View File

@ -1,6 +1,6 @@
---
id: 5900f3931000cf542c50fea6
title: 'Problem 39: Integer right triangles'
title: 'Problema 39: triangoli rettangoli interi'
challengeType: 5
forumTopicId: 302054
dashedName: problem-39-integer-right-triangles
@ -8,39 +8,39 @@ dashedName: problem-39-integer-right-triangles
# --description--
If `p` is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.
Se `p` è il perimetro di un triangolo rettangolo con lunghezza dei lati di numeri interi, {a,b,c}, ci sono esattamente tre soluzioni per p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of `p``n`, is the number of solutions maximized?
Per quale valore di `p``n` il numero delle soluzioni viene massimizzato?
# --hints--
`intRightTriangles(500)` should return a number.
`intRightTriangles(500)` dovrebbe restituire un numero.
```js
assert(typeof intRightTriangles(500) === 'number');
```
`intRightTriangles(500)` should return 420.
`intRightTriangles(500)` dovrebbe restituire 420.
```js
assert(intRightTriangles(500) == 420);
```
`intRightTriangles(800)` should return 720.
`intRightTriangles(800)` dovrebbe restituire 720.
```js
assert(intRightTriangles(800) == 720);
```
`intRightTriangles(900)` should return 840.
`intRightTriangles(900)` dovrebbe restituire 840.
```js
assert(intRightTriangles(900) == 840);
```
`intRightTriangles(1000)` should return 840.
`intRightTriangles(1000)` dovrebbe restituire 840.
```js
assert(intRightTriangles(1000) == 840);

View File

@ -1,6 +1,6 @@
---
id: 5900f3941000cf542c50fea7
title: 'Problem 40: Champernowne''s constant'
title: 'Problema 40: costante di Champernowne'
challengeType: 5
forumTopicId: 302066
dashedName: problem-40-champernownes-constant
@ -8,37 +8,37 @@ dashedName: problem-40-champernownes-constant
# --description--
An irrational decimal fraction is created by concatenating the positive integers:
Una frazione decimale irrazionale è creata concatenando i numeri interi positivi:
0.12345678910**1**112131415161718192021...
It can be seen that the 12<sup>th</sup> digit of the fractional part is 1.
Puoi vedere che la dodicesima cifra della parte frazionale è 1.
If *d<sub>n</sub>* represents the *n*<sup>th</sup> digit of the fractional part, find the value of the following expression.
Se *d<sub>n</sub>* rappresenta la *n*-sima cifra della parte frazionale, trova il valore di questa espressione.
d<sub>1</sub> × d<sub>10</sub> × d<sub>100</sub> × d<sub>1000</sub> × d<sub>10000</sub> × d<sub>100000</sub> × d<sub>1000000</sub>
# --hints--
`champernownesConstant(100)` should return a number.
`champernownesConstant(100)` dovrebbe restituire un numero.
```js
assert(typeof champernownesConstant(100) === 'number');
```
`champernownesConstant(100)` should return 5.
`champernownesConstant(100)` dovrebbe restituire 5.
```js
assert.strictEqual(champernownesConstant(100), 5);
```
`champernownesConstant(1000)` should return 15.
`champernownesConstant(1000)` dovrebbe restituire 15.
```js
assert.strictEqual(champernownesConstant(1000), 15);
```
`champernownesConstant(1000000)` should return 210.
`champernownesConstant(1000000)` dovrebbe restituire 210.
```js
assert.strictEqual(champernownesConstant(1000000), 210);

View File

@ -1,6 +1,6 @@
---
id: 5900f3951000cf542c50fea8
title: 'Problem 41: Pandigital prime'
title: 'Problema 41: Primi pandigitali'
challengeType: 5
forumTopicId: 302078
dashedName: problem-41-pandigital-prime
@ -8,25 +8,25 @@ dashedName: problem-41-pandigital-prime
# --description--
We shall say that an `n`-digit number is pandigital if it makes use of all the digits 1 to `n` exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
Diremo che un numero di cifre `n` è pandigitale se utilizza tutte le cifre da 1 a `n` esattamente una volta. Ad esempio, 2143 è un pandigitale a 4 cifre ed è anche primo.
What is the largest `n`-length digit pandigital prime that exists?
Qual è il più grande pandigitale primo a `n` cifre esistente?
# --hints--
`pandigitalPrime(4)` should return a number.
`pandigitalPrime(4)` dovrebbe restituire un numero.
```js
assert(typeof pandigitalPrime(4) === 'number');
```
`pandigitalPrime(4)` should return 4231.
`pandigitalPrime(4)` dovrebbe restituire 4231.
```js
assert(pandigitalPrime(4) == 4231);
```
`pandigitalPrime(7)` should return 7652413.
`pandigitalPrime(7)` dovrebbe restituire 7652413.
```js
assert(pandigitalPrime(7) == 7652413);

View File

@ -1,6 +1,6 @@
---
id: 5900f3961000cf542c50fea9
title: 'Problem 42: Coded triangle numbers'
title: 'Problema 42: Numeri codificati triangolari'
challengeType: 5
forumTopicId: 302089
dashedName: problem-42-coded-triangle-numbers
@ -8,41 +8,41 @@ dashedName: problem-42-coded-triangle-numbers
# --description--
The `n`<sup>th</sup> term of the sequence of triangle numbers is given by, `tn` = ½`n`(`n`+1); so the first ten triangle numbers are:
L'`n`-simo termine di una sequenza di numeri triangolari è data da `tn` = ½`n`(`n`+1); quindi i primi dieci numeri triangolari sono:
<div style='margin-left: 4em;'>1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...</div>
By converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a word value. For example, the word value for SKY is 19 + 11 + 25 = 55 = `t`<sub>10</sub>. If the word value is a triangle number then we shall call the word a triangle word.
Convertendo ogni lettera in una parola in un numero corrispondente alla sua posizione nell'alfabeto a 26 lettere, e sommando questi valori otteniamo il valore della parola. Per esempio, il valore della parola SKY è 19 + 11 + 25 = 55 = `t`<sub>10</sub>. Se il valore della parola è un numero triangolare allora chiamiamo questa parola triangolare.
Using words array of `n`-length, how many are triangle words?
Usando array di parole lungo `n`, quante sono parole triangolari?
# --hints--
`codedTriangleNumbers(1400)` should return a number.
`codedTriangleNumbers(1400)` dovrebbe restituire un numero.
```js
assert(typeof codedTriangleNumbers(1400) === 'number');
```
`codedTriangleNumbers(1400)` should return 129.
`codedTriangleNumbers(1400)` dovrebbe restituire 129.
```js
assert(codedTriangleNumbers(1400) == 129);
```
`codedTriangleNumbers(1500)` should return 137.
`codedTriangleNumbers(1500)` dovrebbe restituire 137.
```js
assert(codedTriangleNumbers(1500) == 137);
```
`codedTriangleNumbers(1600)` should return 141.
`codedTriangleNumbers(1600)` dovrebbe restituire 141.
```js
assert(codedTriangleNumbers(1600) == 141);
```
`codedTriangleNumbers(1786)` should return 162.
`codedTriangleNumbers(1786)` dovrebbe restituire 162.
```js
assert(codedTriangleNumbers(1786) == 162);

View File

@ -1,6 +1,6 @@
---
id: 5900f3971000cf542c50feaa
title: 'Problem 43: Sub-string divisibility'
title: 'Problema 43: Divisibilità in sotto-stringhe'
challengeType: 5
forumTopicId: 302100
dashedName: problem-43-sub-string-divisibility
@ -8,49 +8,49 @@ dashedName: problem-43-sub-string-divisibility
# --description--
The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.
Il numero 1406357289 è un numero pandigitale da 0 a 9 perché è costituito da ciascuna delle cifre da 0 a 9 in un certo ordine, ma ha anche una proprietà di divisibilità in sotto-stringhe piuttosto interessante.
Let $d_1$ be the $1^{st}$ digit, $d_2$ be the $2^{nd}$ digit, and so on. In this way, we note the following:
Sia $d_1$ il $1^{st}$ numero, $d_2$ sia il $2^{nd}$ numero, e così via. In questo modo, notiamo quanto segue:
- ${d_2}{d_3}{d_4} = 406$ is divisible by 2
- ${d_3}{d_4}{d_5} = 063$ is divisible by 3
- ${d_4}{d_5}{d_6} = 635$ is divisible by 5
- ${d_5}{d_6}{d_7} = 357$ is divisible by 7
- ${d_6}{d_7}{d_8} = 572$ is divisible by 11
- ${d_7}{d_8}{d_9} = 728$ is divisible by 13
- ${d_8}{d_9}{d_{10}} = 289$ is divisible by 17
- ${d_2}{d_3}{d_4} = 406$ è divisibile per 2
- ${d_3}{d_4}{d_5} = 063$ è divisibile per 3
- ${d_4}{d_5}{d_6} = 635$ è divisibile per 5
- ${d_5}{d_6}{d_7} = 357$ è divisibile per 7
- ${d_6}{d_7}{d_8} = 572$ è divisibile per 11
- ${d_7}{d_8}{d_9} = 728$ è divisibile per 13
- ${d_8}{d_9}{d_{10}} = 289$ è divisibile per 17
Find the sum of all 0 to `n` pandigital numbers with sub-strings fulfilling `n - 2` of these divisibility properties.
Trova la somma di tutti i numeri pandigitali da 0 a `n` con sotto-stringhe che soddisfano `n - 2` di queste proprietà di divisibilità.
**Note:** Pandigital numbers starting with `0` are to be considered in the result.
**Nota:** i numeri pandigitali che iniziano con `0` devono essere considerati nel risultato.
# --hints--
`substringDivisibility(5)` should return a number.
`substringDivisibility(5)` dovrebbe restituire un numero.
```js
assert(typeof substringDivisibility(5) === 'number');
```
`substringDivisibility(5)` should return `12444480`.
`substringDivisibility(5)` dovrebbe restituire `12444480`.
```js
assert.strictEqual(substringDivisibility(5), 12444480)
```
`substringDivisibility(7)` should return `1099210170`.
`substringDivisibility(7)` dovrebbe restituire `1099210170`.
```js
assert.strictEqual(substringDivisibility(7), 1099210170)
```
`substringDivisibility(8)` should return `1113342912`.
`substringDivisibility(8)` dovrebbe restituire `1113342912`.
```js
assert.strictEqual(substringDivisibility(8), 1113342912)
```
`substringDivisibility(9)` should return `16695334890`.
`substringDivisibility(9)` dovrebbe restituire `16695334890`.
```js
assert.strictEqual(substringDivisibility(9), 16695334890)

View File

@ -1,6 +1,6 @@
---
id: 5900f3981000cf542c50feab
title: 'Problem 44: Pentagon numbers'
title: 'Problema 44: numeri pentagonali'
challengeType: 5
forumTopicId: 302111
dashedName: problem-44-pentagon-numbers
@ -8,23 +8,23 @@ dashedName: problem-44-pentagon-numbers
# --description--
Pentagonal numbers are generated by the formula, P<sub>n</sub>=`n`(3`n`1)/2. The first ten pentagonal numbers are:
Numeri pentagonali sono generati dalla formula P<sub>n</sub>=`n`(3`n`1)/2. I primi dieci numeri pentagonali sono:
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
It can be seen that P<sub>4</sub> + P<sub>7</sub> = 22 + 70 = 92 = P<sub>8</sub>. However, their difference, 70 22 = 48, is not pentagonal.
Possiamo vedere che P<sub>4</sub> + P<sub>7</sub> = 22 + 70 = 92 = P<sub>8</sub>. D'altro canto, la loro differenza, 70 22 = 48, non è pentagonale.
Find the pair of pentagonal numbers, P<sub>j</sub> and P<sub>k</sub>, for which their sum and difference are pentagonal and D = |P<sub>k</sub> P<sub>j</sub>| is minimized; what is the value of D?
Trova la coppia di numeri, P<sub>j</sub> and P<sub>k</sub>, per cui sia la loro somma che la loro differenza sono pentagonali e D = |P<sub>k</sub> P<sub>j</sub>| è minimizzata; quale è il valore di D?
# --hints--
`pentagonNumbers()` should return a number.
`pentagonNumbers()` dovrebbe restituire un numero.
```js
assert(typeof pentagonNumbers() === 'number');
```
`pentagonNumbers()` should return 5482660.
`pentagonNumbers()` dovrebbe restituire 5482660.
```js
assert.strictEqual(pentagonNumbers(), 5482660);

View File

@ -1,6 +1,6 @@
---
id: 5900f3991000cf542c50feac
title: 'Problem 45: Triangular, pentagonal, and hexagonal'
title: 'Problema 45: triangolari, pentagonali ed esagonali'
challengeType: 5
forumTopicId: 302122
dashedName: problem-45-triangular-pentagonal-and-hexagonal
@ -8,25 +8,25 @@ dashedName: problem-45-triangular-pentagonal-and-hexagonal
# --description--
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
Numeri triangolari, pentagonali, ed esagonali sono generati dalle seguenti formule:
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Triangle</div><div>T<sub>n</sub>=<var>n</var>(<var>n</var>+1)/2</div><div>1, 3, 6, 10, 15, ...</div></div>
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Pentagonal</div><div>P<sub>n</sub>=<var>n</var>(3<var>n</var>1)/2</div><div>1, 5, 12, 22, 35, ...</div></div>
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Hexagonal</div><div>H<sub>n</sub>=<var>n</var>(2<var>n</var>1)</div><div>1, 6, 15, 28, 45, ...</div></div>
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Triangolare</div><div>T<sub>n</sub>=<var>n</var>(<var>n</var>+1)/2</div><div>1, 3, 6, 10, 15, ...</div></div>
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Pentagonale</div><div>P<sub>n</sub>=<var>n</var>(3<var>n</var>1)/2</div><div>1, 5, 12, 22, 35, ...</div></div>
<div style='display: inline-grid; text-align: center; grid-template-columns: 135px 135px 260px; grid-template-rows: auto;'><div>Esagonale</div><div>H<sub>n</sub>=<var>n</var>(2<var>n</var>1)</div><div>1, 6, 15, 28, 45, ...</div></div>
It can be verified that T<sub>285</sub> = P<sub>165</sub> = H<sub>143</sub> = 40755.
Si può verificare che T<sub>285</sub> = P<sub>165</sub> = H<sub>143</sub> = 40755.
Find the next triangle number that is also pentagonal and hexagonal.
Trova il numero triangolare successivo che è anche pentagonale ed esagonale.
# --hints--
`triPentaHexa(40756)` should return a number.
`triPentaHexa(40756)` dovrebbe restituire un numero.
```js
assert(typeof triPentaHexa(40756) === 'number');
```
`triPentaHexa(40756)` should return 1533776805.
`triPentaHexa(40756)` dovrebbe restituire 1533776805.
```js
assert.strictEqual(triPentaHexa(40756), 1533776805);

View File

@ -1,6 +1,6 @@
---
id: 5900f39a1000cf542c50fead
title: 'Problem 46: Goldbach''s other conjecture'
title: 'Problema 46: L''altra congettura di Goldbach'
challengeType: 5
forumTopicId: 302134
dashedName: problem-46-goldbachs-other-conjecture
@ -8,7 +8,7 @@ dashedName: problem-46-goldbachs-other-conjecture
# --description--
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.
È stato proposto da Christian Goldbach che ogni numero dispari composito può essere scritto come la somma di un primo e due volte un quadrato.
<div style='margin-left: 2em;'>
9 = 7 + 2×1<sup>2</sup><br>
@ -19,19 +19,19 @@ It was proposed by Christian Goldbach that every odd composite number can be wri
33 = 31 + 2×1<sup>2</sup>
</div>
It turns out that the conjecture was false.
Si scoprì che la congettura era falsa.
What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
Qual è il più piccolo composito dispari che non può essere scritto come la somma di un primo e due volte un quadrato?
# --hints--
`goldbachsOtherConjecture()` should return a number.
`goldbachsOtherConjecture()` dovrebbe restituire un numero.
```js
assert(typeof goldbachsOtherConjecture() === 'number');
```
`goldbachsOtherConjecture()` should return 5777.
`goldbachsOtherConjecture()` dovrebbe restituire 5777.
```js
assert.strictEqual(goldbachsOtherConjecture(), 5777);

View File

@ -1,6 +1,6 @@
---
id: 5900f39c1000cf542c50feae
title: 'Problem 47: Distinct primes factors'
title: 'Problema 47: Fattori primi distinti'
challengeType: 5
forumTopicId: 302145
dashedName: problem-47-distinct-primes-factors
@ -8,14 +8,14 @@ dashedName: problem-47-distinct-primes-factors
# --description--
The first two consecutive numbers to have two distinct prime factors are:
I primi due numeri consecutivi ad avere due distinti fattori primi sono:
<div style='padding-left: 4em;'>
14 = 2 × 7<br>
15 = 3 × 5
</div>
The first three consecutive numbers to have three distinct prime factors are:
I primi tre numeri consecutivi che hanno tre fattori primi distinti sono:
<div style='padding-left: 4em;'>
644 = 2<sup>2</sup> × 7 × 23<br>
@ -23,29 +23,29 @@ The first three consecutive numbers to have three distinct prime factors are:
646 = 2 × 17 × 19
</div>
Find the first four consecutive integers to have four distinct prime factors each. What is the first of these numbers?
Trova i primi quattro interi consecutivi ad avere quattro distinti fattori primi ciascuno. Qual è il primo di questi numeri?
# --hints--
`distinctPrimeFactors(2, 2)` should return a number.
`distinctPrimeFactors(2, 2)` dovrebbe restituire un numero.
```js
assert(typeof distinctPrimeFactors(2, 2) === 'number');
```
`distinctPrimeFactors(2, 2)` should return 14.
`distinctPrimeFactors(2, 2)` dovrebbe restituire 14.
```js
assert.strictEqual(distinctPrimeFactors(2, 2), 14);
```
`distinctPrimeFactors(3, 3)` should return 644.
`distinctPrimeFactors(3, 3)` dovrebbe restituire 644.
```js
assert.strictEqual(distinctPrimeFactors(3, 3), 644);
```
`distinctPrimeFactors(4, 4)` should return 134043.
`distinctPrimeFactors(4, 4)` dovrebbe restituire 134043.
```js
assert.strictEqual(distinctPrimeFactors(4, 4), 134043);

View File

@ -1,6 +1,6 @@
---
id: 5900f39c1000cf542c50feaf
title: 'Problem 48: Self powers'
title: 'Problema 48: auto-potenze'
challengeType: 5
forumTopicId: 302157
dashedName: problem-48-self-powers
@ -8,37 +8,37 @@ dashedName: problem-48-self-powers
# --description--
The series, 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 10<sup>10</sup> = 10405071317.
La serie 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 10<sup>10</sup> = 10405071317.
Find the last ten digits of the series, 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 1000<sup>1000</sup>.
Trova le ultime dieci cifre della serie 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 1000<sup>1000</sup>.
# --hints--
`selfPowers(10, 3)` should return a number.
`selfPowers(10, 3)` dovrebbe restituire un numero.
```js
assert(typeof selfPowers(10, 3) === 'number');
```
`selfPowers(10, 3)` should return 317.
`selfPowers(10, 3)` dovrebbe restituire 317.
```js
assert.strictEqual(selfPowers(10, 3), 317);
```
`selfPowers(150, 6)` should return 29045.
`selfPowers(150, 6)` dovrebbe restituire 29045.
```js
assert.strictEqual(selfPowers(150, 6), 29045);
```
`selfPowers(673, 7)` should return 2473989.
`selfPowers(673, 7)` dovrebbe restituire 2473989.
```js
assert.strictEqual(selfPowers(673, 7), 2473989);
```
`selfPowers(1000, 10)` should return 9110846700.
`selfPowers(1000, 10)` dovrebbe restituire 9110846700.
```js
assert.strictEqual(selfPowers(1000, 10), 9110846700);

View File

@ -1,6 +1,6 @@
---
id: 5900f39d1000cf542c50feb0
title: 'Problem 49: Prime permutations'
title: 'Problema 49: permutazioni di numeri primi'
challengeType: 5
forumTopicId: 302159
dashedName: problem-49-prime-permutations
@ -8,21 +8,21 @@ dashedName: problem-49-prime-permutations
# --description--
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another.
La sequenza aritmetica, 1487, 4817, 8147, in cui ognuno dei termini cresce di 3330, è inusuale in due modi: (i) i tre termini sono primi, e, (ii) i tre numeri sono permutazioni.
There are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes, exhibiting this property, but there is one other 4-digit increasing sequence.
Non ci sono sequenze aritmetiche fatte di numeri primi a 1, 2 o 3 cifre che esibiscono questa proprietà, ma ce ne è un'altra sequenza crescente a 4 cifre.
What 12-digit number do you form by concatenating the three terms in this sequence?
Quale numero a 12 cifre ottieni concatenando i tre termini di questa sequenza?
# --hints--
`primePermutations()` should return a number.
`primePermutations()` dovrebbe restituire un numero.
```js
assert(typeof primePermutations() === 'number');
```
`primePermutations()` should return 296962999629.
`primePermutations()` dovrebbe restituire 296962999629.
```js
assert.strictEqual(primePermutations(), 296962999629);

View File

@ -1,6 +1,6 @@
---
id: 5900f39e1000cf542c50feb1
title: 'Problem 50: Consecutive prime sum'
title: 'Problema 50: somma di primi consecutivi'
challengeType: 5
forumTopicId: 302161
dashedName: problem-50-consecutive-prime-sum
@ -8,31 +8,31 @@ dashedName: problem-50-consecutive-prime-sum
# --description--
The prime 41, can be written as the sum of six consecutive primes:
Il primo 41, può essere scritto come la somma di sei primi consecutivi:
<div style='text-align: center;'>41 = 2 + 3 + 5 + 7 + 11 + 13</div>
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
Questa è la somma più lunga di primi consecutivi che dà come somma un primo sotto il cento.
The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to 953.
La somma più lunga di primi consecutivi sotto il mille che dà come somma un primo, contiene 21 termini, ed è pari a 953.
Which prime, below one-million, can be written as the sum of the most consecutive primes?
Quale primo, al di sotto di un milione, può essere scritto come la somma del maggior numero di numeri primi consecutivi?
# --hints--
`consecutivePrimeSum(1000)` should return a number.
`consecutivePrimeSum(1000)` dovrebbe restituire un numero.
```js
assert(typeof consecutivePrimeSum(1000) === 'number');
```
`consecutivePrimeSum(1000)` should return 953.
`consecutivePrimeSum(1000)` dovrebbe restituire 953.
```js
assert.strictEqual(consecutivePrimeSum(1000), 953);
```
`consecutivePrimeSum(1000000)` should return 997651.
`consecutivePrimeSum(1000000)` dovrebbe restituire 997651.
```js
assert.strictEqual(consecutivePrimeSum(1000000), 997651);
@ -54,42 +54,70 @@ consecutivePrimeSum(1000000);
# --solutions--
```js
function consecutivePrimeSum(limit) {
function isPrime(num) {
if (num < 2) {
return false;
} else if (num === 2) {
return true;
}
const sqrtOfNum = Math.floor(num ** 0.5);
for (let i = 2; i <= sqrtOfNum + 1; i++) {
if (num % i === 0) {
return false;
}
// Initalize prime number list with sieve
const NUM_PRIMES = 1000000;
const PRIMES = [2];
const PRIME_SIEVE = Array(Math.floor((NUM_PRIMES-1)/2)).fill(true);
(function initPrimes(num) {
const upper = Math.floor((num - 1) / 2);
const sqrtUpper = Math.floor((Math.sqrt(num) - 1) / 2);
for (let i = 0; i <= sqrtUpper; i++) {
if (PRIME_SIEVE[i]) {
// Mark value in PRIMES array
const prime = 2 * i + 3;
PRIMES.push(prime);
// Mark all multiples of this number as false (not prime)
const primeSqaredIndex = 2 * i ** 2 + 6 * i + 3;
for (let j = primeSqaredIndex; j < upper; j += prime)
PRIME_SIEVE[j] = false;
}
}
for (let i = sqrtUpper + 1; i < upper; i++) {
if (PRIME_SIEVE[i])
PRIMES.push(2 * i + 3);
}
})(NUM_PRIMES);
function isPrime(num) {
if (num === 2)
return true;
}
function getPrimes(limit) {
const primes = [];
for (let i = 0; i <= limit; i++) {
if (isPrime(i)) primes.push(i);
}
return primes;
}
else if (num % 2 === 0)
return false
else
return PRIME_SIEVE[(num - 3) / 2];
}
const primes = getPrimes(limit);
let primeSum = [...primes];
primeSum.reduce((acc, n, i) => {
primeSum[i] += acc;
return acc += n;
}, 0);
function consecutivePrimeSum(limit) {
// Initalize for longest sum < 100
let bestPrime = 41;
let bestI = 0;
let bestJ = 5;
for (let j = primeSum.length - 1; j >= 0; j--) {
for (let i = 0; i < j; i++) {
const sum = primeSum[j] - primeSum[i];
if (sum > limit) break;
if (isPrime(sum) && primes.indexOf(sum) > -1) return sum;
// Find longest sum < limit
let sumOfCurrRange = 41;
let i = 0, j = 5;
// -- Loop while current some starting at i is < limit
while (sumOfCurrRange < limit) {
let currSum = sumOfCurrRange;
// -- Loop while pushing j towards end of PRIMES list
// keeping sum under limit
while (currSum < limit) {
if (isPrime(currSum)) {
bestPrime = sumOfCurrRange = currSum;
bestI = i;
bestJ = j;
}
// -- Increment inner loop
j++;
currSum += PRIMES[j];
}
// -- Increment outer loop
i++;
j = i + (bestJ - bestI);
sumOfCurrRange -= PRIMES[i - 1];
sumOfCurrRange += PRIMES[j];
}
// Return
return bestPrime;
}
```

View File

@ -1,6 +1,6 @@
---
id: 5900f39f1000cf542c50feb2
title: 'Problem 51: Prime digit replacements'
title: 'Problema 51: sostituzioni di cifre nei primi'
challengeType: 5
forumTopicId: 302162
dashedName: problem-51-prime-digit-replacements
@ -8,33 +8,33 @@ dashedName: problem-51-prime-digit-replacements
# --description--
By replacing the 1st digit of the 2-digit number \*3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
Sostituendo la prima cifra del numero a 2 cifre \*3, si scopre che sei dei nove valori possibili: 13, 23, 43, 53, 73 e 83, sono tutti primi.
By replacing the 3rd and 4th digits of 56\*\*3 with the same digit, this 5-digit number is the first example having seven primes among the ten generated numbers, yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993. Consequently 56003, being the first member of this family, is the smallest prime with this property.
Sostituendo la terza e la quarta cifra di 56\*\*3 con la stessa cifra, questo numero a 5 cifre è il primo esempio con sette primi tra i dieci numeri generati, della famiglia: 56003, 56113, 56333, 56443, 56663, 56773 e 56993. Di conseguenza, 56003, essendo il primo membro di questa famiglia, è il più piccolo primo con questa proprietà.
Find the smallest prime which, by replacing part of the number (not necessarily adjacent digits) with the same digit, is part of an `n` prime value family.
Trova il primo più piccolo che, sostituendo parte del numero (non necessariamente cifre adiacenti) con la stessa cifra, fa parte di una famiglia di `n` valori primi.
# --hints--
`primeDigitReplacements(6)` should return a number.
`primeDigitReplacements(6)` dovrebbe restituire un numero.
```js
assert(typeof primeDigitReplacements(6) === 'number');
```
`primeDigitReplacements(6)` should return `13`.
`primeDigitReplacements(6)` dovrebbe restituire `13`.
```js
assert.strictEqual(primeDigitReplacements(6), 13);
```
`primeDigitReplacements(7)` should return `56003`.
`primeDigitReplacements(7)` dovrebbe restituire `56003`.
```js
assert.strictEqual(primeDigitReplacements(7), 56003);
```
`primeDigitReplacements(8)` should return `121313`.
`primeDigitReplacements(8)` dovrebbe restituire `121313`.
```js
assert.strictEqual(primeDigitReplacements(8), 121313);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a01000cf542c50feb3
title: 'Problem 52: Permuted multiples'
title: 'Problema 52: multipli permutati'
challengeType: 5
forumTopicId: 302163
dashedName: problem-52-permuted-multiples
@ -8,25 +8,25 @@ dashedName: problem-52-permuted-multiples
# --description--
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
Si può notare che il numero 125874 e il suo doppio, 251748, contengono esattamente le stesse cifre, ma in un ordine differente.
Find the smallest positive integer, such that multiplied by integers $\\{2, 3, \ldots, n\\}$, contain the same digits.
Trova il più piccolo numero intero positivo, che moltiplicato per gli interi $\\{2, 3, \ldots, n\\}$, contenga le stesse cifre.
# --hints--
`permutedMultiples(2)` should return a number.
`permutedMultiples(2)` dovrebbe restituire un numero.
```js
assert(typeof permutedMultiples(2) === 'number');
```
`permutedMultiples(2)` should return `125874`.
`permutedMultiples(2)` dovrebbe restituire `125874`.
```js
assert.strictEqual(permutedMultiples(2), 125874);
```
`permutedMultiples(6)` should return `142857`.
`permutedMultiples(6)` dovrebbe restituire `142857`.
```js
assert.strictEqual(permutedMultiples(6), 142857);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a11000cf542c50feb4
title: 'Problem 53: Combinatoric selections'
title: 'Problema 53: selezione combinatoria'
challengeType: 5
forumTopicId: 302164
dashedName: problem-53-combinatoric-selections
@ -8,45 +8,45 @@ dashedName: problem-53-combinatoric-selections
# --description--
There are exactly ten ways of selecting three from five, 12345:
Ci sono esattamente dieci modi di selezionare tre da cinque, 12345:
<div style='text-align: center;'>123, 124, 125, 134, 135, 145, 234, 235, 245, and 345</div>
<div style='text-align: center;'>123, 124, 125, 134, 135, 145, 234, 235, 245, e 345</div>
In combinatorics, we use the notation, $\\displaystyle \\binom 5 3 = 10$
In statistica combinatoria, usiamo la notazione, $\\displaystyle \\binom 5 3 = 10$
In general, $\\displaystyle \\binom n r = \\dfrac{n!}{r!(n-r)!}$, where $r \\le n$, $n! = n \\times (n-1) \\times ... \\times 3 \\times 2 \\times 1$, and $0! = 1$.
In generals, $\\displaystyle \\binom n r = \\dfrac{n!}{r!(n-r)!}$, dove $r \\le n$, $n! = n \\times (n-1) \\times ... \\times 3 \\times 2 \\times 1$, e $0! = 1$.
It is not until $n = 23$, that a value exceeds one-million: $\\displaystyle \\binom {23} {10} = 1144066$.
È solo raggiungendo $n = 23$, che un valore eccede un milione: $\\displaystyle \\binom {23} {10} = 1144066$.
How many, not necessarily distinct, values of $\\displaystyle \\binom n r$ for $1 \\le n \\le 100$, are greater than one-million?
Quanti, non necessariamente distinti, valori di $\\displaystyle \\binom n r$ per $1 \\le n \\le 100$, sono più grandi di un milione?
# --hints--
`combinatoricSelections(1000)` should return a number.
`combinatoricSelections(1000)` dovrebbe restituire un numero.
```js
assert(typeof combinatoricSelections(1000) === 'number');
```
`combinatoricSelections(1000)` should return 4626.
`combinatoricSelections(1000)` dovrebbe restituire 4626.
```js
assert.strictEqual(combinatoricSelections(1000), 4626);
```
`combinatoricSelections(10000)` should return 4431.
`combinatoricSelections(10000)` dovrebbe restituire 4431.
```js
assert.strictEqual(combinatoricSelections(10000), 4431);
```
`combinatoricSelections(100000)` should return 4255.
`combinatoricSelections(100000)` dovrebbe restituire 4255.
```js
assert.strictEqual(combinatoricSelections(100000), 4255);
```
`combinatoricSelections(1000000)` should return 4075.
`combinatoricSelections(1000000)` dovrebbe restituire 4075.
```js
assert.strictEqual(combinatoricSelections(1000000), 4075);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a21000cf542c50feb5
title: 'Problem 54: Poker hands'
title: 'Problema 54: mani di poker'
challengeType: 5
forumTopicId: 302165
dashedName: problem-54-poker-hands
@ -8,54 +8,54 @@ dashedName: problem-54-poker-hands
# --description--
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way:
Nel gioco di carte del poker, una mano è composta da cinque carte ed esse sono classificate, dalla più bassa alla più alta, nel modo seguente:
<ul>
<li>High Card: Highest value card.</li>
<li>One Pair: Two cards of the same value.</li>
<li>Two Pairs: Two different pairs.</li>
<li>Three of a Kind: Three cards of the same value.</li>
<li>Straight: All cards are consecutive values.</li>
<li>Flush: All cards of the same suit.</li>
<li>Full House: Three of a kind and a pair.</li>
<li>Four of a Kind: Four cards of the same value.</li>
<li>Straight Flush: All cards are consecutive values of same suit.</li>
<li>Royal Flush: Ten, Jack, Queen, King, Ace, in same suit.</li>
<li>Carta alta: Carta di valore più alto.</li>
<li>Una coppia: due carte dello stesso valore.</li>
<li>Due coppie: due coppie diverse.</li>
<li>Tre di un tipo: tre carte dello stesso valore.</li>
<li>Straight: tutte le carte hanno valori consecutivi.</li>
<li>Flush: Tutte le carte dello stesso seme.</li>
<li>Casa Completa: Tre di un tipo e una coppia.</li>
<li>Quattro di un tipo: Quattro carte dello stesso valore.</li>
<li>Scala: Tutte le carte sono valori consecutivi dello stesso seme.</li>
<li>Scala reale: Dieci, Jack, Regina, Re, Asso, nello stesso seme.</li>
</ul>
The cards are valued in the order: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace.
Le carte sono valutate nell'ordine: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Regina, Re, Asso.
If two players have the same ranked hands then the rank made up of the highest value wins; for example, a pair of eights beats a pair of fives (see example 1 below). But if two ranks tie, for example, both players have a pair of queens, then highest cards in each hand are compared (see example 4 below); if the highest cards tie then the next highest cards are compared, and so on.
Se due giocatori hanno mani dello stesso valore, allora il grado composto dal valore più alto vince; per esempio, un paio di otto batte un paio di cinque (vedi esempio 1 di seguito). Ma se due gradi sono pari, per esempio, entrambi i giocatori hanno un paio di regine, vengono confrontate le carte più alte in ogni mano (vedi esempio 4 in basso); se le carte più alte sonio pari allora vengono confrontate le carte più alte successive, e così via.
Consider the following five hands dealt to two players:
Considera le seguenti cinque mani distribuite a due giocatori:
| Hand | Player 1 | Player 2 | Winner |
| ------------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------- | -------- |
| <strong>1</strong> | 5H 5C 6S 7S KD <br> Pair of Fives | 2C 3S 8S 8D TD <br> Pair of Eights | Player 2 |
| <strong>2</strong> | 5D 8C 9S JS AC <br> Highest card Ace | 2C 5C 7D 8S QH <br> Highest card Queen | Player 1 |
| <strong>3</strong> | 2D 9C AS AH AC <br> Three Aces | 3D 6D 7D TD QD <br> Flush with Diamonds | Player 2 |
| <strong>4</strong> | 4D 6S 9H QH QC <br> Pair of Queens <br> Highest card Nine | 3D 6D 7H QD QS <br> Pair of Queens <br> Highest card Seven | Player 1 |
| <strong>5</strong> | 2H 2D 4C 4D 4S <br> Full House <br> with Three Fours | 3C 3D 3S 9S 9D <br> Full House <br> with Three Threes | Player 1 |
| Mano | Giocatore 1 | Giocatore 2 | Vincitore |
| ------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------- |
| <strong>1</strong> | 5H 5C 6S 7S KD <br> Coppia di cinque | 2C 3S 8S 8D TD <br> Coppia di otto | Giocatore 2 |
| <strong>2</strong> | 5D 8C 9S JS AC <br> Carta più alta Asso | 2C 5C 7D 8S QH <br> Carta più alta Regina | Giocatore 1 |
| <strong>3</strong> | 2D 9C AS AH AC <br> Tre assi | 3D 6D 7D TD QD <br> Full di quadri | Giocatore 2 |
| <strong>4</strong> | 4D 6S 9H QH QC <br> Coppia di Regine <br> Carta più alta Nove | 3D 6D 7H QD QS <br> Coppia di Regine <br> Carta più alta Sette | Giocatore 1 |
| <strong>5</strong> | 2H 2D 4C 4D 4S <br> Full <br> con tre Quattro | 3C 3D 3S 9S 9D <br> Full <br> con tre Tre | Giocatore 1 |
The global array (`handsArr`) passed to the function, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated by a single space): the first five are Player 1's cards and the last five are Player 2's cards. You can assume that all hands are valid (no invalid characters or repeated cards), each player's hand is in no specific order, and in each hand there is a clear winner.
L'array globale (`handsArr`) passato alla funzione, contiene mille mani casuali distribuite a due giocatori. Ogni riga del file contiene dieci carte (separate da uno spazio singolo): le prime cinque sono carte del giocatore 1 e le ultime cinque sono carte del giocatore 2. Si può presumere che tutte le mani siano valide (nessun carattere non valido o carte ripetute), la mano di ogni giocatore non è in ordine specifico, e in ogni mano c'è un chiaro vincitore.
How many hands does Player 1 win?
In quante mani vince Giocatore 1?
# --hints--
`pokerHands(testArr)` should return a number.
`pokerHands(testArr)` dovrebbe restituire un numero.
```js
assert(typeof pokerHands(testArr) === 'number');
```
`pokerHands(testArr)` should return 2.
`pokerHands(testArr)` dovrebbe restituire 2.
```js
assert.strictEqual(pokerHands(testArr), 2);
```
`pokerHands(handsArr)` should return 376.
`pokerHands(handsArr)` dovrebbe restituire 376.
```js
assert.strictEqual(pokerHands(handsArr), 376);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a31000cf542c50feb6
title: 'Problem 55: Lychrel numbers'
title: 'Problema 55: numeri di Lychrel'
challengeType: 5
forumTopicId: 302166
dashedName: problem-55-lychrel-numbers
@ -8,9 +8,9 @@ dashedName: problem-55-lychrel-numbers
# --description--
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic.
Se prendiamo 47, e gli sommiamo lo speculare, 47 + 74 = 121, che è palindromo.
Not all numbers produce palindromes so quickly. For example,
Non tutti i numeri producono palindromi così rapidamente. Ad esempio,
<div style="margin-left: 4em;">
349 + 943 = 1292,<br>
@ -18,49 +18,49 @@ Not all numbers produce palindromes so quickly. For example,
4213 + 3124 = 7337<br>
</div>
That is, 349 took three iterations to arrive at a palindrome.
Cioè 349 richiede tre iterazioni per arrivare a un palindromo.
Although no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).
Anche se nessuno lo ha ancora dimostrato, si pensa che alcuni numeri, come il 196, non producano mai un palindromo. Un numero che non forma mai un palindromo attraverso un processo di inversione e addizione è chiamato numero di Lychrel. Data la teoretica natura di questi numeri, e per il proposito di questo problema, assumiamo che un numero è un numeri di Lychrel fino a prova contraria. In aggiunta ti è dato che per ogni numero al di sotto di diecimila, questo (i) diventerà un palindromo in meno di cinquanta iterazioni, oppure, (ii), nessuno, con tutto il potere computazionale che esiste, è riuscito fin ora a mapparlo ad un palindromo. Infatti, 10677 è il primo numero trovato per cui sono necessarie più di cinquanta iterazioni prima di produrre un palindromo: 4668731596684224866951378664 (53 iterazioni, 28-cifre).
Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.
Sorprendentemente, ci sono numeri palindromi che sono a loro volta numeri di Lychrel; il primo esempio è 4994.
How many Lychrel numbers are there below `num`?
Quanti numeri di Lychrel ci sono sotto `num`?
**Note:** Wording was modified slightly on 24 April 2007 to emphasize the theoretical nature of Lychrel numbers.
**Nota:** La descrizione è stata modificata leggermente il giorno 24 Aprile 2007 per enfatizzare la natura teoretica dei numeri di Lychrel.
# --hints--
`countLychrelNumbers(1000)` should return a number.
`countLychrelNumbers(1000)` dovrebbe restituire un numero.
```js
assert(typeof countLychrelNumbers(1000) === 'number');
```
`countLychrelNumbers(1000)` should return 13.
`countLychrelNumbers(1000)` dovrebbe restituire 13.
```js
assert.strictEqual(countLychrelNumbers(1000), 13);
```
`countLychrelNumbers(3243)` should return 39.
`countLychrelNumbers(3243)` dovrebbe restituire 39.
```js
assert.strictEqual(countLychrelNumbers(3243), 39);
```
`countLychrelNumbers(5000)` should return 76.
`countLychrelNumbers(5000)` dovrebbe restituire 76.
```js
assert.strictEqual(countLychrelNumbers(5000), 76);
```
`countLychrelNumbers(7654)` should return 140.
`countLychrelNumbers(7654)` dovrebbe restituire 140.
```js
assert.strictEqual(countLychrelNumbers(7654), 140);
```
`countLychrelNumbers(10000)` should return 249.
`countLychrelNumbers(10000)` dovrebbe restituire 249.
```js
assert.strictEqual(countLychrelNumbers(10000), 249);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a41000cf542c50feb7
title: 'Problem 56: Powerful digit sum'
title: 'Problema 56: Somma delle cifre della potenza'
challengeType: 5
forumTopicId: 302167
dashedName: problem-56-powerful-digit-sum
@ -8,43 +8,43 @@ dashedName: problem-56-powerful-digit-sum
# --description--
A googol ($10^{100}$) is a massive number: one followed by one-hundred zeros; $100^{100}$ is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1.
Un googol ($10^{100}$) è un numero massivo: uno seguito da cento zeri; $100^{100}$ è un numero inimmaginabilmente grande: uno seguito da duecento zeri. Nonostante la loro dimensione, la somma delle cifre in ogni numero è solo 1.
Considering natural numbers of the form, $a^b$, where `a`, `b` &lt; `n`, what is the maximum digital sum?
Considerando numeri naturali nella forma, $a^b$, dove `a`, `b` &lt; `n`, qual è la somma massima delle cifre?
# --hints--
`powerfulDigitSum(3)` should return a number.
`powerfulDigitSum(3)` dovrebbe restituire un numero.
```js
assert(typeof powerfulDigitSum(3) === 'number');
```
`powerfulDigitSum(3)` should return `4`.
`powerfulDigitSum(3)` dovrebbe restituire `4`.
```js
assert.strictEqual(powerfulDigitSum(3), 4);
```
`powerfulDigitSum(10)` should return `45`.
`powerfulDigitSum(10)` dovrebbe restituire `45`.
```js
assert.strictEqual(powerfulDigitSum(10), 45);
```
`powerfulDigitSum(50)` should return `406`.
`powerfulDigitSum(50)` dovrebbe restituire `406`.
```js
assert.strictEqual(powerfulDigitSum(50), 406);
```
`powerfulDigitSum(75)` should return `684`.
`powerfulDigitSum(75)` dovrebbe restituire `684`.
```js
assert.strictEqual(powerfulDigitSum(75), 684);
```
`powerfulDigitSum(100)` should return `972`.
`powerfulDigitSum(100)` dovrebbe restituire `972`.
```js
assert.strictEqual(powerfulDigitSum(100), 972);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a51000cf542c50feb8
title: 'Problem 57: Square root convergents'
title: 'Problema 57: Radici quadrate convergenti'
challengeType: 5
forumTopicId: 302168
dashedName: problem-57-square-root-convergents
@ -8,11 +8,11 @@ dashedName: problem-57-square-root-convergents
# --description--
It is possible to show that the square root of two can be expressed as an infinite continued fraction.
È possibile dimostrare che la radice quadrata di due può essere espressa come una frazione infinita continua.
<div style='text-align: center;'>$\sqrt 2 =1+ \frac 1 {2+ \frac 1 {2 +\frac 1 {2+ \dots}}}$</div>
By expanding this for the first four iterations, we get:
Espandendola per le prime quattro iterazioni, otteniamo:
$1 + \\frac 1 2 = \\frac 32 = 1.5$
@ -22,31 +22,31 @@ $1 + \\frac 1 {2 + \\frac 1 {2+\\frac 1 2}} = \\frac {17}{12} = 1.41666 \\dots$
$1 + \\frac 1 {2 + \\frac 1 {2+\\frac 1 {2+\\frac 1 2}}} = \\frac {41}{29} = 1.41379 \\dots$
The next three expansions are $\\frac {99}{70}$, $\\frac {239}{169}$, and $\\frac {577}{408}$, but the eighth expansion, $\\frac {1393}{985}$, is the first example where the number of digits in the numerator exceeds the number of digits in the denominator.
Le prossime tre espansioni sono $\\frac {99}{70}$, $\\frac {239}{169}$, e $\\frac {577}{408}$, ma l'ottava espansione, $\\frac {1393}{985}$, è il primo esempio in cui il numero di cifre nel numeratore supera il numero di cifre nel denominatore.
In the first `n` expansions, how many fractions contain a numerator with more digits than denominator?
Nelle prime espansioni `n`, quante frazioni contengono un numeratore con più cifre di denominatore?
# --hints--
`squareRootConvergents(10)` should return a number.
`squareRootConvergents(10)` dovrebbe restituire un numero.
```js
assert(typeof squareRootConvergents(10) === 'number');
```
`squareRootConvergents(10)` should return 1.
`squareRootConvergents(10)` dovrebbe restituire 1.
```js
assert.strictEqual(squareRootConvergents(10), 1);
```
`squareRootConvergents(100)` should return 15.
`squareRootConvergents(100)` dovrebbe restituire 15.
```js
assert.strictEqual(squareRootConvergents(100), 15);
```
`squareRootConvergents(1000)` should return 153.
`squareRootConvergents(1000)` dovrebbe restituire 153.
```js
assert.strictEqual(squareRootConvergents(1000), 153);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a61000cf542c50feb9
title: 'Problem 58: Spiral primes'
title: 'Problema 58: Primi a spirale'
challengeType: 5
forumTopicId: 302169
dashedName: problem-58-spiral-primes
@ -8,7 +8,7 @@ dashedName: problem-58-spiral-primes
# --description--
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed.
Partendo da 1 e a spirale antioraria nel modo seguente, si forma una spirale quadrata con lunghezza laterale 7.
<div style='text-align: center;'>
<strong><span style='color: red;'>37</span></strong> 36 35 34 33 32 <strong><span style='color: red;'>31</span></strong><br>
@ -20,31 +20,31 @@ Starting with 1 and spiralling anticlockwise in the following way, a square spir
<strong><span style='color: red;'>43</span></strong> 44 45 46 47 48 49<br>
</div>
It is interesting to note that the odd squares lie along the bottom right diagonal, but what is more interesting is that 8 out of the 13 numbers lying along both diagonals are prime; that is, a ratio of 8/13 ≈ 62%.
È interessante notare che i quadrati dispari si trovano lungo la diagonale in basso a destra, ma ciò che è più interessante è che 8 dei 13 numeri che si trovano lungo entrambe le diagonali sono primi, cioè un rapporto di 8/13 ≈ 62%.
If one complete new layer is wrapped around the spiral above, a square spiral with side length 9 will be formed. If this process is continued, what is the side length of the square spiral for which the percent of primes along both diagonals first falls below `percent`?
Se un nuovo strato completo è avvolto intorno alla spirale sopra, verrà formata una spirale quadrata con lunghezza laterale 9. Se si prosegue con questo processo, qual è la lunghezza laterale della spirale quadrata per la quale la percentuale di primi lungo entrambe le diagonali cade prima al di sotto del `percent`?
# --hints--
`spiralPrimes(50)` should return a number.
`spiralPrimes(50)` dovrebbe restituire un numero.
```js
assert(typeof spiralPrimes(50) === 'number');
```
`spiralPrimes(50)` should return `11`.
`spiralPrimes(50)` dovrebbe restituire `11`.
```js
assert.strictEqual(spiralPrimes(50), 11);
```
`spiralPrimes(15)` should return `981`.
`spiralPrimes(15)` dovrebbe restituire `981`.
```js
assert.strictEqual(spiralPrimes(15), 981);
```
`spiralPrimes(10)` should return `26241`.
`spiralPrimes(10)` dovrebbe restituire `26241`.
```js
assert.strictEqual(spiralPrimes(10), 26241);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a81000cf542c50feba
title: 'Problem 59: XOR decryption'
title: 'Problema 59: decifrazione di XOR'
challengeType: 5
forumTopicId: 302170
dashedName: problem-59-xor-decryption
@ -8,25 +8,25 @@ dashedName: problem-59-xor-decryption
# --description--
Each character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (\*) = 42, and lowercase k = 107.
Ogni carattere in un computer ha assegnato un unico codice e lo standard preferito è ASCII (American Standard Code for Information Interchange - Codice standard americano per l'interscambio delle informazioni). Per esempio, A maiuscola = 65, asterisco (\*) = 42, e k minuscola = 107.
A modern encryption method is to take a text file, convert the bytes to ASCII, then XOR each byte with a given value, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the cipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.
Un metodo moderno di codifica è di prendere un file di testo, convertire i byte in ASCII, e poi usare l'operatore XOR su ogni byte con un valore dato, preso da una chiave segreta. Il vantaggio della funzione XOR è che usare la stessa chiave di codifica sul testo cifrato, rigenera il testo iniziare; per esempio, 65 XOR 42 = 107, e 107 XOR 42 = 65.
For unbreakable encryption, the key is the same length as the plain text message, and the key is made up of random bytes. The user would keep the encrypted message and the encryption key in different locations, and without both "halves", it is impossible to decrypt the message.
Per una codifica non decodificabile, la chiave è della stessa lunghezza del messaggio e la chiave è fatta di byte random. L'utente deve tenere il messaggio cifrato e la chiave di codifica in due posti diversi, e senza le due "metà", è impossibile decifrare il messaggio.
Unfortunately, this method is impractical for most users, so the modified method is to use a password as a key. If the password is shorter than the message, which is likely, the key is repeated cyclically throughout the message. The balance for this method is using a sufficiently long password key for security, but short enough to be memorable.
Sfortunatamente, questo metodo non è pratico per la maggior parte degli utenti, quindi il metodo modificato è di usare una password come chiave. Se la password è più corta del messaggio, cosa che è probabile, allora la chiave è ripetuta ciclicamente lungo il messaggio. L'equilibrio per questo metodo è usare una password sufficientemente lunga per questioni di sicurezza, ma abbastanza corta da essere memorizzabile.
Your task has been made easy, as the encryption key consists of three lower case characters. Using `cipher`, an array containing the encrypted ASCII codes, and the knowledge that the plain text must contain common English words, decrypt the message and find the sum of the ASCII values in the original text.
Il tuo compito è stato reso facile, la chiave di sicurezza consiste di tre lettere minuscole. Usando `cipher`, un array contenente i codici ASCII cifrati, e la conoscenza che il messaggio deve contenere parole comuni inglesi, decifra il messaggio e fai la somma dei valori ASCII del messaggio originale.
# --hints--
`XORDecryption(cipher)` should return a number.
`XORDecryption(cipher)` dovrebbe restituire un numero.
```js
assert(typeof XORDecryption(cipher) === 'number');
```
`XORDecryption(cipher)` should return 129448.
`XORDecryption(cipher)` dovrebbe restituire 129448.
```js
assert.strictEqual(XORDecryption(cipher), 129448);

View File

@ -1,6 +1,6 @@
---
id: 5900f3721000cf542c50fe85
title: 'Problem 6: Sum square difference'
title: 'Problema 6: Somma differenza quadrata'
challengeType: 5
forumTopicId: 302171
dashedName: problem-6-sum-square-difference
@ -8,39 +8,39 @@ dashedName: problem-6-sum-square-difference
# --description--
The sum of the squares of the first ten natural numbers is,
La somma dei quadrati dei primi dieci numeri naturali è,
<div style='text-align: center;'>1<sup>2</sup> + 2<sup>2</sup> + ... + 10<sup>2</sup> = 385</div>
The square of the sum of the first ten natural numbers is,
Il quadrato della somma dei primi dieci numeri naturali è
<div style='text-align: center;'>(1 + 2 + ... + 10)<sup>2</sup> = 55<sup>2</sup> = 3025</div>
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 385 = 2640.
Da qui la differenza tra la somma dei quadrati dei primi dieci numeri naturali e il quadrato della somma è 3025 385 = 2640.
Find the difference between the sum of the squares of the first `n` natural numbers and the square of the sum.
Trova la differenza tra la somma dei quadrati dei primi `n` numeri naturali e il quadrato della loro somma.
# --hints--
`sumSquareDifference(10)` should return a number.
`sumSquareDifference(10)` dovrebbe restituire un numero.
```js
assert(typeof sumSquareDifference(10) === 'number');
```
`sumSquareDifference(10)` should return 2640.
`sumSquareDifference(10)` dovrebbe restituire 2640.
```js
assert.strictEqual(sumSquareDifference(10), 2640);
```
`sumSquareDifference(20)` should return 41230.
`sumSquareDifference(20)` dovrebbe restituire 41230.
```js
assert.strictEqual(sumSquareDifference(20), 41230);
```
`sumSquareDifference(100)` should return 25164150.
`sumSquareDifference(100)` dovrebbe restituire 25164150.
```js
assert.strictEqual(sumSquareDifference(100), 25164150);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a81000cf542c50febb
title: 'Problem 60: Prime pair sets'
title: 'Problema 60: set di coppie di numeri primi'
challengeType: 5
forumTopicId: 302172
dashedName: problem-60-prime-pair-sets
@ -8,19 +8,19 @@ dashedName: problem-60-prime-pair-sets
# --description--
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property.
I primi 3, 7, 109, e 673 sono degni di nota. Prendendo qualsiasi due di questi numeri e concatenandoli in qualsiasi ordine, il risultato sarà sempre un numero primo. Per esempio, prendendo 7 e 109, sia 7109 che 1097 sono primi. La somma di questi quattro numeri primi, 792, rappresenta la somma più piccola per un set di 4 numeri primi con questa proprietà.
Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime.
Trova la somma più piccola per un set di cinque numeri primi in cui due numeri qualsiasi concatenati producono un altri numero primo.
# --hints--
`primePairSets()` should return a number.
`primePairSets()` dovrebbe restituire un numero.
```js
assert(typeof primePairSets() === 'number');
```
`primePairSets()` should return 26033.
`primePairSets()` dovrebbe restituire 26033.
```js
assert.strictEqual(primePairSets(), 26033);

View File

@ -1,6 +1,6 @@
---
id: 5900f3a91000cf542c50febc
title: 'Problem 61: Cyclical figurate numbers'
title: 'Problema 61: Numeri ciclici figurati'
challengeType: 5
forumTopicId: 302173
dashedName: problem-61-cyclical-figurate-numbers
@ -8,52 +8,52 @@ dashedName: problem-61-cyclical-figurate-numbers
# --description--
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:
Numeri triangolari, quadrati, pentagonali, esagonali, eptagonali e ottagonali sono tutti numeri che sono figurati (poligonali) e sono generati dalle seguenti formule:
| Type of Number | Formula | Sequence |
| Tipo di numero | Formula | Sequenza |
| -------------- | ----------------------------- | --------------------- |
| Triangle | $P_3(n) = \frac{n(n+1)}{2}$ | 1, 3, 6, 10, 15, ... |
| Square | $P_4(n) = n^2$ | 1, 4, 9, 16, 25, ... |
| Pentagonal | $P_5(n) = \frac{n(3n1)}2$ | 1, 5, 12, 22, 35, ... |
| Hexagonal | $P_6(n) = n(2n1)$ | 1, 6, 15, 28, 45, ... |
| Heptagonal | $P_7(n) = \frac{n(5n3)}{2}$ | 1, 7, 18, 34, 55, ... |
| Octagonal | $P_8(n) = n(3n2)$ | 1, 8, 21, 40, 65, ... |
| Triangolare | $P_3(n) = \frac{n(n+1)}{2}$ | 1, 3, 6, 10, 15, ... |
| Quadrato | $P_4(n) = n^2$ | 1, 4, 9, 16, 25, ... |
| Pentagonale | $P_5(n) = \frac{n(3n1)}2$ | 1, 5, 12, 22, 35, ... |
| Esagonale | $P_6(n) = n(2n1)$ | 1, 6, 15, 28, 45, ... |
| Eptagonale | $P_7(n) = \frac{n(5n3)}{2}$ | 1, 7, 18, 34, 55, ... |
| Ottagonale | $P_8(n) = n(3n2)$ | 1, 8, 21, 40, 65, ... |
The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.
Il set ordinato nei numeri a 4 cifre: 8128, 2882, 8281, ha tre interessanti proprietà.
1. The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with the first).
2. Each polygonal type: triangle ($P_3(127) = 8128$), square ($P_4(91) = 8281$), and pentagonal ($P_5(44) = 2882$), is represented by a different number in the set.
3. This is the only set of 4-digit numbers with this property.
1. Il set è ciclico, in quanto le ultime due cifre di ogni numero sono le prime due cifre del seguente (incluso l'ultimo numero con il primo).
2. Ogni tipo poligonale: triangolare ($P_3(127) = 8128$), quadrato ($P_4(91) = 8281$), e pentagonale ($P_5(44) = 2882$), è rappresentato da un diverso numero nel set.
3. Questo è l'unico set con numeri a quattro cifre con questa proprietà.
Find the sum of all numbers in ordered sets of `n` cyclic 4-digit numbers for which each of the $P_3$ to $P_{n + 2}$ polygonal types, is represented by a different number in the set.
Trova la somma di tutti i numeri in set ordinati di `n` numeri ciclici a quattro cifre per cui ognuno dei tipi poligonali da $P_3$ a $P_{n + 2}$ è rappresentato da un diverso numero nel set.
# --hints--
`cyclicalFigurateNums(3)` should return a number.
`cyclicalFigurateNums(3)` dovrebbe restituire un numero.
```js
assert(typeof cyclicalFigurateNums(3) === 'number');
```
`cyclicalFigurateNums(3)` should return `19291`.
`cyclicalFigurateNums(3)` dovrebbe restituire `19291`.
```js
assert.strictEqual(cyclicalFigurateNums(3), 19291);
```
`cyclicalFigurateNums(4)` should return `28684`.
`cyclicalFigurateNums(4)` dovrebbe restituire `28684`.
```js
assert.strictEqual(cyclicalFigurateNums(4), 28684);
```
`cyclicalFigurateNums(5)` should return `76255`.
`cyclicalFigurateNums(5)` dovrebbe restituire `76255`.
```js
assert.strictEqual(cyclicalFigurateNums(5), 76255);
```
`cyclicalFigurateNums(6)` should return `28684`.
`cyclicalFigurateNums(6)` dovrebbe restituire `28684`.
```js
assert.strictEqual(cyclicalFigurateNums(6), 28684);

View File

@ -1,6 +1,6 @@
---
id: 5900f3aa1000cf542c50febd
title: 'Problem 62: Cubic permutations'
title: 'Problema 62: permutazioni cubiche'
challengeType: 5
forumTopicId: 302174
dashedName: problem-62-cubic-permutations
@ -8,37 +8,37 @@ dashedName: problem-62-cubic-permutations
# --description--
The cube, 41063625 ($345^3$), can be permuted to produce two other cubes: 56623104 ($384^3$) and 66430125 ($405^3$). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.
Il cubo 41063625 ($345^3$), può essere permutato per produrre altri due cubi: 56623104 ($384^3$) e 66430125 ($405^3$). Infatti, 41063625 è il cubo più piccolo che ha esattamente tre permutazioni delle sue cifre che sono anch'esse dei cubi.
Find the smallest cube for which exactly `n` permutations of its digits are cube.
Trova il cubo più piccolo per il quale esattamente `n` permutazioni delle sue cifre sono dei cubi.
# --hints--
`cubicPermutations(2)` should return a number.
`cubicPermutations(2)` dovrebbe restituire un numero.
```js
assert(typeof cubicPermutations(2) === 'number');
```
`cubicPermutations(2)` should return `125`.
`cubicPermutations(2)` dovrebbe restituire `125`.
```js
assert.strictEqual(cubicPermutations(2), 125);
```
`cubicPermutations(3)` should return `41063625`.
`cubicPermutations(3)` dovrebbe restituire `41063625`.
```js
assert.strictEqual(cubicPermutations(3), 41063625);
```
`cubicPermutations(4)` should return `1006012008`.
`cubicPermutations(4)` dovrebbe restituire `1006012008`.
```js
assert.strictEqual(cubicPermutations(4), 1006012008);
```
`cubicPermutations(5)` should return `127035954683`.
`cubicPermutations(5)` dovrebbe restituire `127035954683`.
```js
assert.strictEqual(cubicPermutations(5), 127035954683);

View File

@ -1,6 +1,6 @@
---
id: 5900f3ab1000cf542c50febe
title: 'Problem 63: Powerful digit counts'
title: 'Problema 63: Conteggio cifre potenti'
challengeType: 5
forumTopicId: 302175
dashedName: problem-63-powerful-digit-counts
@ -8,73 +8,73 @@ dashedName: problem-63-powerful-digit-counts
# --description--
The 5-digit number, 16807 = 7<sup>5</sup>, is also a fifth power. Similarly, the 9-digit number, 134217728 = 8<sup>9</sup>, is a ninth power.
Il numero a 5 cifre, 16807 = 7<sup>5</sup>, è anche una quinta potenza. Analogamente, il numero a 9 cifre, 134217728 = 8<sup>9</sup>, è una nona potenza.
Complete the function so that it returns how many positive integers are of length `n` and an `n`th power.
Completa la funzione in modo che restituisca quanti interi positivi siano di lunghezza `n` e `n`ma potenza.
# --hints--
`powerfulDigitCounts(1)` should return a number.
`powerfulDigitCounts(1)` dovrebbe restituire un numero.
```js
assert(typeof powerfulDigitCounts(1) === 'number');
```
`powerfulDigitCounts(1)` should return `9`.
`powerfulDigitCounts(1)` dovrebbe restituire `9`.
```js
assert.strictEqual(powerfulDigitCounts(1), 9);
```
`powerfulDigitCounts(2)` should return `6`.
`powerfulDigitCounts(2)` dovrebbe restituire `6`.
```js
assert.strictEqual(powerfulDigitCounts(2), 6);
```
`powerfulDigitCounts(3)` should return `5`.
`powerfulDigitCounts(3)` dovrebbe restituire `5`.
```js
assert.strictEqual(powerfulDigitCounts(3), 5);
```
`powerfulDigitCounts(4)` should return `4`.
`powerfulDigitCounts(4)` dovrebbe restituire `4`.
```js
assert.strictEqual(powerfulDigitCounts(4), 4);
```
`powerfulDigitCounts(5)` should return `3`.
`powerfulDigitCounts(5)` dovrebbe restituire `3`.
```js
assert.strictEqual(powerfulDigitCounts(5), 3);
```
`powerfulDigitCounts(6)` should return `3`.
`powerfulDigitCounts(6)` dovrebbe restituire `3`.
```js
assert.strictEqual(powerfulDigitCounts(6), 3);
```
`powerfulDigitCounts(7)` should return `2`.
`powerfulDigitCounts(7)` dovrebbe restituire `2`.
```js
assert.strictEqual(powerfulDigitCounts(7), 2);
```
`powerfulDigitCounts(8)` should return `2`.
`powerfulDigitCounts(8)` dovrebbe restituire `2`.
```js
assert.strictEqual(powerfulDigitCounts(8), 2);
```
`powerfulDigitCounts(10)` should return `2`.
`powerfulDigitCounts(10)` dovrebbe restituire `2`.
```js
assert.strictEqual(powerfulDigitCounts(10), 2);
```
`powerfulDigitCounts(21)` should return `1`.
`powerfulDigitCounts(21)` dovrebbe restituire `1`.
```js
assert.strictEqual(powerfulDigitCounts(21), 1);

View File

@ -1,6 +1,6 @@
---
id: 5900f3731000cf542c50fe86
title: 'Problem 7: 10001st prime'
title: 'Problema 7: 10001esimo primo'
challengeType: 5
forumTopicId: 302182
dashedName: problem-7-10001st-prime
@ -8,43 +8,43 @@ dashedName: problem-7-10001st-prime
# --description--
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
Elencando i primi sei numeri principali: 2, 3, 5, 7, 11 e 13, possiamo vedere che il sesto primo è 13.
What is the `n`th prime number?
Qual è il `n`-simo numero primo?
# --hints--
`nthPrime(6)` should return a number.
`nthPrime(6)` dovrebbe restituire un numero.
```js
assert(typeof nthPrime(6) === 'number');
```
`nthPrime(6)` should return 13.
`nthPrime(6)` dovrebbe restituire 13.
```js
assert.strictEqual(nthPrime(6), 13);
```
`nthPrime(10)` should return 29.
`nthPrime(10)` dovrebbe restituire 29.
```js
assert.strictEqual(nthPrime(10), 29);
```
`nthPrime(100)` should return 541.
`nthPrime(100)` dovrebbe restituire 541.
```js
assert.strictEqual(nthPrime(100), 541);
```
`nthPrime(1000)` should return 7919.
`nthPrime(1000)` dovrebbe restituire 7919.
```js
assert.strictEqual(nthPrime(1000), 7919);
```
`nthPrime(10001)` should return 104743.
`nthPrime(10001)` dovrebbe restituire 104743.
```js
assert.strictEqual(nthPrime(10001), 104743);

View File

@ -1,6 +1,6 @@
---
id: 5900f3741000cf542c50fe87
title: 'Problem 8: Largest product in a series'
title: 'Problema 8: Prodotto più grande in una serie'
challengeType: 5
forumTopicId: 302193
dashedName: problem-8-largest-product-in-a-series
@ -8,7 +8,7 @@ dashedName: problem-8-largest-product-in-a-series
# --description--
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
Le quattro cifre adiacenti del numero a 1000 cifre che hanno il prodotto più grande sono 9 × 9 × 8 × 9 = 5832.
<div style='text-align: center;'>73167176531330624919225119674426574742355349194934</div>
<div style='text-align: center;'>96983520312774506326239578318016984801869478851843</div>
@ -31,23 +31,23 @@ The four adjacent digits in the 1000-digit number that have the greatest product
<div style='text-align: center;'>05886116467109405077541002256983155200055935729725</div>
<div style='text-align: center;'>71636269561882670428252483600823257530420752963450</div>
Find the `n` adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
Trova le `n` cifre adiacenti nel numero a 1000 cifre che hanno il prodotto più grande. Qual è il valore di questo prodotto?
# --hints--
`largestProductinaSeries(4)` should return a number.
`largestProductinaSeries(4)` dovrebbe restituire un numero.
```js
assert(typeof largestProductinaSeries(4) === 'number');
```
`largestProductinaSeries(4)` should return 5832.
`largestProductinaSeries(4)` dovrebbe restituire 5832.
```js
assert.strictEqual(largestProductinaSeries(4), 5832);
```
`largestProductinaSeries(13)` should return 23514624000.
`largestProductinaSeries(13)` dovrebbe restituire 23514624000.
```js
assert.strictEqual(largestProductinaSeries(13), 23514624000);

View File

@ -1,6 +1,6 @@
---
id: 5900f3761000cf542c50fe88
title: 'Problem 9: Special Pythagorean triplet'
title: 'Problema 9: Tripletta Pitagorica Speciale'
challengeType: 5
forumTopicId: 302205
dashedName: problem-9-special-pythagorean-triplet
@ -8,35 +8,35 @@ dashedName: problem-9-special-pythagorean-triplet
# --description--
A Pythagorean triplet is a set of three natural numbers, `a` &lt; `b` &lt; `c`, for which,
Una tripletta pitagorica è una serie di tre numeri naturali, `a` &lt; `b` &lt; `c` tali per cui
<div style='text-align: center;'><var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>c</var><sup>2</sup></div>
For example, 3<sup>2</sup> + 4<sup>2</sup> = 9 + 16 = 25 = 5<sup>2</sup>.
Ad esempio, 3<sup>2</sup> + 4<sup>2</sup> = 9 + 16 = 25 = 5<sup>2</sup>.
There exists exactly one Pythagorean triplet for which `a` + `b` + `c` = 1000. Find the product `abc` such that `a` + `b` + `c` = `n`.
Esiste esattamente una tripletta pitagorica per la quale `a` + `b` + `c` = 1000. Trova il prodotto `abc` tale che `a` + `b` + `c` = `n`.
# --hints--
`specialPythagoreanTriplet(24)` should return a number.
`specialPythagoreanTriplet(24)` dovrebbe restituire un numero.
```js
assert(typeof specialPythagoreanTriplet(24) === 'number');
```
`specialPythagoreanTriplet(24)` should return 480.
`specialPythagoreanTriplet(24)` dovrebbe restituire 480.
```js
assert.strictEqual(specialPythagoreanTriplet(24), 480);
```
`specialPythagoreanTriplet(120)` should return 49920, 55080 or 60000
`specialPythagoreanTriplet(120)` dovrebbe restituire 49920, 55080 o 60000
```js
assert([49920, 55080, 60000].includes(specialPythagoreanTriplet(120)));
```
`specialPythagoreanTriplet(1000)` should return 31875000.
`specialPythagoreanTriplet(1000)` dovrebbe restituire 31875000.
```js
assert.strictEqual(specialPythagoreanTriplet(1000), 31875000);