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

This commit is contained in:
camperbot
2022-02-28 13:29:21 +05:30
committed by GitHub
parent 5e5015e47d
commit fbc7a26529
127 changed files with 1288 additions and 1079 deletions

View File

@ -1,6 +1,6 @@
---
id: 606243f50267e718b1e755f4
title: Certificazione Database Relazionali
title: Certificazione Database Relazionale
certification: relational-database
challengeType: 7
isPrivate: true

View File

@ -25,14 +25,12 @@ function equalityTest(myVal) {
Se `myVal` è uguale a `10`, l'operatore di uguaglianza restituisce `true`, quindi il codice tra le parentesi graffe sarà eseguito, e la funzione restituirà `Equal`. In caso contrario, la funzione restituirà `Not Equal`. Affinché JavaScript possa confrontare due differenti <dfn>tipi di dato</dfn> (per esempio `numbers` e `strings`), deve convertire un tipo in un altro. Questa operazione è nota come conversione implicita. Dopo che è stata fatta, è possibile confrontare i termini come segue:
```js
1 == 1
1 == 2
1 == '1'
"3" == 3
1 == 1 // true
1 == 2 // false
1 == '1' // true
"3" == 3 // true
```
Nell'ordine, queste espressioni saranno valutate come `true`, `false`, `true`, e `true`.
# --instructions--
Aggiungi l'operatore di uguaglianza alla riga indicata in modo che la funzione restituisca la stringa `Equal` quando `val` è equivalente a `12`.

View File

@ -16,17 +16,15 @@ Come l'operatore di uguaglianza, l'operatore di maggioranza convertirà i tipi d
**Esempi**
```js
5 > 3
7 > '3'
2 > 3
'1' > 9
5 > 3 // true
7 > '3' // true
2 > 3 // false
'1' > 9 // false
```
Nell'ordine, queste espressioni saranno valutate come `true`, `true`, `false`, e `false`.
# --instructions--
Aggiungi l'operatore di maggioranza alle linee indicate in modo che istruzioni return abbiano senso.
Aggiungi l'operatore di maggioranza alle linee indicate in modo che le istruzioni return abbiano senso.
# --hints--
@ -54,7 +52,7 @@ assert(testGreaterThan(11) === 'Over 10');
assert(testGreaterThan(99) === 'Over 10');
```
`testGreaterThan(100)` deve restituire la stringa `Over 10`
`testGreaterThan(100)` dovrebbe restituire la stringa `Over 10`
```js
assert(testGreaterThan(100) === 'Over 10');

View File

@ -16,27 +16,25 @@ Come l'operatore di uguaglianza, l'operatore di maggioranza o uguaglianza conver
**Esempi**
```js
6 >= 6
7 >= '3'
2 >= 3
'7' >= 9
6 >= 6 // true
7 >= '3' // true
2 >= 3 // false
'7' >= 9 // false
```
Nell'ordine, queste espressioni saranno valutate `true`, `true`, `false`, e `false`.
# --instructions--
Aggiungi l'operatore di maggioranza o uguaglianza alle linee indicate in modo che le istruzioni return abbiano senso.
# --hints--
`testGreaterOrEqual(0)` dovrebbe restituire la stringa `less than10`
`testGreaterOrEqual(0)` dovrebbe restituire la stringa `Less than 10`
```js
assert(testGreaterOrEqual(0) === 'Less than 10');
```
`testGreaterOrEqual(9)` dovrebbe restituire la stringa `less than 10`
`testGreaterOrEqual(9)` dovrebbe restituire la stringa `Less than 10`
```js
assert(testGreaterOrEqual(9) === 'Less than 10');

View File

@ -14,18 +14,16 @@ L'operatore di disuguaglianza (`!=`) è l'opposto dell'operatore di uguaglianza.
**Esempi**
```js
1 != 2
1 != "1"
1 != '1'
1 != true
0 != false
1 != 2 // true
1 != "1" // false
1 != '1' // false
1 != true // false
0 != false // false
```
Nell'ordine, queste espressioni saranno valutate `true`, `false`, `false`, `false` e `false`.
# --instructions--
Aggiungi l'operatore di disuguaglianza `!=` nella condizione dell' `if` in modo che la funzione restituisca la stringa `Not Equal` quando `val` non equivale a `99`.
Aggiungi l'operatore di disuguaglianza `!=` nella condizione dell'`if` in modo che la funzione restituisca la stringa `Not Equal` quando `val` non è equivalente a `99`.
# --hints--

View File

@ -14,15 +14,13 @@ L'operatore di minoranza (`<`) confronta i valori di due numeri. Se il numero a
**Esempi**
```js
2 < 5
'3' < 7
5 < 5
3 < 2
'8' < 4
2 < 5 // true
'3' < 7 // true
5 < 5 // false
3 < 2 // false
'8' < 4 // false
```
Nell'ordine, queste espressioni saranno valutate `true`, `true`, `false`, `false`, e `false`.
# --instructions--
Aggiungi l'operatore di minoranza alle linee indicate in modo che le istruzioni return abbiano senso.

View File

@ -14,15 +14,13 @@ L'operatore di minoranza o uguaglianza (`<=`) confronta i valori di due numeri.
**Esempi**
```js
4 <= 5
'7' <= 7
5 <= 5
3 <= 2
'8' <= 4
4 <= 5 // true
'7' <= 7 // true
5 <= 5 // true
3 <= 2 // false
'8' <= 4 // false
```
Nell'ordine, queste espressioni saranno valutate `true`, `true`, `true`, `false` e `false`.
# --instructions--
Aggiungi l'operatore di minoranza o uguaglianza alle linee indicate in modo che le dichiarazioni return abbiano senso.
@ -59,7 +57,7 @@ assert(testLessOrEqual(23) === 'Smaller Than or Equal to 24');
assert(testLessOrEqual(24) === 'Smaller Than or Equal to 24');
```
`testLessOrEqual(25)` dovrebbe restituire la stringa `more than 24`
`testLessOrEqual(25)` dovrebbe restituire la stringa `More Than 24`
```js
assert(testLessOrEqual(25) === 'More Than 24');

View File

@ -16,12 +16,10 @@ Se i valori confrontati hanno tipi diversi, sono considerati ineguali, e l'opera
**Esempi**
```js
3 === 3
3 === '3'
3 === 3 // true
3 === '3' // false
```
Queste condizioni restituiranno rispettivamente `true` e `false`.
Nel secondo esempio, `3` è un tipo `Number` e `'3'` è un tipo `String`.
# --instructions--
@ -48,7 +46,7 @@ assert(testStrict(7) === 'Equal');
assert(testStrict('7') === 'Not Equal');
```
È necessario utilizzare l'operatore `===`
Dovresti usare l'operatore `===`
```js
assert(code.match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0);

View File

@ -14,13 +14,11 @@ L'operatore di disuguaglianza stretta (`!==`) è l'opposto logico dell'operatore
**Esempi**
```js
3 !== 3
3 !== '3'
4 !== 3
3 !== 3 // false
3 !== '3' // true
4 !== 3 // true
```
Nell'ordine, queste espressioni restituiscono `false`,`true` e `true`.
# --instructions--
Aggiungi l'operatore di disuguaglianza stretta all'istruzione `if` in modo che la funzione restituisca la stringa `Not Equal` quando `val` non è strettamente uguale a `17`

View File

@ -25,7 +25,7 @@ Esempio:
const ourStr = "I come first. " + "I come second.";
```
La stringa `I come first. I come second.` sarebbe visualizzata nella console.
La stringa `I come first. I come second.` sarà mostrata nella console.
# --instructions--
Costruisci `myStr` dalle stringhe `This is the start.` e `This is the end.` usando l'operatore `+`. Assicurati di includere uno spazio tra le due stringhe.

View File

@ -186,6 +186,12 @@ assert(telephoneCheck('(555)5(55?)-5555') === false);
assert(telephoneCheck('55 55-55-555-5') === false);
```
`telephoneCheck("11 555-555-5555")` dovrebbe restituire `false`.
```js
assert(telephoneCheck('11 555-555-5555') === false);
```
# --seed--
## --seed-contents--

View File

@ -1,6 +1,6 @@
---
id: 5900f3d01000cf542c50fee3
title: 'Problem 100: Arranged probability'
title: 'Problema 100: Probabilità degli arrangiamenti'
challengeType: 5
forumTopicId: 301724
dashedName: problem-100-arranged-probability
@ -8,47 +8,47 @@ dashedName: problem-100-arranged-probability
# --description--
If a box contains twenty-one colored discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs.
Se una scatola contiene ventuno dischi colorati, composti da quindici dischi blu e sei dischi rossi, e due dischi sono stati prelevati a caso, si può vedere la probabilità di prendere due dischi blu.
$${P(BB)} = \frac{15}{21}×\frac{14}{20} = \frac{1}{2}$$
$$${P(BB)} = \frac{15}{21}×\frac{14}{20} = \frac{1}{2}$$
The next such arrangement, for which there is exactly a 50% chance of taking two blue discs at random, is a box containing eighty-five blue discs and thirty-five red discs.
Il prossimo arrangiamento, per il quale vi è esattamente una probabilità del 50% di prendere due dischi blu a caso, è una scatola contenente ottantacinque dischi blu e trentacinque dischi rossi.
By finding the first arrangement to contain over `limit` discs in total, determine the number of blue discs that the box would contain.
Trovando la prima disposizione che contiene più di `limit` dischi in totale, determina il numero di dischi blu che la scatola contiene.
# --hints--
`arrangedProbability(20)` should return a number.
`arrangedProbability(20)` dovrebbe restituire un numero.
```js
assert(typeof arrangedProbability(10) === 'number');
```
`arrangedProbability(20)` should return `15`.
`arrangedProbability(20)` dovrebbe restituire `15`.
```js
assert.strictEqual(arrangedProbability(20), 15);
```
`arrangedProbability(100)` should return `85`.
`arrangedProbability(100)` dovrebbe restituire `85`.
```js
assert.strictEqual(arrangedProbability(100), 85);
```
`arrangedProbability(100000)` should return `97513`.
`arrangedProbability(100000)` dovrebbe restituire `97513`.
```js
assert.strictEqual(arrangedProbability(100000), 97513);
```
`arrangedProbability(1000000000)` should return `3822685023`.
`arrangedProbability(1000000000)` dovrebbe restituire `3822685023`.
```js
assert.strictEqual(arrangedProbability(1000000000), 3822685023);
```
`arrangedProbability(1000000000000)` should return `756872327473`.
`arrangedProbability(1000000000000)` dovrebbe restituire `756872327473`.
```js
assert.strictEqual(arrangedProbability(1000000000000), 756872327473);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d21000cf542c50fee4
title: 'Problem 101: Optimum polynomial'
title: 'Problema 101: Polinomiale ottimale'
challengeType: 5
forumTopicId: 301725
dashedName: problem-101-optimum-polynomial
@ -8,29 +8,29 @@ dashedName: problem-101-optimum-polynomial
# --description--
If we are presented with the first k terms of a sequence it is impossible to say with certainty the value of the next term, as there are infinitely many polynomial functions that can model the sequence.
Se ci vengono presentati i primi k termini di una sequenza è impossibile dire con certezza il valore del prossimo termine, poiché ci sono infinite funzioni polinomiali che possono rappresentare la sequenza.
As an example, let us consider the sequence of cube numbers. This is defined by the generating function, $u_n = n^3: 1, 8, 27, 64, 125, 216, \ldots$
Ad esempio, prendiamo in considerazione la sequenza delle potenze cubiche. Questa è definita dalla funzione generatrice, $u_n = n^3: 1, 8, 27, 64, 125, 216, \ldots$
Suppose we were only given the first two terms of this sequence. Working on the principle that "simple is best" we should assume a linear relationship and predict the next term to be 15 (common difference 7). Even if we were presented with the first three terms, by the same principle of simplicity, a quadratic relationship should be assumed.
Supponiamo che ci siano stati dati soltanto i primi due termini di questa sequenza. Lavorando sul principio che "semplice è meglio" dovremmo assumere una relazione lineare e prevedere che il prossimo termine sarà 15 (differenza comune 7). Anche se ci sono stati presentati i primi tre termini, per lo stesso principio di semplicità, dovremmo ipotizzare una relazione quadratica.
We shall define $OP(k, n)$ to be the $n^{th}$ term of the optimum polynomial generating function for the first k terms of a sequence. It should be clear that $OP(k, n)$ will accurately generate the terms of the sequence for $n ≤ k$, and potentially the first incorrect term (FIT) will be $OP(k, k+1)$; in which case we shall call it a bad OP (BOP).
Definiremo $OP(k, n)$ come il $n^{th}$ termine della funzione generatrice polinomiale ottimale per i primi k termini di una sequenza. Dovrebbe essere chiaro che $OP(k, n)$ genererà con precisione i termini della sequenza per $n ≤ k$, e potenzialmente il primo termine errato (FIT) sarà $OP(k, k+1)$; in questo caso lo chiameremo un cattivo OP (BOP).
As a basis, if we were only given the first term of sequence, it would be most sensible to assume constancy; that is, for $n ≥ 2, OP(1, n) = u_1$.
Di base, se ci fosse stato dato solo il primo termine della sequenza, sarebbe più ragionevole assumere la costanza; cioè, per $n ≥ 2, OP(1, n) = u_1$.
Hence we obtain the following OPs for the cubic sequence:
Quindi otterremo i seguenti PO per la sequenza cubica:
$$\begin{array}{ll} OP(1, n) = 1 & 1, {\color{red}1}, 1, 1, \ldots \\\\ OP(2, n) = 7n6 & 1, 8, {\color{red}{15}}, \ldots \\\\ OP(3, n) = 6n^211n+6 & 1, 8, 27, {\color{red}{58}}, \ldots \\\\ OP(4, n) = n^3 & 1, 8, 27, 64, 125, \ldots \end{array}$$
Clearly no BOPs exist for k ≥ 4. By considering the sum of FITs generated by the BOPs (indicated in $\color{red}{red}$ above), we obtain 1 + 15 + 58 = 74. Consider the following tenth degree polynomial generating function:
Chiaramente non esistono BOP per k ≥ 4. Considerando la somma delle FIT generate dai BOP (indicata in $\color{red}{red}$ sopra), otteniamo 1 + 15 + 58 = 74. Considera la seguente funzione generatrice polinomiale di decimo grado:
$$u_n = 1 n + n^2 n^3 + n^4 n^5 + n^6 n^7 + n^8 n^9 + n^{10}$$
Find the sum of FITs for the BOPs.
Trova la somma delle FIT per i BOP.
# --hints--
`optimumPolynomial()` should return `37076114526`.
`optimumPolynomial()` dovrebbe restituire `37076114526`.
```js
assert.strictEqual(optimumPolynomial(), 37076114526);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d21000cf542c50fee5
title: 'Problem 102: Triangle containment'
title: 'Problema 102: Contenimento del triangolo'
challengeType: 5
forumTopicId: 301726
dashedName: problem-102-triangle-containment
@ -8,9 +8,9 @@ dashedName: problem-102-triangle-containment
# --description--
Three distinct points are plotted at random on a Cartesian plane, for which -1000 ≤ x, y ≤ 1000, such that a triangle is formed.
Tre punti distinti sono tracciati a caso su un piano cartesiano, per il quale -1000 ≤ x, y ≤ 1000, in modo che si formi un triangolo.
Consider the following two triangles:
Considera i due triangoli seguenti:
```js
const exampleTriangles = [
@ -19,31 +19,31 @@ const exampleTriangles = [
];
```
It can be verified that first triangle contains the origin, whereas second triangle does not.
Si può verificare che il primo triangolo contiene l'origine, mentre il secondo triangolo no.
Using the `triangles` array containing coordinates of triangles, find the number of triangles for which the interior contains the origin.
Utilizzando l'array `triangles` contenente coordinate di triangoli, trovare il numero di triangoli il cui interno contiene l'origine.
# --hints--
`triangleContainment(exampleTriangles)` should return a number.
`triangleContainment(exampleTriangles)` dovrebbe restituire un numero.
```js
assert(typeof triangleContainment(_exampleTriangles) === 'number');
```
`triangleContainment(exampleTriangles)` should return `1`.
`triangleContainment(exampleTriangles)` dovrebbe restituire `1`.
```js
assert.strictEqual(triangleContainment(_exampleTriangles), 1);
```
`triangleContainment(testTriangles1)` should return `19`.
`triangleContainment(testTriangles1)` dovrebbe restituire `19`.
```js
assert.strictEqual(triangleContainment(_testTriangles1), 19);
```
`triangleContainment(testTriangles2)` should return `228`.
`triangleContainment(testTriangles2)` dovrebbe restituire `228`.
```js
assert.strictEqual(triangleContainment(_testTriangles2), 228);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d61000cf542c50fee7
title: 'Problem 103: Special subset sums: optimum'
title: 'Problema 103: Somme speciali dei sottoinsiemi: ottimali'
challengeType: 5
forumTopicId: 301727
dashedName: problem-103-special-subset-sums-optimum
@ -8,26 +8,26 @@ dashedName: problem-103-special-subset-sums-optimum
# --description--
Let $S(A)$ represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
Lascia che $S(A)$ rappresenti la somma degli elementi nel set A di dimensione n. La chiameremo una somma speciale se, per due sottoinsiemi disgiunti e non vuoti, B e C, le seguenti proprietà sono vere:
1. $S(B) ≠ S(C)$; that is, sums of subsets cannot be equal.
2. If B contains more elements than C then $S(B) > S(C)$.
1. $S(B) ≠ S(C)$; cioè, le somme dei sottoinsiemi non possono essere uguali.
2. Se B contiene più elementi di C allora $S(B) > S(C)$.
If $S(A)$ is minimised for a given n, we shall call it an optimum special sum set. The first five optimum special sum sets are given below.
Se $S(A)$ è minimizzata per un dato n, la chiameremo somma speciale di un set ottimale. Le prime cinque somme speciali di un set ottimale sono date sotto.
$$\begin{align} & n = 1: \\{1\\} \\\\ & n = 2: \\{1, 2\\} \\\\ & n = 3: \\{2, 3, 4\\} \\\\ & n = 4: \\{3, 5, 6, 7\\} \\\\ & n = 5: \\{6, 9, 11, 12, 13\\} \\\\ \end{align}$$
It seems that for a given optimum set, $A = \\{a_1, a_2, \ldots, a_n\\}$, the next optimum set is of the form $B = \\{b, a_1 + b, a_2 + b, \ldots, a_n + b\\}$, where b is the "middle" element on the previous row.
Sembra che per un dato set ottimale, $A = \\{a_1, a_2, \ldots, a_n\\}$, il successivo set ottimale è della forma $B = \\{b, a_1 + b, a_2 + b, \ldots, a_n + b\\}$, dove b è l'elemento "di mezzo" della riga precedente.
By applying this "rule" we would expect the optimum set for $n = 6$ to be $A = \\{11, 17, 20, 22, 23, 24\\}$, with $S(A) = 117$. However, this is not the optimum set, as we have merely applied an algorithm to provide a near optimum set. The optimum set for $n = 6$ is $A = \\{11, 18, 19, 20, 22, 25\\}$, with $S(A) = 115$ and corresponding set string: `111819202225`.
Apllicando la "regola" ci aspetteremmo il set ottimale per $n = 6$ sia $A = \\{11, 17, 20, 22, 23, 24\\}$, con $S(A) = 117$. Invece, questo non è il set ottimale, visto che abbiamo semplicemente applicato un algoritmo per ottenere un set quasi ottimale. Il set ottimale per $n = 6$ è $A = \\{11, 18, 19, 20, 22, 25\\}$, con $S(A) = 115$ e la stringa set corrispondente: `111819202225`.
Given that A is an optimum special sum set for $n = 7$, find its set string.
Dato che A è un set ottimale di somma speciale per for $n = 7$, trova la sua stringa.
**Note:** This problem is related to Problem 105 and Problem 106.
**Nota:** Questo problema è legato al Problema 105 e al Problema 106.
# --hints--
`optimumSpecialSumSet()` should return the string `20313839404245`.
`optimumSpecialSumSet()` dovrebbe restituire la stringa `20313839404245`.
```js
assert.strictEqual(optimumSpecialSumSet(), '20313839404245');

View File

@ -1,6 +1,6 @@
---
id: 5900f3d51000cf542c50fee6
title: 'Problem 104: Pandigital Fibonacci ends'
title: 'Problema 104: finali di Fibonacci pandigitali'
challengeType: 5
forumTopicId: 301728
dashedName: problem-104-pandigital-fibonacci-ends
@ -8,17 +8,17 @@ dashedName: problem-104-pandigital-fibonacci-ends
# --description--
The Fibonacci sequence is defined by the recurrence relation:
La sequenza di Fibonacci è definita dalla relazione ricorsiva:
$F_n = F_{n 1} + F_{n 2}$, where $F_1 = 1$ and $F_2 = 1$
It turns out that $F_{541}$, which contains 113 digits, is the first Fibonacci number for which the last nine digits are 1 - 9 pandigital (contain all the digits 1 to 9, but not necessarily in order). And $F_{2749}$, which contains 575 digits, is the first Fibonacci number for which the first nine digits are 1 - 9 pandigital.
Si scopre che $F_{541}$, il quale contiene 113 cifre, è il primo numero di Fibonacci per cui le utile dieci cifre sono pandigitali 1-9 (contiene tutte le cifre da 1 a 9, ma non necessariamente in ordine). E $F_{2749}$, lungo 578 cifre, è il primo numero di Fibonacci per cui le prime nove cifre sono 1-9 pandigitali.
Given that $F_k$ is the first Fibonacci number for which the first nine digits AND the last nine digits are 1 - 9 pandigital, find `k`.
Dato che $F_k$ è il primo numero di Fibonacci per cui le prime nove cifre E le ultime 9 cifre sono pandigitali 1-9, trova `k`.
# --hints--
`pandigitalFibonacciEnds()` should return `329468`.
`pandigitalFibonacciEnds()` dovrebbe restituire `329468`.
```js
assert.strictEqual(pandigitalFibonacciEnds(), 329468);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d61000cf542c50fee8
title: 'Problem 105: Special subset sums: testing'
title: 'Problema 105: somme di subset speciali: testing'
challengeType: 5
forumTopicId: 301729
dashedName: problem-105-special-subset-sums-testing
@ -8,20 +8,20 @@ dashedName: problem-105-special-subset-sums-testing
# --description--
Let $S(A)$ represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
Sia $S(A)$ la somma degli elementi in set A di dimensione n. Lo chiamiamo un set di somma speciale se per ogni due subset non vuoti e distinti, B e C, le seguenti proprietà sono vere:
1. $S(B) ≠ S(C)$; that is, sums of subsets cannot be equal.
2. If B contains more elements than C then $S(B) > S(C)$.
1. $S(B) ≠ S(C)$, cioè le somme dei subset non possono essere uguali.
2. Se B contiene più elementi di C allora $S(B) > S(C)$.
For example, {81, 88, 75, 42, 87, 84, 86, 65} is not a special sum set because 65 + 87 + 88 = 75 + 81 + 84, whereas {157, 150, 164, 119, 79, 159, 161, 139, 158} satisfies both rules for all possible subset pair combinations and $S(A) = 1286$.
Per esempio, {81, 88, 75, 42, 87, 84, 86, 65} non è un set a somma speciale perché 65 + 87 + 88 = 75 + 81 + 84, mentre 157, 150, 164, 119, 79, 159, 161, 139, 158} soddisfa entrambe le regole per tutte le possibili combinazioni di coppie di subset e $S(A) = 1286$.
Using `sets`, an array with one-hundred sets, containing seven to twelve elements (the two examples given above are the first two sets), identify all the special sum sets, $A_1, A_2, \ldots, A_k$, and find the value of $(A_1) + S(A_2) + \cdots + S(A_k)$.
Usando `sets`, un array con cento set che contengono tra 7 e 12 elementi (i due esempi dati sopra sono i primi due set), identifica tutti i set a somma speciale, $A_1, A_2, \ldots, A_k$,, e trova il valore di $(A_1) + S(A_2) + \cdots + S(A_k)$.
**Note:** This problem is related to Problem 103 and Problem 106.
**Nota:** questo problema è legato ai problemi 103 e 106.
# --hints--
`testingSpecialSubsetSums(testSets)` should return `73702`.
`testingSpecialSubsetSums(testSets)` dovrebbe restituire `73702`.
```js
assert.strictEqual(testingSpecialSubsetSums(_testSets), 73702);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d71000cf542c50fee9
title: 'Problem 106: Special subset sums: meta-testing'
title: 'Problema 106: somme di subset speciali: meta-testing'
challengeType: 5
forumTopicId: 301730
dashedName: problem-106-special-subset-sums-meta-testing
@ -8,22 +8,22 @@ dashedName: problem-106-special-subset-sums-meta-testing
# --description--
Let $S(A)$ represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
Sia $S(A)$ la somma degli elementi in un set A di dimensione n. Lo chiamiamo un set di somma speciale se per ogni due subset non vuoi e distinti, B e C, le seguenti proprietà sono vere:
1. $S(B) ≠ S(C)$; that is, sums of subsets cannot be equal.
2. If B contains more elements than C then $S(B) > S(C)$.
1. $S(B) ≠ S(C)$, cioè le somme dei subset non possono essere uguali.
2. Se B contiene più elementi di C allora $S(B) > S(C)$.
For this problem we shall assume that a given set contains n strictly increasing elements and it already satisfies the second rule.
Per questo problema supponiamo che un dato set contiene n elementi in ordine strettamente crescente, e soddisfa la seconda regola.
Surprisingly, out of the 25 possible subset pairs that can be obtained from a set for which n = 4, only 1 of these pairs need to be tested for equality (first rule). Similarly, when n = 7, only 70 out of the 966 subset pairs need to be tested.
Sorprendentemente, delle 25 possibili coppie di subset che possono essere ottenute da un set per cui n = 4, solo una di queste coppie deve essere testata per uguaglianza (prima regola). Similmente, quando n = 7, solo 70 delle 966 coppie di subset ha bisogno di essere testata.
For n = 12, how many of the 261625 subset pairs that can be obtained need to be tested for equality?
Per n = 12, quante delle 261625 coppie di subset che possono essere ottenute devono essere testate per uguaglianza?
**Note:** This problem is related to Problem 103 and Problem 105.
**Nota:** questo problema è legato ai problemi 103 e 105.
# --hints--
`subsetSumsMetaTesting()` should return `21384`.
`subsetSumsMetaTesting()` dovrebbe restituire `21384`.
```js
assert.strictEqual(subsetSumsMetaTesting(), 21384);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d91000cf542c50feea
title: 'Problem 107: Minimal network'
title: 'Problema 107: Rete minimale'
challengeType: 5
forumTopicId: 301731
dashedName: problem-107-minimal-network
@ -8,11 +8,11 @@ dashedName: problem-107-minimal-network
# --description--
The following undirected network consists of seven vertices and twelve edges with a total weight of 243.
La seguente rete non orientata è costituita da sette vertici e dodici archi con un peso totale di 243.
<img class="img-responsive center-block" alt="Network with seven vertices and twelve edges" src="https://cdn.freecodecamp.org/curriculum/project-euler/minimal-network-1.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Rete con sette vertici e dodici archi" src="https://cdn.freecodecamp.org/curriculum/project-euler/minimal-network-1.png" style="background-color: white; padding: 10px;" />
The same network can be represented by the matrix below.
La stessa rete può essere rappresentata dalla matrice sottostante.
| | A | B | C | D | E | F | G |
| - | -- | -- | -- | -- | -- | -- | -- |
@ -25,15 +25,15 @@ The same network can be represented by the matrix below.
| G | - | - | - | 23 | 11 | 27 | - |
However, it is possible to optimise the network by removing some edges and still ensure that all points on the network remain connected. The network which achieves the maximum saving is shown below. It has a weight of 93, representing a saving of 243 93 = 150 from the original network.
Tuttavia, è possibile ottimizzare la rete rimuovendo alcuni archi e garantire che tutti i punti della rete rimangano connessi. La rete che raggiunge il massimo risparmio è mostrata sotto. Ha un peso di 93, che rappresenta un risparmio di 243 93 = 150 rispetto alla rete originale.
<img class="img-responsive center-block" alt="Network wtih seven vertices and left six edges: AB, BD, CA, DE, DF, EG" src="https://cdn.freecodecamp.org/curriculum/project-euler/minimal-network-2.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Rete con sette vertici e sei archi rimanenti: AB, BD, CA, DE, DF, EG" src="https://cdn.freecodecamp.org/curriculum/project-euler/minimal-network-2.png" style="background-color: white; padding: 10px;" />
Using `network`, an 2D array representing network in matrix form, find the maximum saving which can be achieved by removing redundant edges whilst ensuring that the network remains connected. Vertices not having connection will be represented with `-1`.
Utilizzando `network`, un array 2D che rappresenta la rete in forma di matrice, trova il massimo risparmio che può essere ottenuto rimuovendo gli archi ridondanti, garantendo al contempo che la rete rimanga connessa. I vertici che non hanno connessione saranno rappresentati con `-1`.
# --hints--
`minimalNetwork(testNetwork)` should return `259679`.
`minimalNetwork(testNetwork)` dovrebbe restituire `259679`.
```js
assert.strictEqual(minimalNetwork(_testNetwork), 259679);

View File

@ -1,6 +1,6 @@
---
id: 5900f3d91000cf542c50feeb
title: 'Problem 108: Diophantine Reciprocals I'
title: 'Problema 108: reciproci diofantini I'
challengeType: 5
forumTopicId: 301732
dashedName: problem-108-diophantine-reciprocals-i
@ -8,19 +8,19 @@ dashedName: problem-108-diophantine-reciprocals-i
# --description--
In the following equation x, y, and n are positive integers.
Nella seguente equazione x, y, e n sono interi positivi.
$$\frac{1}{x} + \frac{1}{y} = \frac{1}{n}$$
For `n` = 4 there are exactly three distinct solutions:
Per `n` = 4 ci sono esattamente tre distinte soluzioni:
$$\begin{align} & \frac{1}{5} + \frac{1}{20} = \frac{1}{4}\\\\ \\\\ & \frac{1}{6} + \frac{1}{12} = \frac{1}{4}\\\\ \\\\ & \frac{1}{8} + \frac{1}{8} = \frac{1}{4} \end{align}$$
What is the least value of `n` for which the number of distinct solutions exceeds one-thousand?
Qual è il valore più piccolo di `n` per cui il numero di soluzioni distinte supera mille?
# --hints--
`diophantineOne()` should return `180180`.
`diophantineOne()` dovrebbe restituire `180180`.
```js
assert.strictEqual(diophantineOne(), 180180);

View File

@ -1,6 +1,6 @@
---
id: 5900f3db1000cf542c50feec
title: 'Problem 109: Darts'
title: 'Problema 109: Freccette'
challengeType: 5
forumTopicId: 301733
dashedName: problem-109-darts
@ -8,25 +8,25 @@ dashedName: problem-109-darts
# --description--
In the game of darts a player throws three darts at a target board which is split into twenty equal sized sections numbered one to twenty.
Nel gioco delle freccette un giocatore lancia tre freccette a un bersaglio che è diviso in venti sezioni di dimensioni uguali, numerate da uno a venti.
<img class="img-responsive center-block" alt="Darts board" src="https://cdn.freecodecamp.org/curriculum/project-euler/darts.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Bersaglio da freccette" src="https://cdn.freecodecamp.org/curriculum/project-euler/darts.png" style="background-color: white; padding: 10px;" />
The score of a dart is determined by the number of the region that the dart lands in. A dart landing outside the red/green outer ring scores zero. The black and cream regions inside this ring represent single scores. However, the red/green outer ring and middle ring score double and treble scores respectively.
Il punteggio di un lancio è determinato dal numero della regione dentro cui atterra il dardo. Un atterraggio fuori dall'anello rosso/verde esterno segna zero. Le regioni nere e color crema all'interno di questo anello rappresentano punteggi singoli. Tuttavia, gli anelli rosso/verde all'esterno e nel mezzo contano rispettivamente come punteggio doppio e triplo.
At the center of the board are two concentric circles called the bull region, or bulls-eye. The outer bull is worth 25 points and the inner bull is a double, worth 50 points.
Al centro del tabellone ci sono due cerchi concentrici. Il cerchio esterno vale 25 punti e il cerchio interno è un doppio che vale 50 punti.
There are many variations of rules but in the most popular game the players will begin with a score of 301 or 501 and the first player to reduce their running total to zero is a winner. However, it is normal to play a "doubles out" system, which means that the player must land a double (including the double bulls-eye at the center of the board) on their final dart to win; any other dart that would reduce their running total to one or lower means the score for that set of three darts is "bust".
Ci sono molte variazioni di regole ma nel gioco più popolare i giocatori iniziano con un punteggio di 301 o 501 e il primo giocatore che riduce il suo punteggio a zero vince. Comunque, è normale giocare un sistema a "finale doppio", che significa che il giocatore deve colpite un doppio (incluso il doppio al centro del tabellone) con la sua freccetta finale per vincere; qualsiasi altra freccetta che ridurrebbe il punteggio a 1 o inferione significa che il set di tre dardi è "sprecato".
When a player is able to finish on their current score it is called a "checkout" and the highest checkout is 170: T20 T20 D25 (two treble 20s and double bull). There are exactly eleven distinct ways to checkout on a score of 6:
Quando un giocare è in grado di finire sul proprio punteggio viene chiamato un "checkout" e il checkout più alto è 170: T20 T20 D25 (due tripli 20 e un doppio centro). Ci sono esattamente 11 modi distinti per fare checkout con un punteggio di 6:
$$\begin{array} \text{D3} & & \\\\ D1 & D2 & \\\\ S2 & D2 & \\\\ D2 & D1 & \\\\ S4 & D1 & \\\\ S1 & S1 & D2 \\\\ S1 & T1 & D1 \\\\ S1 & S3 & D1 \\\\ D1 & D1 & D1 \\\\ D1 & S2 & D1 \\\\ S2 & S2 & D1 \end{array}$$
Note that D1 D2 is considered different from D2 D1 as they finish on different doubles. However, the combination S1 T1 D1 is considered the same as T1 S1 D1. In addition, we shall not include misses in considering combinations; for example, D3 is the same as 0 D3 and 0 0 D3. Incredibly there are 42336 distinct ways of checking out in total. How many distinct ways can a player checkout with a score less than 100?
Nota che D1 D2 è considerato diverso da D2 D1 visto che finiscono su doppi diversi. Invece, la combinazione S1 T1 D1 è considerata la stessa di T1 S1 D1. In aggiunta, non includiamo lanci mancati considerando le combinazioni; per esempio, D3 è la stessa cosa di 0 D3 e 0 0 D3. Incredibilmente ci sono 42336 modi diversi per fare checkout in totale. Quanti modi distinti ci sono per un giocatore di fare checkout con un punteggio inferiore a 100?
# --hints--
`darts()` should return `38182`.
`darts()` dovrebbe restituire `38182`.
```js
assert.strictEqual(darts(), 38182);

View File

@ -1,6 +1,6 @@
---
id: 5900f3db1000cf542c50feed
title: 'Problem 110: Diophantine Reciprocals II'
title: 'Problema 110: Reciproci diofantini II'
challengeType: 5
forumTopicId: 301735
dashedName: problem-110-diophantine-reciprocals-ii
@ -8,19 +8,19 @@ dashedName: problem-110-diophantine-reciprocals-ii
# --description--
In the following equation x, y, and n are positive integers.
Nella seguente equazione x, y, e n sono interi positivi.
$$\frac{1}{x} + \frac{1}{y} = \frac{1}{n}$$
It can be verified that when `n` = 1260 there are 113 distinct solutions and this is the least value of `n` for which the total number of distinct solutions exceeds one hundred.
Si può verificare che quando `n` = 1260 ci sono 113 soluzioni distinte e questo è il valore minimo di `n` per il quale il numero totale di soluzioni distinte supera cento.
What is the least value of `n` for which the number of distinct solutions exceeds four million?
Qual è il valore minimo di `n` per il quale il numero di soluzioni distinte supera i quattro milioni?
**Note:** This problem is a much more difficult version of Problem 108 and as it is well beyond the limitations of a brute force approach it requires a clever implementation.
**Nota:** Questo problema è una versione molto più difficile del Problema 108 e poiché è ben al di là dei limiti di un approccio a forza bruta richiede un'implementazione intelligente.
# --hints--
`diophantineTwo()` should return `9350130049860600`.
`diophantineTwo()` dovrebbe restituire `9350130049860600`.
```js
assert.strictEqual(diophantineTwo(), 9350130049860600);

View File

@ -1,6 +1,6 @@
---
id: 5900f3db1000cf542c50feee
title: 'Problem 111: Primes with runs'
title: 'Problema 111: Primi con cifre ripetute'
challengeType: 5
forumTopicId: 301736
dashedName: problem-111-primes-with-runs
@ -8,15 +8,15 @@ dashedName: problem-111-primes-with-runs
# --description--
Considering 4-digit primes containing repeated digits it is clear that they cannot all be the same: 1111 is divisible by 11, 2222 is divisible by 22, and so on. But there are nine 4-digit primes containing three ones:
Considerando i numeri primi a 4 cifre contenenti cifre ripetute è chiaro che non possono essere tutte uguali: 1111 è divisibile per 11, 2222 è divisibile per 22, e così via. Ma ci sono nove primi a 4 cifre contenenti tre uno:
$$1117, 1151, 1171, 1181, 1511, 1811, 2111, 4111, 8111$$
We shall say that $M(n, d)$ represents the maximum number of repeated digits for an n-digit prime where d is the repeated digit, $N(n, d)$ represents the number of such primes, and $S(n, d)$ represents the sum of these primes.
Diciamo che $M(n, d)$ rappresenta il numero massimo di cifre ripetute per un primo di n cifre in cui d è la cifra ripetuta, $N(n, d)$ rappresenta il numero di tali primi, e $S(n, d)$ rappresenta la somma di essi.
So $M(4, 1) = 3$ is the maximum number of repeated digits for a 4-digit prime where one is the repeated digit, there are $N(4, 1) = 9$ such primes, and the sum of these primes is $S(4, 1) = 22275$. It turns out that for d = 0, it is only possible to have $M(4, 0) = 2$ repeated digits, but there are $N(4, 0) = 13$ such cases.
Quindi $M(4, 1) = 3$ è il numero massimo di cifre ripetute per un primo a 4 cifre dove la cifra ripetuta è uno, ci sono $N(4, 1) = 9$ di questi primi, e la somma di essi è $S(4, 1) = 22275$. Si scopre che per d = 0, è possibile avere solo $M(4, 0) = 2$ cifre ripetute, ma ci sono $N(4, 0) = 13$ casi simili.
In the same way we obtain the following results for 4-digit primes.
Allo stesso modo otteniamo i seguenti risultati per i primi a 4 cifre.
| Digit, d | $M(4, d)$ | $N(4, d)$ | $S(4, d)$ |
| -------- | --------- | --------- | --------- |
@ -31,11 +31,11 @@ In the same way we obtain the following results for 4-digit primes.
| 8 | 3 | 1 | 8887 |
| 9 | 3 | 7 | 48073 |
For d = 0 to 9, the sum of all $S(4, d)$ is 273700. Find the sum of all $S(10, d)$.
Per d = 0 a 9, la somma di tutti gli $S(4, d)$ è di 273700. Trova la somma di tutti gli $S(10, d)$.
# --hints--
`primesWithRuns()` should return `612407567715`.
`primesWithRuns()` dovrebbe restituire `612407567715`.
```js
assert.strictEqual(primesWithRuns(), 612407567715);

View File

@ -1,6 +1,6 @@
---
id: 5900f3dd1000cf542c50feef
title: 'Problem 112: Bouncy numbers'
title: 'Problema 112: Numeri rimbalzanti'
challengeType: 5
forumTopicId: 301738
dashedName: problem-112-bouncy-numbers
@ -8,21 +8,21 @@ dashedName: problem-112-bouncy-numbers
# --description--
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Lavorando da sinistra a destra se nessuna cifra viene superata dalla cifra alla sua sinistra, viene chiamato un numero crescente; ad esempio, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
Allo stesso modo, se ogni cifra non viene superata dalla cifra alla sua destra si chiama numero decrescente; per esempio, 66420.
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
Chiameremo un numero intero positivo che non sia né crescente né decrescente un numero rimbalzante; per esempio, 155349.
Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand (525) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches 50% is 538.
Chiaramente non ci possono essere numeri rimbalzanti sotto il cento, ma poco più della metà dei numeri sotto il mille (525) sono rimbalzanti. Infatti, il numero minimo per il quale la proporzione di numeri rimbalzanti raggiunge il 50% è 538.
Surprisingly, bouncy numbers become more and more common and by the time we reach 21780 the proportion of bouncy numbers is equal to 90%.
Sorprendentemente, i numeri rimbalzanti diventano sempre più comuni e dal momento in cui raggiungiamo 21780 la proporzione di numeri rimbalzanti è pari al 90%.
Find the least number for which the proportion of bouncy numbers is exactly 99%.
Trova il numero più basso per il quale la proporzione di numeri rimbalzanti è esattamente 99%.
# --hints--
`bouncyNumbers()` should return `1587000`.
`bouncyNumbers()` dovrebbe restituire `1587000`.
```js
assert.strictEqual(bouncyNumbers(), 1587000);

View File

@ -1,6 +1,6 @@
---
id: 5900f3dd1000cf542c50fef0
title: 'Problem 113: Non-bouncy numbers'
title: 'Problema 113: Numeri non rimbalzanti'
challengeType: 5
forumTopicId: 301739
dashedName: problem-113-non-bouncy-numbers
@ -8,19 +8,19 @@ dashedName: problem-113-non-bouncy-numbers
# --description--
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Lavorando da sinistra a destra se nessuna cifra viene superata dalla cifra alla sua sinistra, viene chiamato un numero crescente; ad esempio, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
Allo stesso modo, se ogni cifra non viene superata dalla cifra alla sua destra si chiama numero decrescente; per esempio, 66420.
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
Chiameremo un numero intero positivo che non sia né crescente né decrescente un numero rimbalzante; per esempio, 155349.
As n increases, the proportion of bouncy numbers below n increases such that there are only 12951 numbers below one-million that are not bouncy and only 277032 non-bouncy numbers below ${10}^{10}$.
All'aumentare di n, la proporzione di numeri rimbalzanti sotto n aumenta in modo che ci sono solo 12951 numeri sotto un milione che non sono rimbalzanti e solo 277032 numeri non rimbalzanti sotto ${10}^{10}$.
How many numbers below a googol (${10}^{100}$) are not bouncy?
Quanti numeri sotto un googol (${10}^{100}$) non sono rimbalzanti?
# --hints--
`nonBouncyNumbers()` should return `51161058134250`.
`nonBouncyNumbers()` dovrebbe restituire `51161058134250`.
```js
assert.strictEqual(nonBouncyNumbers(), 51161058134250);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e01000cf542c50fef2
title: 'Problem 114: Counting block combinations I'
title: 'Problema 114: Conteggio delle combinazioni di blocchi I'
challengeType: 5
forumTopicId: 301740
dashedName: problem-114-counting-block-combinations-i
@ -8,17 +8,17 @@ dashedName: problem-114-counting-block-combinations-i
# --description--
A row measuring seven units in length has red blocks with a minimum length of three units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. There are exactly seventeen ways of doing this.
Una fila di sette unità di lunghezza presenta blocchi rossi con una lunghezza minima di tre unità poste su di essa, in modo che due blocchi rossi (che possono avere lunghezze diverse) siano separati da almeno un quadrato nero. Ci sono esattamente diciassette modi per farlo.
<img class="img-responsive center-block" alt="Possible ways of placing block with a minimum length of three units, on a row with length of seven units" src="https://cdn.freecodecamp.org/curriculum/project-euler/counting-block-combinations-i.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Possibili modi di posizionare un blocco con una lunghezza minima di tre unità, su una fila con lunghezza di sette unità" src="https://cdn.freecodecamp.org/curriculum/project-euler/counting-block-combinations-i.png" style="background-color: white; padding: 10px;" />
How many ways can a row measuring fifty units in length be filled?
In quanti modi può essere riempita una fila di cinquanta unità di lunghezza?
**Note:** Although the example above does not lend itself to the possibility, in general it is permitted to mix block sizes. For example, on a row measuring eight units in length you could use red (3), black (1), and red (4).
**Nota:** Anche se l'esempio di cui sopra non si presta alla possibilità, in generale è consentito mescolare le dimensioni dei blocchi. Ad esempio, su una fila che misura otto unità di lunghezza è possibile utilizzare rosso (3), nero (1), e rosso (4).
# --hints--
`countingBlockOne()` should return `16475640049`.
`countingBlockOne()` dovrebbe restituire `16475640049`.
```js
assert.strictEqual(countingBlockOne(), 16475640049);

View File

@ -1,6 +1,6 @@
---
id: 5900f3df1000cf542c50fef1
title: 'Problem 115: Counting block combinations II'
title: 'Problema 115: Conteggio delle combinazioni di blocchi II'
challengeType: 5
forumTopicId: 301741
dashedName: problem-115-counting-block-combinations-ii
@ -8,23 +8,23 @@ dashedName: problem-115-counting-block-combinations-ii
# --description--
A row measuring `n` units in length has red blocks with a minimum length of `m` units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square.
Una fila di `n` unità di lunghezza presenta blocchi rossi con una lunghezza minima di `m` unità poste su di essa, in modo che due blocchi rossi (che possono essere lunghezze diverse) siano separati da almeno un quadrato nero.
Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled.
Lascia che la funzione di conteggio del riempimento, $F(m, n)$, rappresenti il numero di modi in cui una riga può essere riempita.
For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$.
Per esempio, $F(3, 29) = 673135$ e $F(3, 30) = 1089155$.
That is, for m = 3, it can be seen that n = 30 is the smallest value for which the fill-count function first exceeds one million.
Cioè, per m = 3, si può osservare che n = 30 è il valore più piccolo per il quale la funzione di riempimento supera per la prima volta un milione.
In the same way, for m = 10, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so n = 57 is the least value for which the fill-count function first exceeds one million.
Allo stesso modo, per m = 10, si può verificare che $F(10, 56) = 880711$ e $F(10, 57) = 1148904$, quindi n = 57 è il valore minimo per il quale la funzione di riempimento supera per la prima volta un milione.
For m = 50, find the least value of `n` for which the fill-count function first exceeds one million.
Per m = 50, trovare il valore minimo di `n` per il quale la funzione di riempimento è superiore a un milione.
**Note:** This is a more difficult version of Problem 114.
**Nota:** Questa è una versione più difficile del Problema 114.
# --hints--
`countingBlockTwo()` should return `168`.
`countingBlockTwo()` dovrebbe restituire `168`.
```js
assert.strictEqual(countingBlockTwo(), 168);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e01000cf542c50fef3
title: 'Problem 116: Red, green or blue tiles'
title: 'Problema 116: Piastrelle rosse, verdi o blu'
challengeType: 5
forumTopicId: 301742
dashedName: problem-116-red-green-or-blue-tiles
@ -8,27 +8,27 @@ dashedName: problem-116-red-green-or-blue-tiles
# --description--
A row of five black square tiles is to have a number of its tiles replaced with coloured oblong tiles chosen from red (length two), green (length three), or blue (length four).
Una fila di cinque piastrelle quadrate nere deve avere un certo numero di piastrelle sostituite con piastrelle oblunghe colorate scelte tra rosso (lunghezza due), verde (lunghezza tre), o blu (lunghezza quattro).
If red tiles are chosen there are exactly seven ways this can be done.
Se si scelgono piastrelle rosse ci sono esattamente sette modi di farlo.
<img class="img-responsive center-block" alt="Possible ways to placing red oblong on a row with length of five units" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-1.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Possibili modi di posizionare piastrelle oblunghe rosse su una fila con lunghezza di cinque unità" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-1.png" style="background-color: white; padding: 10px;" />
If green tiles are chosen there are three ways.
Se si scelgono piastrelle verdi ci sono tre modi.
<img class="img-responsive center-block" alt="Possible ways of placing green oblong on a row with length of five units" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-2.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Possibili modi di posizionare piastrelle oblunghe verdi su una fila con lunghezza di cinque unità" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-2.png" style="background-color: white; padding: 10px;" />
And if blue tiles are chosen there are two ways.
E se si scelgono piastrelle blu ci sono due modi.
<img class="img-responsive center-block" alt="Possible ways of placing blue oblong on a row with length of five units" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-3.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Possibili modi di posizionare piastrelle oblunghe blu su una fila con lunghezza di cinque unità" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-3.png" style="background-color: white; padding: 10px;" />
Assuming that colors cannot be mixed there are 7 + 3 + 2 = 12 ways of replacing the black tiles in a row measuring five units in length. How many different ways can the black tiles in a row measuring fifty units in length be replaced if colors cannot be mixed and at least one colored tile must be used?
Supponendo che i colori non possano essere mescolati ci sono 7 + 3 + 2 = 12 modi per sostituire le piastrelle nere in una riga che misura cinque unità di lunghezza. In quanti modi diversi si possono sostituire le piastrelle nere in una fila di cinquanta unità di lunghezza se i colori non possono essere mescolati e si deve usare almeno una piastrella colorata?
**Note:** This is related to Problem 117.
**Nota:** Questo è correlato al problema 117.
# --hints--
`redGreenBlueOne()` should return `20492570929`.
`redGreenBlueOne()` dovrebbe restituire `20492570929`.
```js
assert.strictEqual(redGreenBlueOne(), 20492570929);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e21000cf542c50fef4
title: 'Problem 117: Red, green, and blue tiles'
title: 'Problema 117: Piastrelle rosse, verdi e blu'
challengeType: 5
forumTopicId: 301743
dashedName: problem-117-red-green-and-blue-tiles
@ -8,17 +8,17 @@ dashedName: problem-117-red-green-and-blue-tiles
# --description--
Using a combination of black square tiles and oblong tiles chosen from: red tiles measuring two units, green tiles measuring three units, and blue tiles measuring four units, it is possible to tile a row measuring five units in length in exactly fifteen different ways.
Utilizzando una combinazione di piastrelle quadrate nere e piastrelle oblunghe scelte tra: piastrelle rosse che misurano due unità, piastrelle verdi che misurano tre unità, e piastrelle blu che misurano quattro unità, è possibile piastrellare una fila che misura cinque unità di lunghezza in esattamente quindici modi diversi.
<img class="img-responsive center-block" alt="Possible ways of placing red, green and blue oblongs on a row with length of five units" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-and-blue-tiles.png" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="Possibili modi di posizionare piastrelle oblunghe rosse, verdi e blu su una fila con lunghezza di cinque unità" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-and-blue-tiles.png" style="background-color: white; padding: 10px;" />
How many ways can a row measuring fifty units in length be tiled?
In quanti modi può essere riempita una fila di cinquanta unità di lunghezza?
**Note**: This is related to Problem 116.
**Nota:** Questo è correlato al problema 116.
# --hints--
`redGreenBlueTilesTwo()` should return `100808458960497`.
`redGreenBlueTilesTwo()` dovrebbe restituire `100808458960497`.
```js
assert.strictEqual(redGreenBlueTilesTwo(), 100808458960497);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e21000cf542c50fef5
title: 'Problem 118: Pandigital prime sets'
title: 'Problema 118: set di numeri primi pandigitali'
challengeType: 5
forumTopicId: 301744
dashedName: problem-118-pandigital-prime-sets
@ -8,13 +8,13 @@ dashedName: problem-118-pandigital-prime-sets
# --description--
Using all of the digits 1 through 9 and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set $\\{2, 5, 47, 89, 631\\}$, all of the elements belonging to it are prime.
Usando tutte le cifre da 1 a 9 e concatenandole liberamente per formare numeri interi decimali, possono essere formati diversi insiemi. È interessante notare che nel set $\\{2, 5, 47, 89, 631\\}$, tutti gli elementi che vi appartengono sono primi.
How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?
Quanti insiemi distinti che contengono ciascuna delle cifre da una a nove esattamente una volta contengono solo elementi primi?
# --hints--
`pandigitalPrimeSets()` should return `44680`.
`pandigitalPrimeSets()` dovrebbe restituire `44680`.
```js
assert.strictEqual(pandigitalPrimeSets(), 44680);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e41000cf542c50fef6
title: 'Problem 119: Digit power sum'
title: 'Problema 119: Somma delle potenze delle cifre'
challengeType: 5
forumTopicId: 301745
dashedName: problem-119-digit-power-sum
@ -8,17 +8,17 @@ dashedName: problem-119-digit-power-sum
# --description--
The number 512 is interesting because it is equal to the sum of its digits raised to some power: $5 + 1 + 2 = 8$, and $8^3 = 512$. Another example of a number with this property is $614656 = 28^4$.
Il numero 512 è interessante perché è uguale alla somma delle sue cifre elevata ad un certa potenza: $5 + 1 + 2 = 8$, e $8^3 = 512$. Un altro esempio di numero con questa proprietà è $614656 = 28^4$.
We shall define an to be the $n-th$ term of this sequence and insist that a number must contain at least two digits to have a sum.
Definiremo $a_n$ per essere il termine ennesimo $n-th$ di questa sequenza e insisteremo affinché un numero contenga almeno due cifre per avere una somma.
You are given that $a_2 = 512$ and $a_{10} = 614656$.
Ti viene dato $a_2 = 512$ e $a_{10} = 614656$.
Find $a_{30}$.
Trova $a_{30}$.
# --hints--
`digitPowerSum()` should return `248155780267521`.
`digitPowerSum()` dovrebbe restituire `248155780267521`.
```js
assert.strictEqual(digitPowerSum(), 248155780267521);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e41000cf542c50fef7
title: 'Problem 120: Square remainders'
title: 'Problema 120: Resti di quadrati'
challengeType: 5
forumTopicId: 301747
dashedName: problem-120-square-remainders
@ -8,15 +8,15 @@ dashedName: problem-120-square-remainders
# --description--
Let `r` be the remainder when ${(a 1)}^n + {(a + 1)}^n$ is divided by $a^2$.
Sia `r` il resto quando ${(a 1)}^n + {(a + 1)}^n$ viene diviso per $a^2$.
For example, if $a = 7$ and $n = 3$, then $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$. And as `n` varies, so too will `r`, but for $a = 7$ it turns out that $r_{max} = 42$.
Per esempio, se $a = 7$ e $n = 3$, allora $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$. E se `n` varia, allora anche `r` varia, ma per $a = 7$ risulta che $r_{max} = 42$.
For $3 ≤ a ≤ 1000$, find $\sum{r}_{max}$.
Per $3 ≤ a ≤ 1000$, trova $\sum{r}_{max}$.
# --hints--
`squareRemainders()` should return `333082500`.
`squareRemainders()` dovrebbe restituire `333082500`.
```js
assert.strictEqual(squareRemainders(), 333082500);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e51000cf542c50fef8
title: 'Problem 121: Disc game prize fund'
title: 'Problema 121: fondo premio per il gioco del disco'
challengeType: 5
forumTopicId: 301748
dashedName: problem-121-disc-game-prize-fund
@ -8,20 +8,20 @@ dashedName: problem-121-disc-game-prize-fund
# --description--
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.
Una sacca contiene un disco rosso e un disco blu. In una partita casuale un giocatore prende un disco a caso e il suo colore viene annotato. Dopo ogni giro il disco viene rimesso nel sacchetto, viene aggiunto un disco rosso in più e un altro disco viene prelevato a caso.
The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game.
Il giocatore paga 1£ per giocare e vince se ha preso più dischi blu rispetto ai dischi rossi alla fine del gioco.
If the game is played for four turns, the probability of a player winning is exactly 11/120, and so the maximum prize fund the banker should allocate for winning in this game would be £10 before they would expect to incur a loss. Note that any payout will be a whole number of pounds and also includes the original £1 paid to play the game, so in the example given the player actually wins £9.
Se il gioco è giocato per quattro turni, la probabilità di una vittoria di un giocatore è esattamente 11/120, e quindi il fondo premio massimo che il banchiere dovrebbe assegnare per vincere in questo gioco sarebbe 10£ prima che si aspettasse d'incorrere in una perdita. Nota che qualsiasi pagamento sarà un numero intero di sterline e comprende anche l'originale 1£ pagato per giocare il gioco, così nell'esempio dato il giocatore vince effettivamente 9£.
Find the maximum prize fund that should be allocated to a single game in which fifteen turns are played.
Trova il fondo premio massimo che dovrebbe essere assegnato a una singola partita in cui sono giocati quindici turni.
# --hints--
`euler121()` should return 2269.
`discGamePrize()` dovrebbe restituire `2269`.
```js
assert.strictEqual(euler121(), 2269);
assert.strictEqual(discGamePrize(), 2269);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler121(), 2269);
## --seed-contents--
```js
function euler121() {
function discGamePrize() {
return true;
}
euler121();
discGamePrize();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3e61000cf542c50fef9
title: 'Problem 122: Efficient exponentiation'
title: 'Problema 122: Esponenziazione efficiente'
challengeType: 5
forumTopicId: 301749
dashedName: problem-122-efficient-exponentiation
@ -8,28 +8,28 @@ dashedName: problem-122-efficient-exponentiation
# --description--
The most naive way of computing n15 requires fourteen multiplications:
Il modo più ingenuo di calcolare $n^{15}$ richiede quattordici moltiplicazioni:
n × n × ... × n = n15
$$n × n × \ldots × n = n^{15}$$
But using a "binary" method you can compute it in six multiplications:
Ma usando un metodo "binario" è possibile calcolarlo in sei moltiplicazioni:
n × n = n2n2 × n2 = n4n4 × n4 = n8n8 × n4 = n12n12 × n2 = n14n14 × n = n15
$$$\start{align} & n × n = n^2\\\\ & n^2 × n^2 = n^4\\\\ & n^4 × n^4 = n^8\\\\ & n^8 × n^4 = n^{12}\\\\ & n^{12} × n^2 = n^{14}\\\\ & n^{14} × n = n^{15} \end{align}$$
However it is yet possible to compute it in only five multiplications:
Tuttavia è ancora possibile calcolarlo in sole cinque moltiplicazioni:
n × n = n2n2 × n = n3n3 × n3 = n6n6 × n6 = n12n12 × n3 = n15
$$\begin{align} & n × n = n^2\\\\ & n^2 × n = n^3\\\\ & n^3 × n^3 = n^6\\\\ & n^6 × n^6 = n^{12}\\\\ & n^{12} × n^3 = n^{15} \end{align}$$
We shall define m(k) to be the minimum number of multiplications to compute nk; for example m(15) = 5.
Definiremo $m(k)$ in modo che sia il numero minimo di moltiplicazioni per calcolare $n^k$; per esempio $m(15) = 5$.
For 1 ≤ k ≤ 200, find ∑ m(k).
Per $1 ≤ k ≤ 200$, trova $\sum{m(k)}$.
# --hints--
`euler122()` should return 1582.
`efficientExponentation()` dovrebbe restituire `1582`.
```js
assert.strictEqual(euler122(), 1582);
assert.strictEqual(efficientExponentation(), 1582);
```
# --seed--
@ -37,12 +37,12 @@ assert.strictEqual(euler122(), 1582);
## --seed-contents--
```js
function euler122() {
function efficientExponentation() {
return true;
}
euler122();
efficientExponentation();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3e71000cf542c50fefa
title: 'Problem 123: Prime square remainders'
title: 'Problema 123: Resti di quadrati primi'
challengeType: 5
forumTopicId: 301750
dashedName: problem-123-prime-square-remainders
@ -8,20 +8,20 @@ dashedName: problem-123-prime-square-remainders
# --description--
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn1)n + (pn+1)n is divided by pn2.
Sia $p_n$ l'$n$° primo: 2, 3, 5, 7, 11, ... e sia $r$ il resto quando ${(p_n1)}^n + {(p_n+1)}^n$ è diviso per ${p_n}^2$.
For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
Per esempio, quando $n = 3, p_3 = 5$, e $4^3 + 6^3 = 280 ≡ 5\\ mod\\ 25$.
The least value of n for which the remainder first exceeds 109 is 7037.
Il valore minimo di $n$ per il quale il resto supera per primo $10^9$ è 7037.
Find the least value of n for which the remainder first exceeds 1010.
Trova il valore minimo di $n$ per il quale il resto supera per primo $10 ^{10}$.
# --hints--
`euler123()` should return 21035.
`primeSquareRemainders()` dovrebbe restituire `21035`.
```js
assert.strictEqual(euler123(), 21035);
assert.strictEqual(primeSquareRemainders(), 21035);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler123(), 21035);
## --seed-contents--
```js
function euler123() {
function primeSquareRemainders() {
return true;
}
euler123();
primeSquareRemainders();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3e81000cf542c50fefb
title: 'Problem 124: Ordered radicals'
title: 'Problema 124: radicali ordinati'
challengeType: 5
forumTopicId: 301751
dashedName: problem-124-ordered-radicals
@ -8,42 +8,118 @@ dashedName: problem-124-ordered-radicals
# --description--
The radical of n, rad(n), is the product of the distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
Il radicale di $n$, $rad(n)$, è il prodotto dei fattori distinti primi di $n$. Per esempio, $504 = 2^3 ×3^2 × 7$, quindi $rad(504) = 2 × 3 × 7 = 42$.
If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on rad(n), and sorting on n if the radical values are equal, we get:
Se calcoliamo $rad(n)$ for $1 ≤ n ≤ 10$,, quindi ordiniamo su $rad(n)$, e ordiniamo su $n$ se i valori dei radicali sono uguali, otteniamo:
Unsorted
<div style="text-align: center;">
<table cellpadding="2" cellspacing="0" border="0" align="center">
<tbody>
<tr>
<td colspan="2">$non in ordine$</td>
<td></td>
<td colspan="3">$ordinato$</td>
</tr>
<tr>
<td>$n$</td>
<td>$rad(n)$</td>
<td></td>
<td>$n$</td>
<td>$rad(n)$</td>
<td>$k$</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td></td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td></td>
<td>2</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>3</td>
<td></td>
<td>4</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>2</td>
<td></td>
<td>8</td>
<td>2</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>5</td>
<td></td>
<td>3</td>
<td>3</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>6</td>
<td></td>
<td>9</td>
<td>3</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>7</td>
<td></td>
<td>5</td>
<td>5</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>2</td>
<td></td>
<td>6</td>
<td>6</td>
<td>8</td>
</tr>
<tr>
<td>9</td>
<td>3</td>
<td></td>
<td>7</td>
<td>7</td>
<td>9</td>
</tr>
<tr>
<td>10</td>
<td>10</td>
<td></td>
<td>10</td>
<td>10</td>
<td>10</td>
</tr>
</tbody>
</table>
</div><br>
Sorted n rad(n)
n rad(n) k 11
111 22
222 33
423 42
824 55
335 66
936 77
557 82
668 93
779 1010
101010 Let E(k) be the kth element in the sorted n column; for example, E(4) = 8 and E(6) = 9. If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000).
Sia $E(k)$ l'elemento $k$-simo nella colonna $n$ ordinata; per esempio, $E(4) = 8$ e $E(6) = 9$. Se $rad(n)$ è ordinato per $1 ≤ n ≤ 100000$, trova $E(10000)$.
# --hints--
`euler124()` should return 21417.
`orderedRadicals()` dovrebbe restituire `21417`.
```js
assert.strictEqual(euler124(), 21417);
assert.strictEqual(orderedRadicals(), 21417);
```
# --seed--
@ -51,12 +127,12 @@ assert.strictEqual(euler124(), 21417);
## --seed-contents--
```js
function euler124() {
function orderedRadicals() {
return true;
}
euler124();
orderedRadicals();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3e91000cf542c50fefc
title: 'Problem 125: Palindromic sums'
title: 'Problema 125: somme palindrome'
challengeType: 5
forumTopicId: 301752
dashedName: problem-125-palindromic-sums
@ -8,18 +8,18 @@ dashedName: problem-125-palindromic-sums
# --description--
The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 62 + 72 + 82 + 92 + 102 + 112 + 122.
Il numero palindromo 595 è interessante perché può essere scritto come la somma dei quadrati consecutivi: $6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2$.
There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that 1 = 02 + 12 has not been included as this problem is concerned with the squares of positive integers.
Ci sono esattamente undici palindromi sotto il mille che possono essere scritti come somma di quadrati consecutivi, e la somma di questi palindromi è 4164. Nota che $1 = 0^2 + 1^2$ non è stato incluso in quanto questo problema riguarda i quadrati degli interi positivi.
Find the sum of all the numbers less than 108 that are both palindromic and can be written as the sum of consecutive squares.
Trova la somma di tutti i numeri inferiori a $10^8$ che sono entrambi palindromi e possono essere scritti come la somma di quadrati consecutivi.
# --hints--
`euler125()` should return 2906969179.
`palindromicSums()` dovrebbe restituire `2906969179`.
```js
assert.strictEqual(euler125(), 2906969179);
assert.strictEqual(palindromicSums(), 2906969179);
```
# --seed--
@ -27,12 +27,12 @@ assert.strictEqual(euler125(), 2906969179);
## --seed-contents--
```js
function euler125() {
function palindromicSums() {
return true;
}
euler125();
palindromicSums();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ea1000cf542c50fefd
title: 'Problem 126: Cuboid layers'
title: 'Problema 126: strati cuboidi'
challengeType: 5
forumTopicId: 301753
dashedName: problem-126-cuboid-layers
@ -8,16 +8,26 @@ dashedName: problem-126-cuboid-layers
# --description--
The minimum number of cubes to cover every visible face on a cuboid measuring 3 x 2 x 1 is twenty-two.
Il numero minimo di cubi per coprire ogni faccia visibile su un cuboide che misura 3 x 2 x 1 è ventidue.
If we then add a second layer to this solid it would require forty-six cubes to cover every visible face, the third layer would require seventy-eight cubes, and the fourth layer would require one-hundred and eighteen cubes to cover every visible face. However, the first layer on a cuboid measuring 5 x 1 x 1 also requires twenty-two cubes; similarly the first layer on cuboids measuring 5 x 3 x 1, 7 x 2 x 1, and 11 x 1 x 1 all contain forty-six cubes. We shall define C(n) to represent the number of cuboids that contain n cubes in one of its layers. So C(22) = 2, C(46) = 4, C(78) = 5, and C(118) = 8. It turns out that 154 is the least value of n for which C(n) = 10. Find the least value of n for which C(n) = 1000.
<img class="img-responsive center-block" alt="Un cuboide 3x2x1 ricoperto con ventidue cubi 1x1x1" src="https://cdn.freecodecamp.org/curriculum/project-euler/cuboid-layers.png" style="background-color: white; padding: 10px;" />
Se aggiungiamo un secondo strato a questo solido richiederebbe quarantasei cubi per coprire ogni faccia visibile, il terzo strato richiederebbe settantotto cubi, e il quarto strato richiederedde centodiciotto cubi per coprire ogni faccia visibile.
Eppure, il primo strato di un cuboide misurante 5 x 1 x 1 richiede pure ventidue cubi; in modo simile, il primo strato di cuboidi misuranti 5 x 3 x 1, 7 x 2 x 1, e 11 x 1 x 1 tutti contengono quarantasei cubi.
Definiamo $C(n)$ per rappresentare il numero di cuboidi che contengono $n$ cubi in uno dei suoi strati. Quindi $C(22) = 2$, $C(46) = 4$, $C(78) = 5$, e $C(118) = 8$.
Si scopre che 154 è il valore più basso di $n$ per cui $C(n) = 10$.
Trova il valore più piccolo di $n$ per cui $C(n) = 1000$.
# --hints--
`euler126()` should return 18522.
`cuboidLayers()` dovrebbe restituire `18522`.
```js
assert.strictEqual(euler126(), 18522);
assert.strictEqual(cuboidLayers(), 18522);
```
# --seed--
@ -25,12 +35,12 @@ assert.strictEqual(euler126(), 18522);
## --seed-contents--
```js
function euler126() {
function cuboidLayers() {
return true;
}
euler126();
cuboidLayers();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ec1000cf542c50fefe
title: 'Problem 127: abc-hits'
title: 'Problema 127: abc-hit'
challengeType: 5
forumTopicId: 301754
dashedName: problem-127-abc-hits
@ -8,38 +8,32 @@ dashedName: problem-127-abc-hits
# --description--
The radical of n, rad(n), is the product of distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
Il radicale di $n$, $rad(n)$, è il prodotto dei fattori primi distinti di $n$. Per esempio, $504 = 2^3 × 3^2 × 7$, quindi $rad(504) = 2 × 3 × 7 = 42$.
We shall define the triplet of positive integers (a, b, c) to be an abc-hit if:
Definiamo la tripletta di numeri interi positivi (a, b, c) come un abc-hit se:
GCD(a, b) = GCD(a, c) = GCD(b, c) = 1
1. $MCD(a, b) = MCD(a, c) = MCD(b, c) = 1$
2. $a &lt; b$
3. $a + b = c$
4. $rad(abc) &lt; c$
a &lt; b
Per esempio, (5, 27, 32) è un abc-hit poiché:
a + b = c
1. $MCD(5, 27) = MCD(5, 32) = MCD(27, 32) = 1$
2. $5 &lt; 27$
3. $5 + 27 = 32$
4. $rad(4320) = 30 &lt; 32$
rad(abc) &lt; c
Gli abc-hit sono piuttosto rari e ce ne sono solo trentuno per $c &lt; 1000$, con $\sum{c} = 12523$.
For example, (5, 27, 32) is an abc-hit, because:
GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1
5 &lt; 27
5 + 27 = 32
rad(4320) = 30 &lt; 32
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for c &lt; 1000, with ∑c = 12523.
Find ∑c for c &lt; 120000.
Trova $\sum{c}$ per $c &lt; 120000$.
# --hints--
`euler127()` should return 18407904.
`abcHits()` dovrebbe restituire `18407904`.
```js
assert.strictEqual(euler127(), 18407904);
assert.strictEqual(abcHits(), 18407904);
```
# --seed--
@ -47,12 +41,12 @@ assert.strictEqual(euler127(), 18407904);
## --seed-contents--
```js
function euler127() {
function abcHits() {
return true;
}
euler127();
abcHits();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ec1000cf542c50feff
title: 'Problem 128: Hexagonal tile differences'
title: 'Problema 128: differenze di mattonelle esagonali'
challengeType: 5
forumTopicId: 301755
dashedName: problem-128-hexagonal-tile-differences
@ -8,18 +8,30 @@ dashedName: problem-128-hexagonal-tile-differences
# --description--
A hexagonal tile with number 1 is surrounded by a ring of six hexagonal tiles, starting at "12 o'clock" and numbering the tiles 2 to 7 in an anti-clockwise direction.
Una mattonella esagonale con il numero 1 è circondata da un anello di sei mattonelle esagonali, partendo dalla posizione delle dodici in punto numerate da 2 a 7 in direzione antioraria.
New rings are added in the same fashion, with the next rings being numbered 8 to 19, 20 to 37, 38 to 61, and so on. The diagram below shows the first three rings.
Nuovi anelli sono aggiungi nello stesso modo, con i nuovi anelli numerati da 8 a 19, da 20 a 37, da 38 a 61, e così via. Il diagramma qua sotto mostra i primi tre anelli.
By finding the difference between tile n and each of its six neighbours we shall define PD(n) to be the number of those differences which are prime. For example, working clockwise around tile 8 the differences are 12, 29, 11, 6, 1, and 13. So PD(8) = 3. In the same way, the differences around tile 17 are 1, 17, 16, 1, 11, and 10, hence PD(17) = 2. It can be shown that the maximum value of PD(n) is 3. If all of the tiles for which PD(n) = 3 are listed in ascending order to form a sequence, the 10th tile would be 271. Find the 2000th tile in this sequence.
<img class="img-responsive center-block" alt="i primi tre anelli delle mattonelle esagonali ordinate con i numeri da 1 a 37, e con evidenziate le mattonelle 8 e 17" src="https://cdn.freecodecamp.org/curriculum/project-euler/hexagonal-tile-differences.png" style="background-color: white; padding: 10px;" />
Trovando la differenza tra la mattonella $n$ e ognuna delle sei mattonelle vicine, definiamo $PD(n)$ come il numero delle differenze che sono numeri primi.
Per esempio, lavorando in senso orario attorno alla mattonella 8 le differenze sono 12, 29, 11, 6, 1, e 13. Quindi $PD(8) = 3$.
Allo stesso modo le differenze attorno alla mattonella 17 sono 1, 17, 16, 1, 11, e 10, quindi $PD(17) = 2$.
SI può dimostrare che il valore massimo di $PD(n)$ è $3$.
Se tutte le mattonelle per cui $PD(n) = 3$ sono elencate in ordine crescente a formare una sequenza, la decima mattonella sarebbe 271.
Trova la 2000-sima mattonella nella sequenza.
# --hints--
`euler128()` should return 14516824220.
`hexagonalTile()` dovrebbe restituire `14516824220`.
```js
assert.strictEqual(euler128(), 14516824220);
assert.strictEqual(hexagonalTile(), 14516824220);
```
# --seed--
@ -27,12 +39,12 @@ assert.strictEqual(euler128(), 14516824220);
## --seed-contents--
```js
function euler128() {
function hexagonalTile() {
return true;
}
euler128();
hexagonalTile();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ef1000cf542c50ff01
title: 'Problem 129: Repunit divisibility'
title: 'Problema 129: divisibilità dei repunit'
challengeType: 5
forumTopicId: 301756
dashedName: problem-129-repunit-divisibility
@ -8,20 +8,20 @@ dashedName: problem-129-repunit-divisibility
# --description--
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Un numero costituito interamente da uni è chiamato un repunit (ripetizione di uno). Definiamo $R(k)$ come repunit di lunghezza $k$, per esempio $R(6) = 111111$.
Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible by n, and let A(n) be the least such value of k; for example, A(7) = 6 and A(41) = 5.
Dato che $n$ è un numero positivo intero e $MCD(n, 10) = 1$, si può dimostrare che esiste sempre un valore di $k$ per cui $R(k)$ è divisibile per $n$, $A(n)$ è il minimo valore di $k$ per cui ciò è vero; per esempio, $A(7) = 6$ e $A(41) = 5$.
The least value of n for which A(n) first exceeds ten is 17.
Il valore minimo di $n$ per cui $A(n)$ eccede per la prima volta 10 è 17.
Find the least value of n for which A(n) first exceeds one-million.
Trova il valore minimo di $n$ per cui $A(n)$ eccede per la prima volta un milione.
# --hints--
`euler129()` should return 1000023.
`repunitDivisibility()` dovrebbe restituire `1000023`.
```js
assert.strictEqual(euler129(), 1000023);
assert.strictEqual(repunitDivisibility(), 1000023);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler129(), 1000023);
## --seed-contents--
```js
function euler129() {
function repunitDivisibility() {
return true;
}
euler129();
repunitDivisibility();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ee1000cf542c50ff00
title: 'Problem 130: Composites with prime repunit property'
title: 'Problema 130: Numeri compositi con la proprietà dei primi repunit'
challengeType: 5
forumTopicId: 301758
dashedName: problem-130-composites-with-prime-repunit-property
@ -8,22 +8,22 @@ dashedName: problem-130-composites-with-prime-repunit-property
# --description--
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Un numero costituito interamente da uni è chiamato un repunit (ripetizione di uno). Definiamo $R(k)$ come repunit di lunghezza $k$, per esempio $R(6) = 111111$.
Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible by n, and let A(n) be the least such value of k; for example, A(7) = 6 and A(41) = 5.
Dato che $n$ è un numero positivo intero e $MCD(n, 10) = 1$, si può dimostrare che esiste sempre un valore di $k$ per cui $R(k)$ è divisibile per $n$, $A(n)$ è il minimo valore di $k$ per cui ciò è vero; per esempio, $A(7) = 6$ e $A(41) = 5$.
You are given that for all primes, p > 5, that p 1 is divisible by A(p). For example, when p = 41, A(41) = 5, and 40 is divisible by 5.
Ti viene dato per tutti i numeri primi, $p > 5$, che $p 1$ è divisibile per $A(p)$. Per esempio, quando $p = 41, A(41) = 5$, e 40 è divisibile per 5.
However, there are rare composite values for which this is also true; the first five examples being 91, 259, 451, 481, and 703.
Eppure, ci sono rari valori compositi per cui questo è pure vero, i primi cinque esempi sono 91, 259, 451, 481, e 703.
Find the sum of the first twenty-five composite values of n for whichGCD(n, 10) = 1 and n 1 is divisible by A(n).
Trova la somma dei primi venticinque valori compositi di $n$ per cui $MCD(n, 10) = 1$ e $n - 1$ è divisibile per $A(n)$.
# --hints--
`euler130()` should return 149253.
`compositeRepunit()` dovrebbe restituire `149253`.
```js
assert.strictEqual(euler130(), 149253);
assert.strictEqual(compositeRepunit(), 149253);
```
# --seed--
@ -31,12 +31,12 @@ assert.strictEqual(euler130(), 149253);
## --seed-contents--
```js
function euler130() {
function compositeRepunit() {
return true;
}
euler130();
compositeRepunit();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ef1000cf542c50ff02
title: 'Problem 131: Prime cube partnership'
title: 'Problema 131: l''alleanza dei cubi e dei numei primi'
challengeType: 5
forumTopicId: 301759
dashedName: problem-131-prime-cube-partnership
@ -8,20 +8,20 @@ dashedName: problem-131-prime-cube-partnership
# --description--
There are some prime values, p, for which there exists a positive integer, n, such that the expression n3 + n2p is a perfect cube.
Ci sono alcuni valori primi, $p$, per cui esiste un numero intero positivo, $n$, per cui l'espressione $n^3 + n^{2}p$ è un cubo perfetto.
For example, when p = 19, 83 + 82×19 = 123.
Per esempio, quando $p = 19,\\8^3 + 8^2 × 19 = {12}^3$.
What is perhaps most surprising is that for each prime with this property the value of n is unique, and there are only four such primes below one-hundred.
Cio che è forse più sorprendente è che il valore di $n$ è unico per ogni primo con questa proprietà, e ci sono solo quattro primi con questa proprietà sotto cento.
How many primes below one million have this remarkable property?
Quanti numeri primi sotto un milione hanno questa notevole proprietà?
# --hints--
`euler131()` should return 173.
`primeCubePartnership()` dovrebbe restituire `173`.
```js
assert.strictEqual(euler131(), 173);
assert.strictEqual(primeCubePartnership(), 173);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler131(), 173);
## --seed-contents--
```js
function euler131() {
function primeCubePartnership() {
return true;
}
euler131();
primeCubePartnership();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f11000cf542c50ff03
title: 'Problem 132: Large repunit factors'
title: 'Problema 132: Grandi fattori repunit'
challengeType: 5
forumTopicId: 301760
dashedName: problem-132-large-repunit-factors
@ -8,18 +8,18 @@ dashedName: problem-132-large-repunit-factors
# --description--
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k.
Un numero costituito interamente da uni è chiamato un repunit (ripetizione di uno). Definiremo $R(k)$ in modo che sia una repunit di lunghezza $k$.
For example, R(10) = 1111111111 = 11×41×271×9091, and the sum of these prime factors is 9414.
Ad esempio, $R(10) = 1111111111 = 11 × 41 × 271 × 9091$, e la somma di questi fattori primi è 9414.
Find the sum of the first forty prime factors of R(109).
Trova la somma dei primi quaranta fattori primi di $R({10}^9)$.
# --hints--
`euler132()` should return 843296.
`largeRepunitFactors()` dovrebbe restituire `843296`.
```js
assert.strictEqual(euler132(), 843296);
assert.strictEqual(largeRepunitFactors(), 843296);
```
# --seed--
@ -27,12 +27,12 @@ assert.strictEqual(euler132(), 843296);
## --seed-contents--
```js
function euler132() {
function largeRepunitFactors() {
return true;
}
euler132();
largeRepunitFactors();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f21000cf542c50ff04
title: 'Problem 133: Repunit nonfactors'
title: 'Problema 133: non-fattori di numeri repunit'
challengeType: 5
forumTopicId: 301761
dashedName: problem-133-repunit-nonfactors
@ -8,20 +8,20 @@ dashedName: problem-133-repunit-nonfactors
# --description--
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Un numero costituito interamente da uni è chiamato un repunit (ripetizione di uno). Definiamo $R(k)$ come repunit di lunghezza $k$, per esempio $R(6) = 111111$.
Let us consider repunits of the form R(10n).
Consideriamo repunit della forma $R({10}^n)$.
Although R(10), R(100), or R(1000) are not divisible by 17, R(10000) is divisible by 17. Yet there is no value of n for which R(10n) will divide by 19. In fact, it is remarkable that 11, 17, 41, and 73 are the only four primes below one-hundred that can be a factor of R(10n).
Anche se $R(10)$, $R(100)$, or $R(1000)$ non sono divisibili per 17, $R(10000)$ è divisibile per 17. Però non c'è alcun valore di n per cui $R({10}^n)$ è divisibile per 19. Notevolmente, 11, 17, 41, e 73 sono i soli quattro numeri primi sotto cento che possono essere fattori di $R({10}^n)$.
Find the sum of all the primes below one-hundred thousand that will never be a factor of R(10n).
Trova la somma di tutti i primi sotto centomila che non saranno mai un fattore di $R({10}^n)$.
# --hints--
`euler133()` should return 453647705.
`repunitNonfactors()` dovrebbe restituire `453647705`.
```js
assert.strictEqual(euler133(), 453647705);
assert.strictEqual(repunitNonfactors(), 453647705);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler133(), 453647705);
## --seed-contents--
```js
function euler133() {
function repunitNonfactors() {
return true;
}
euler133();
repunitNonfactors();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f21000cf542c50ff05
title: 'Problem 134: Prime pair connection'
title: 'Problema 134: connessioni di coppie di numeri primi'
challengeType: 5
forumTopicId: 301762
dashedName: problem-134-prime-pair-connection
@ -8,18 +8,18 @@ dashedName: problem-134-prime-pair-connection
# --description--
Consider the consecutive primes p1 = 19 and p2 = 23. It can be verified that 1219 is the smallest number such that the last digits are formed by p1 whilst also being divisible by p2.
Considera i primi consecutivi $p_1 = 19$ e $p_2 = 23$. Si può verificare che 1219 è il numero più piccolo per cui le ultime cifre sono formate da $p_1$ essendo anche divisibile da $p_2$.
In fact, with the exception of p1 = 3 and p2 = 5, for every pair of consecutive primes, p2 > p1, there exist values of n for which the last digits are formed by p1 and n is divisible by p2. Let S be the smallest of these values of n.
Infatti, con l'eccezione di $p_1 = 3$ e $p_2 = 5$, per ogni coppia di numeri primi consecutivi, $p_2 > p_1$, esiste un valore di $n$ per cui le ultime cifre sono formate da $p_1$ e $n$ è divisibile per $p_2$. Sia $S$ il più piccolo di questi valori di $n$.
Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000.
Trova $\sum{S}$ per ogni coppia di numeri primi consecutivi con $5 ≤ p_1 ≤ 1000000$.
# --hints--
`euler134()` should return 18613426663617120.
`primePairConnection()` dovrebbe restituire `18613426663617120`.
```js
assert.strictEqual(euler134(), 18613426663617120);
assert.strictEqual(primePairConnection(), 18613426663617120);
```
# --seed--
@ -27,12 +27,12 @@ assert.strictEqual(euler134(), 18613426663617120);
## --seed-contents--
```js
function euler134() {
function primePairConnection() {
return true;
}
euler134();
primePairConnection();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f31000cf542c50ff06
title: 'Problem 135: Same differences'
title: 'Problema 135: Stesse differenze'
challengeType: 5
forumTopicId: 301763
dashedName: problem-135-same-differences
@ -8,20 +8,20 @@ dashedName: problem-135-same-differences
# --description--
Given the positive integers, x, y, and z, are consecutive terms of an arithmetic progression, the least value of the positive integer, n, for which the equation, x2 y2 z2 = n, has exactly two solutions is n = 27:
Dati i numeri interi positivi, $x$, $y$ e $z$, che sono termini consecutivi di una progressione aritmetica, il valore minimo dell'intero positivo $n$ per il quale l'equazione $x^2 y^2 z^2 = n$ ha esattamente due soluzioni è $n = 27$:
342 272 202 = 122 92 62 = 27
$$34^2 27^2 20^2 = 12^2 9^2 6^2 = 27$$
It turns out that n = 1155 is the least value which has exactly ten solutions.
Si scopre che $n = 1155$ è il valore minimo che ha esattamente dieci soluzioni.
How many values of n less than one million have exactly ten distinct solutions?
Quanti valori di $n$ minori di un milione hanno esattamente dieci soluzioni distinte?
# --hints--
`euler135()` should return 4989.
`sameDifferences()` dovrebbe restituire `4989`.
```js
assert.strictEqual(euler135(), 4989);
assert.strictEqual(sameDifferences(), 4989);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler135(), 4989);
## --seed-contents--
```js
function euler135() {
function sameDifferences() {
return true;
}
euler135();
sameDifferences();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f51000cf542c50ff07
title: 'Problem 136: Singleton difference'
title: 'Problema 136: Differenza singola'
challengeType: 5
forumTopicId: 301764
dashedName: problem-136-singleton-difference
@ -8,20 +8,20 @@ dashedName: problem-136-singleton-difference
# --description--
The positive integers, x, y, and z, are consecutive terms of an arithmetic progression. Given that n is a positive integer, the equation, x2 y2 z2 = n, has exactly one solution when n = 20:
Gli interi positivi, $x$, $y$e $z$, sono termini consecutivi di una progressione aritmetica. Dato che $n$ è un numero intero positivo, l'equazione, $x^2 y^2 z^2 = n$, ha esattamente una soluzione quando $n = 20$:
132 102 72 = 20
$$13^2 10^2 7^2 = 20$$
In fact there are twenty-five values of n below one hundred for which the equation has a unique solution.
Infatti, ci sono venticinque valori di $n$ sotto il cento per i quali l'equazione ha una soluzione unica.
How many values of n less than fifty million have exactly one solution?
Quanti valori di $n$ minori di cinquanta milioni hanno esattamente una soluzione?
# --hints--
`euler136()` should return 2544559.
`singletonDifference()` dovrebbe restituire `2544559`.
```js
assert.strictEqual(euler136(), 2544559);
assert.strictEqual(singletonDifference(), 2544559);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler136(), 2544559);
## --seed-contents--
```js
function euler136() {
function singletonDifference() {
return true;
}
euler136();
singletonDifference();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f51000cf542c50ff08
title: 'Problem 137: Fibonacci golden nuggets'
title: 'Problema 137: la pepita d''oro di Fibonacci'
challengeType: 5
forumTopicId: 301765
dashedName: problem-137-fibonacci-golden-nuggets
@ -8,30 +8,34 @@ dashedName: problem-137-fibonacci-golden-nuggets
# --description--
Consider the infinite polynomial series AF(x) = xF1 + x2F2 + x3F3 + ..., where Fk is the kth term in the Fibonacci sequence: 1, 1, 2, 3, 5, 8, ... ; that is, Fk = Fk1 + Fk2, F1 = 1 and F2 = 1.
Considera la serie polinomiale infinita $A_{F}(x) = xF_1 + x^2F_2 + x^3F_3 + \ldots$, dove $F_k$ è il termine $k$-simo nella sequenza di Fibonacci: $1, 1, 2, 3, 5, 8, \ldots$; cioè $F_k = F_{k 1} + F_{k 2}, F_1 = 1$ e $F_2 = 1$.
For this problem we shall be interested in values of x for which AF(x) is a positive integer.
Per questo problema consideriamo i valori di $x$ per cui $A_{F}(x)$ è un numero intero positivo.
Surprisingly AF(1/2)
Sorprendentemente
=
$$\begin{align} A_F(\frac{1}{2}) & = (\frac{1}{2}) × 1 + {(\frac{1}{2})}^2 × 1 + {(\frac{1}{2})}^3 × 2 + {(\frac{1}{2})}^4 × 3 + {(\frac{1}{2})}^5 × 5 + \cdots \\\\ & = \frac{1}{2} + \frac{1}{4} + \frac{2}{8} + \frac{3}{16} + \frac{5}{32} + \cdots \\\\ & = 2 \end{align}$$
(1/2).1 + (1/2)2.1 + (1/2)3.2 + (1/2)4.3 + (1/2)5.5 + ...
I valori porrispondenti di $x$ per i primi cinque numeri naturali sono mostrati sotto.
= 1/2 + 1/4 + 2/8 + 3/16 + 5/32 + ...
| $x$ | $A_F(x)$ |
| --------------------------- | -------- |
| $\sqrt{2} 1$ | $1$ |
| $\frac{1}{2}$ | $2$ |
| $\frac{\sqrt{13} 2}{3}$ | $3$ |
| $\frac{\sqrt{89} 5}{8}$ | $4$ |
| $\frac{\sqrt{34} 3}{5}$ | $5$ |
= 2 The corresponding values of x for the first five natural numbers are shown below.
Chiamamo $A_F(x)$ una pepita d'oro se $x$ è razionale, perché diventano sempre più rari; per esempio, la decima pepita d'oro è 74049690.
xAF(x) √211 1/22 (√132)/33 (√895)/84 (√343)/55
We shall call AF(x) a golden nugget if x is rational, because they become increasingly rarer; for example, the 10th golden nugget is 74049690. Find the 15th golden nugget.
Trova la quindicesima pepita d'oro.
# --hints--
`euler137()` should return 1120149658760.
`goldenNugget()` dovrebbe restituire `1120149658760`.
```js
assert.strictEqual(euler137(), 1120149658760);
assert.strictEqual(goldenNugget(), 1120149658760);
```
# --seed--
@ -39,12 +43,12 @@ assert.strictEqual(euler137(), 1120149658760);
## --seed-contents--
```js
function euler137() {
function goldenNugget() {
return true;
}
euler137();
goldenNugget();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f61000cf542c50ff09
title: 'Problem 138: Special isosceles triangles'
title: 'Problema 138: Triangoli isoscele speciali'
challengeType: 5
forumTopicId: 301766
dashedName: problem-138-special-isosceles-triangles
@ -8,16 +8,22 @@ dashedName: problem-138-special-isosceles-triangles
# --description--
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
Considera il triangolo isoscele con lunghezza di base $b = 16$, e lati $L = 17$.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 82) = 15, which is one less than the base length. With b = 272 and L = 305, we get h = 273, which is one more than the base length, and this is the second smallest isosceles triangle with the property that h = b ± 1. Find ∑ L for the twelve smallest isosceles triangles for which h = b ± 1 and b, L are positive integers.
<img class="img-responsive center-block" alt="Un triangolo isoscele con lati denominati L - due lati con la stessa lunghezza e base del triangolo b; e altezza del triangolo - h dalla base del triangolo al vertice tra i lati L" src="https://cdn.freecodecamp.org/curriculum/project-euler/special-isosceles-triangles.png" style="background-color: white; padding: 10px;" />
Utilizzando il teorema di Pitagora, si può vedere che l'altezza del triangolo, $h = \sqrt{{17}^2 8^2} = 15$, che è una lunghezza inferiore alla base.
Con $b = 272$ e $L = 305$, otteniamo $h = 273$, che è uno in più della lunghezza di base, e questo è il secondo più piccolo triangolo isoscele con la proprietà che $h = b ± 1$.
Trova $\sum{L}$ per i dodici triangoli isosceli più piccoli per i quali $h = b ± 1$ e $b$, $L$ sono interi positivi.
# --hints--
`euler138()` should return 1118049290473932.
`isoscelesTriangles()` dovrebbe restituire `1118049290473932`.
```js
assert.strictEqual(euler138(), 1118049290473932);
assert.strictEqual(isoscelesTriangles(), 1118049290473932);
```
# --seed--
@ -25,12 +31,12 @@ assert.strictEqual(euler138(), 1118049290473932);
## --seed-contents--
```js
function euler138() {
function isoscelesTriangles() {
return true;
}
euler138();
isoscelesTriangles();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f71000cf542c50ff0a
title: 'Problem 139: Pythagorean tiles'
title: 'Problema 139: mattonelle pitagoree'
challengeType: 5
forumTopicId: 301767
dashedName: problem-139-pythagorean-tiles
@ -8,18 +8,22 @@ dashedName: problem-139-pythagorean-tiles
# --description--
Let (a, b, c) represent the three sides of a right angle triangle with integral length sides. It is possible to place four such triangles together to form a square with length c.
Siano (a, b, c) i tre lati di un triangolo rettangolo con lunghezze dei lati intere. È possibile unire quattro di questi triangoli insieme a formare un quadrato con lunghezza c.
For example, (3, 4, 5) triangles can be placed together to form a 5 by 5 square with a 1 by 1 hole in the middle and it can be seen that the 5 by 5 square can be tiled with twenty-five 1 by 1 squares.
Per esempio, triangoli (3, 4, 5) possono essere messi assieme per formare un quadrato 5 x 5 con un buco 1 per 1 nel centro e si può vedere che il quadrato 5 x 5 può essere riempito con venticinque quadrati 1 x 1.
However, if (5, 12, 13) triangles were used then the hole would measure 7 by 7 and these could not be used to tile the 13 by 13 square. Given that the perimeter of the right triangle is less than one-hundred million, how many Pythagorean triangles would allow such a tiling to take place?
<img class="img-responsive center-block" alt="due quadrato 5 x 5: uno con quattro triangoli 3x4x5 posizionati per creare un buco 1x1 al centro; un secondo con venticinque quadrati 1x1" src="https://cdn.freecodecamp.org/curriculum/project-euler/pythagorean-tiles.png" style="background-color: white; padding: 10px;" />
Invece, usando triangoli (5, 12, 16) il buco al centro misura 7 x 7. Questi quadrati 7 x 7 non potrebbero essere usati per riempire il quadrato 13 x 13.
Sia il perimetro del triangolo rettangolo inferiore a cento milioni, quanti triangoli pitagorici permettono il rivestimento esatto con una mattonella della dimensione del buco centrale?
# --hints--
`euler139()` should return 10057761.
`pythagoreanTiles()` dovrebbe restituire `10057761`.
```js
assert.strictEqual(euler139(), 10057761);
assert.strictEqual(pythagoreanTiles(), 10057761);
```
# --seed--
@ -27,12 +31,12 @@ assert.strictEqual(euler139(), 10057761);
## --seed-contents--
```js
function euler139() {
function pythagoreanTiles() {
return true;
}
euler139();
pythagoreanTiles();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fa1000cf542c50ff0c
title: 'Problem 140: Modified Fibonacci golden nuggets'
title: 'Problema 140: Pepite d''oro di Fibonacci modificato'
challengeType: 5
forumTopicId: 301769
dashedName: problem-140-modified-fibonacci-golden-nuggets
@ -8,22 +8,28 @@ dashedName: problem-140-modified-fibonacci-golden-nuggets
# --description--
Consider the infinite polynomial series AG(x) = xG1 + x2G2 + x3G3 + ..., where Gk is the kth term of the second order recurrence relation Gk = Gk1 + Gk2, G1 = 1 and G2 = 4; that is, 1, 4, 5, 9, 14, 23, ... .
Considera la serie polinomiale infinita $A_G(x) = xG_1 + x^2G_2 + x^3G_3 + \cdots$, dove $G_k$ è il $k$-esimo termine della relazione di ricorrenza del secondo ordine $G_k = G_{k 1} + G_{k 2}, G_1 = 1$ e $G_2 = 4$; cioè, $1, 4, 5, 9, 14, 23, \ldots$.
For this problem we shall be concerned with values of x for which AG(x) is a positive integer.
Per questo problema ci occuperemo dei valori di $x$ per i quali $A_G(x)$ è un numero intero positivo.
The corresponding values of x for the first five natural numbers are shown below.
I valori corrispondenti di $x$ per i primi cinque numeri naturali sono mostrati sotto.
xAG(x) (√51)/41 2/52 (√222)/63 (√1375)/144 1/25
| $x$ | $A_G(x)$ |
| ----------------------------- | -------- |
| $\frac{\sqrt{5} 1}{4}$ | $1$ |
| $\frac{2}{5}$ | $2$ |
| $\frac{\sqrt{22} 2}{6}$ | $3$ |
| $\frac{\sqrt{137} 5}{14}$ | $4$ |
| $\frac{1}{2}$ | $5$ |
We shall call AG(x) a golden nugget if x is rational, because they become increasingly rarer; for example, the 20th golden nugget is 211345365. Find the sum of the first thirty golden nuggets.
Chiamamo $A_G(x)$ una pepita d'oro se $x$ è razionale, perché diventano sempre più rari; per esempio, la ventesima pepita d'oro è 211345365. Trova la somma delle prime trenta pepite d'oro.
# --hints--
`euler140()` should return 5673835352990.
`modifiedGoldenNuggets()` dovrebbe restituire `5673835352990`
```js
assert.strictEqual(euler140(), 5673835352990);
assert.strictEqual(modifiedGoldenNuggets(), 5673835352990);
```
# --seed--
@ -31,12 +37,12 @@ assert.strictEqual(euler140(), 5673835352990);
## --seed-contents--
```js
function euler140() {
function modifiedGoldenNuggets() {
return true;
}
euler140();
modifiedGoldenNuggets();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3f91000cf542c50ff0b
title: 'Problem 141: Investigating progressive numbers, n, which are also square'
title: 'Problema 141: Indagare i numeri progressivi, n, che sono anche quadrati'
challengeType: 5
forumTopicId: 301770
dashedName: problem-141-investigating-progressive-numbers-n-which-are-also-square
@ -8,22 +8,22 @@ dashedName: problem-141-investigating-progressive-numbers-n-which-are-also-squar
# --description--
A positive integer, n, is divided by d and the quotient and remainder are q and r respectively. In addition d, q, and r are consecutive positive integer terms in a geometric sequence, but not necessarily in that order.
Un intero positivo $n$, è diviso da $d$ e il quoziente e il resto sono rispettivamente $q$ ed $r$. Inoltre $d$, $q$e $r$ sono numeri interi positivi consecutivi in una sequenza geometrica, ma non necessariamente in quest'ordine.
For example, 58 divided by 6 has quotient 9 and remainder 4. It can also be seen that 4, 6, 9 are consecutive terms in a geometric sequence (common ratio 3/2).
Ad esempio, 58 diviso per 6 ha un quoziente di 9 e un resto di 4. Si può anche vedere che 4, 6, 9 sono termini consecutivi in una sequenza geometrica (rapporto comune $\frac{3}{2}$).
We will call such numbers, n, progressive.
Chiameremo tali numeri $n$, progressivi.
Some progressive numbers, such as 9 and 10404 = 1022, happen to also be perfect squares. The sum of all progressive perfect squares below one hundred thousand is 124657.
Alcuni numeri progressivi, come 9 e 10404 = ${102}^2$, sono anche quadrati perfetti. La somma di tutti i quadrati perfetti progressivi sotto centomila è 124657.
Find the sum of all progressive perfect squares below one trillion (1012).
Trova la somma di tutti i quadrati perfetti progressivi sotto un trilione (${10}^{12}$).
# --hints--
`euler141()` should return 878454337159.
`progressivePerfectSquares()` dovrebbe restituire `878454337159`.
```js
assert.strictEqual(euler141(), 878454337159);
assert.strictEqual(progressivePerfectSquares(), 878454337159);
```
# --seed--
@ -31,12 +31,12 @@ assert.strictEqual(euler141(), 878454337159);
## --seed-contents--
```js
function euler141() {
function progressivePerfectSquares() {
return true;
}
euler141();
progressivePerfectSquares();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fa1000cf542c50ff0d
title: 'Problem 142: Perfect Square Collection'
title: 'Problema 142: Collezione Quadrata Perfetta'
challengeType: 5
forumTopicId: 301771
dashedName: problem-142-perfect-square-collection
@ -8,14 +8,14 @@ dashedName: problem-142-perfect-square-collection
# --description--
Find the smallest x + y + z with integers x > y > z > 0 such that x + y, x y, x + z, x z, y + z, y z are all perfect squares.
Trova il più piccolo $x + y + z$ con interi $x > y > z > 0$ in modo che $x + y$, $x y$, $x + z$, $x z$, $y + z$, $y z$ siano tutti quadrati perfetti.
# --hints--
`euler142()` should return 1006193.
`perfectSquareCollection()` dovrebbe restituire `1006193`.
```js
assert.strictEqual(euler142(), 1006193);
assert.strictEqual(perfectSquareCollection(), 1006193);
```
# --seed--
@ -23,12 +23,12 @@ assert.strictEqual(euler142(), 1006193);
## --seed-contents--
```js
function euler142() {
function perfectSquareCollection() {
return true;
}
euler142();
perfectSquareCollection();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fc1000cf542c50ff0e
title: 'Problem 143: Investigating the Torricelli point of a triangle'
title: 'Problema 143: Investigare il punto Torricelli di un triangolo'
challengeType: 5
forumTopicId: 301772
dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
@ -8,20 +8,22 @@ dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
# --description--
Let ABC be a triangle with all interior angles being less than 120 degrees. Let X be any point inside the triangle and let XA = p, XC = q, and XB = r.
Sia ABC un triangolo con tutti gli angoli interni inferiori a 120 gradi. Sia X qualsiasi punto dentro il triangolo e siano $XA = p$, $XC = q$, w $XB = r$.
Fermat challenged Torricelli to find the position of X such that p + q + r was minimised.
Fermat sfidò Torricelli a trovare la posizione di X per cui p + q + r è minimizzata.
Torricelli was able to prove that if equilateral triangles AOB, BNC and AMC are constructed on each side of triangle ABC, the circumscribed circles of AOB, BNC, and AMC will intersect at a single point, T, inside the triangle. Moreover he proved that T, called the Torricelli/Fermat point, minimises p + q + r. Even more remarkable, it can be shown that when the sum is minimised, AN = BM = CO = p + q + r and that AN, BM and CO also intersect at T.
Torricelli fu in grado di provare che se i triangoli equilateri AOB, BNC e AMC sono costruiti su ogni lato del triangolo ABC, i cerchi circoscritti AOB, BNC, e AMC intersecano in un singolo punto, T, dentro il triangolo. In più ha provato che T, chiamato il punto Torricelli/Fermat, minimizza $p + q + r$. Ancora più notevole, si può mostrare che quando la somma è minimizzata, $AN = BM = CM = p + q + r$ e quindi AN, BM e CO pure intersecano in T.
If the sum is minimised and a, b, c, p, q and r are all positive integers we shall call triangle ABC a Torricelli triangle. For example, a = 399, b = 455, c = 511 is an example of a Torricelli triangle, with p + q + r = 784. Find the sum of all distinct values of p + q + r ≤ 120000 for Torricelli triangles.
<img class="img-responsive center-block" alt="triangoli equilateri AOB, BNC e AMC costruiti su ogni lato del triangolo ABC; con i cerchi circoscritti di AOB, BNC e AMC intersecanti in un singolo punto T, dentro il triangolo" src="https://cdn.freecodecamp.org/curriculum/project-euler/investigating-the-torricelli-point-of-a-triangle.png" style="background-color: white; padding: 10px;" />
Se la somma è minimizzata e a, b, c, p, q e r sono tutti numeri interi positivi, chiamiamo il triangolo ABC un triangolo di Torricelli. Per esempio, $a = 399$, $b = 455$, $c = 511$ è un esempio di un Triangolo di Torricelli, con $p + q + r = 784$. Trova la somma di tutti i distinti valori di $p + q + r ≤ 120000$ per i triangoli di Torricelli.
# --hints--
`euler143()` should return 30758397.
`sumTorricelliTriangles()` dovrebbe restituire `30758397`.
```js
assert.strictEqual(euler143(), 30758397);
assert.strictEqual(sumTorricelliTriangles(), 30758397);
```
# --seed--
@ -29,12 +31,12 @@ assert.strictEqual(euler143(), 30758397);
## --seed-contents--
```js
function euler143() {
function sumTorricelliTriangles() {
return true;
}
euler143();
sumTorricelliTriangles();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fc1000cf542c50ff0f
title: 'Problem 144: Investigating multiple reflections of a laser beam'
title: 'Problema 144: Indagare i molteplici riflessi di un fascio laser'
challengeType: 5
forumTopicId: 301773
dashedName: problem-144-investigating-multiple-reflections-of-a-laser-beam
@ -8,22 +8,37 @@ dashedName: problem-144-investigating-multiple-reflections-of-a-laser-beam
# --description--
In laser physics, a "white cell" is a mirror system that acts as a delay line for the laser beam. The beam enters the cell, bounces around on the mirrors, and eventually works its way back out.
Nella fisica laser, una "cella bianca" è un sistema a specchio che funge da linea di ritardo per il raggio laser. Il raggio entra nella cella, rimbalza sugli specchi, e alla fine trova la sua via di uscita.
The specific white cell we will be considering is an ellipse with the equation 4x2 + y2 = 100
La specifica cella bianca che prenderemo in considerazione è un'ellisse con l'equazione $4{x}^2 + y^2 = 100$
The section corresponding to 0.01 ≤ x ≤ +0.01 at the top is missing, allowing the light to enter and exit through the hole.
Manca la sezione corrispondente a $0.01 ≤ x ≤ +0.01$ in alto, permettendo alla luce di entrare e uscire attraverso il foro.
The light beam in this problem starts at the point (0.0,10.1) just outside the white cell, and the beam first impacts the mirror at (1.4,-9.6). Each time the laser beam hits the surface of the ellipse, it follows the usual law of reflection "angle of incidence equals angle of reflection." That is, both the incident and reflected beams make the same angle with the normal line at the point of incidence. In the figure on the left, the red line shows the first two points of contact between the laser beam and the wall of the white cell; the blue line shows the line tangent to the ellipse at the point of incidence of the first bounce.The slope m of the tangent line at any point (x,y) of the given ellipse is: m = 4x/yThe normal line is perpendicular to this tangent line at the point of incidence. The animation on the right shows the first 10 reflections of the beam.
<div style="text-align: center">
<img class="img-responsive center-block" alt="fascio luminoso a partire dal punto (0.0, 10.1) e che attraversa lo specchio al punto (1.4, -9.6)" src="https://cdn.freecodecamp.org/curriculum/project-euler/investigating-multiple-reflections-of-a-laser-beam-1.png" style="display: inline-block; background-color: white; padding: 10px;">
<img class="img-responsive center-block" alt="animazione con le prime 10 riflessioni del fascio" src="https://cdn.freecodecamp.org/curriculum/project-euler/investigating-multiple-reflections-of-a-laser-beam-2.gif" style="display: inline-block; background-color: white; padding: 10px;">
</div><br>
How many times does the beam hit the internal surface of the white cell before exiting?
Il fascio luminoso in questo problema inizia dal punto (0.0, 10.1) appena fuori dalla cella bianca e incontra per la prima volta lo specchio a (1.4, -9.6).
Ogni volta che il raggio laser colpisce la superficie dell'ellisse, segue la consueta legge di riflessione "l'angolo di incidenza è uguale all'angolo di riflessione". Cioè, sia i fasci incidenti che quelli riflessi formano lo stesso angolo con la linea normale nel punto di incidenza.
Nella figura a sinistra, la linea rossa indica i primi due punti di contatto tra il fascio laser e la parete della cella bianca; la linea blu mostra la linea tangente all'ellisse nel punto di incidenza del primo rimbalzo.
La pendenza m della linea tangente in qualsiasi punto (x, y) della data ellisse è: $m = 4 × \frac{x}{y}$
La linea normale è perpendicolare a questa linea tangente nel punto di incidenza.
L'animazione a destra mostra le prime 10 riflessioni del fascio.
Quante volte il raggio colpisce la superficie interna della cella bianca prima di uscire?
# --hints--
`euler144()` should return 354.
`laserBeamReflections()` dovrebbe restituire `354`.
```js
assert.strictEqual(euler144(), 354);
assert.strictEqual(laserBeamReflections(), 354);
```
# --seed--
@ -31,12 +46,12 @@ assert.strictEqual(euler144(), 354);
## --seed-contents--
```js
function euler144() {
function laserBeamReflections() {
return true;
}
euler144();
laserBeamReflections();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fd1000cf542c50ff10
title: 'Problem 145: How many reversible numbers are there below one-billion?'
title: 'Problema 145: Quanti numeri reversibili ci sono sotto un miliardo?'
challengeType: 5
forumTopicId: 301774
dashedName: problem-145-how-many-reversible-numbers-are-there-below-one-billion
@ -8,18 +8,18 @@ dashedName: problem-145-how-many-reversible-numbers-are-there-below-one-billion
# --description--
Some positive integers n have the property that the sum \[ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so 36, 63, 409, and 904 are reversible. Leading zeroes are not allowed in either n or reverse(n).
Alcuni numeri interi positivi $n$ hanno la proprietà che la somma [ $n + reverse(n)$ ] consiste interamente di cifre dispari (decimali). Per esempio, $36 + 63 = 99$ e $409 + 904 = 1313$. Chiameremo tali numeri reversibili; quindi 36, 63, 409 e 904 sono reversibili. Gli zero iniziali non sono ammessi in $n$ o $reverse(n)$.
There are 120 reversible numbers below one-thousand.
Ci sono 120 numeri reversibili sotto il mille.
How many reversible numbers are there below one-billion (109)?
Quanti numeri reversibili ci sono sotto un miliardo (${10}^9$)?
# --hints--
`euler145()` should return 608720.
`reversibleNumbers()` dovrebbe restituire `608720`.
```js
assert.strictEqual(euler145(), 608720);
assert.strictEqual(reversibleNumbers(), 608720);
```
# --seed--
@ -27,12 +27,12 @@ assert.strictEqual(euler145(), 608720);
## --seed-contents--
```js
function euler145() {
function reversibleNumbers() {
return true;
}
euler145();
reversibleNumbers();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fe1000cf542c50ff11
title: 'Problem 146: Investigating a Prime Pattern'
title: 'Problema 146: Indagare un modello di numeri primi'
challengeType: 5
forumTopicId: 301775
dashedName: problem-146-investigating-a-prime-pattern
@ -8,16 +8,16 @@ dashedName: problem-146-investigating-a-prime-pattern
# --description--
The smallest positive integer n for which the numbers n2+1, n2+3, n2+7, n2+9, n2+13, and n2+27 are consecutive primes is 10. The sum of all such integers n below one-million is 1242490.
Il più piccolo intero positivo $n$ per il quale i numeri $n^2 + 1$, $n^2 + 3$, $n^2 + 7$, $n^2 + 9$, $n^2 + 13$, e $n^2 + 27$ sono primi consecutivi è 10. La somma di tutti questi numeri interi $n$ sotto un milione è 1242490.
What is the sum of all such integers n below 150 million?
Qual è la somma di tutti questi numeri interi $n$ sotto 150 milioni?
# --hints--
`euler146()` should return 676333270.
`primePattern()` dovrebbe restituire `676333270`.
```js
assert.strictEqual(euler146(), 676333270);
assert.strictEqual(primePattern(), 676333270);
```
# --seed--
@ -25,12 +25,12 @@ assert.strictEqual(euler146(), 676333270);
## --seed-contents--
```js
function euler146() {
function primePattern() {
return true;
}
euler146();
primePattern();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3ff1000cf542c50ff12
title: 'Problem 147: Rectangles in cross-hatched grids'
title: 'Problema 147: Rettangoli in griglie a tratteggi incrociati'
challengeType: 5
forumTopicId: 301776
dashedName: problem-147-rectangles-in-cross-hatched-grids
@ -8,20 +8,24 @@ dashedName: problem-147-rectangles-in-cross-hatched-grids
# --description--
In a 3x2 cross-hatched grid, a total of 37 different rectangles could be situated within that grid as indicated in the sketch.
In una griglia 3x2 a tratteggi incrociati, un totale di 37 rettangoli diversi potrebbe essere situato all'interno di tale griglia come indicato nel disegno.
There are 5 grids smaller than 3x2, vertical and horizontal dimensions being important, i.e. 1x1, 2x1, 3x1, 1x2 and 2x2. If each of them is cross-hatched, the following number of different rectangles could be situated within those smaller grids: 1x1: 1 2x1: 4 3x1: 8 1x2: 4 2x2: 18
<img class="img-responsive center-block" alt="modi di posizionare diversi rettangoli all'interno di una griglia 3x2 a tratteggio incrociato" src="https://cdn.freecodecamp.org/curriculum/project-euler/rectangles-in-cross-hatched-grids.png" style="background-color: white; padding: 10px;" />
Adding those to the 37 of the 3x2 grid, a total of 72 different rectangles could be situated within 3x2 and smaller grids.
Ci sono 5 griglie più piccole di 3x2, le dimensioni verticali e orizzontali sono importanti, cioè 1x1, 2x1, 3x1, 1x2 e 2x2. Se ciascuno di essi è a tratteggio incrociato, il seguente numero di rettangoli diversi potrebbe essere situato all'interno di tali griglie più piccole:
How many different rectangles could be situated within 47x43 and smaller grids?
$$\begin{array}{|c|c|} \hline 1 \times 1 & 1 \\\\ \hline 2 \times 1 & 4 \\\\ \hline 3 \times 1 & 8 \\\\ \hline 1 \times 2 & 4 \\\\ \hline 2 \times 2 & 18 \\\\ \hline \end{array}$$
Aggiungendo questi ai 37 della griglia 3x2, un totale di 72 diversi rettangoli potrebbe essere situato all'interno della 3x2 e delle griglie più piccole.
Quanti rettangoli diversi potrebbero essere situati entro una griglia 47x43 e griglie più piccole?
# --hints--
`euler147()` should return 846910284.
`crossHatchedRectangles()` dovrebbe restituire `846910284`.
```js
assert.strictEqual(euler147(), 846910284);
assert.strictEqual(crossHatchedRectangles(), 846910284);
```
# --seed--
@ -29,12 +33,12 @@ assert.strictEqual(euler147(), 846910284);
## --seed-contents--
```js
function euler147() {
function crossHatchedRectangles() {
return true;
}
euler147();
crossHatchedRectangles();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4021000cf542c50ff14
title: 'Problem 148: Exploring Pascal''s triangle'
title: 'Problema 148: Esplorare il triangolo di Pascal'
challengeType: 5
forumTopicId: 301777
dashedName: problem-148-exploring-pascals-triangle
@ -8,9 +8,9 @@ dashedName: problem-148-exploring-pascals-triangle
# --description--
We can easily verify that none of the entries in the first seven rows of Pascal's triangle are divisible by 7:
Possiamo facilmente verificare che nessuna delle voci nelle prime sette righe del triangolo di Pascal è divisibile per 7:
<pre>
```
1
1 1
1 2 1
@ -18,20 +18,20 @@ We can easily verify that none of the entries in the first seven rows of Pascal'
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
</pre>
```
However, if we check the first one hundred rows, we will find that only 2361 of the 5050 entries are not divisible by 7.
Tuttavia, se controlliamo le prime cento righe, scopriremo che solo 2361 delle 5050 voci non sono divisibili per 7.
# --instructions--
Find the number of entries which are not divisible by 7 in the first one billion (10<sup>9</sup>) rows of Pascal's triangle.
Trova il numero di voci che non sono divisibili per 7 nel primo miliardo di righe (${10}^9$) del triangolo di Pascal.
# --hints--
`euler148()` should return 2129970655314432.
`entriesOfPascalsTriangle()` dovrebbe restituire `2129970655314432`.
```js
assert.strictEqual(euler148(), 2129970655314432);
assert.strictEqual(entriesOfPascalsTriangle(), 2129970655314432);
```
# --seed--
@ -39,12 +39,12 @@ assert.strictEqual(euler148(), 2129970655314432);
## --seed-contents--
```js
function euler148() {
function entriesOfPascalsTriangle() {
return true;
}
euler148();
entriesOfPascalsTriangle();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4021000cf542c50ff13
title: 'Problem 149: Searching for a maximum-sum subsequence'
title: 'Problema 149: Ricerca di una sequenza a somma massima'
challengeType: 5
forumTopicId: 301778
dashedName: problem-149-searching-for-a-maximum-sum-subsequence
@ -8,28 +8,30 @@ dashedName: problem-149-searching-for-a-maximum-sum-subsequence
# --description--
Looking at the table below, it is easy to verify that the maximum possible sum of adjacent numbers in any direction (horizontal, vertical, diagonal or anti-diagonal) is 16 (= 8 + 7 + 1).
Guardando la tabella sotto, è facile verificare che la somma massima possibile di numeri adiacenti in qualsiasi direzione (orizzontale, verticale, diagonale o anti-diagonale) è di $16 (= 8 + 7 + 1)$.
253296513273184 8
$$\begin{array}{|r|r|r|r|} \hline 2 & 5 & 3 & 2 \\\\ \hline 9 & 6 & 5 & 1 \\\\ \hline 3 & 2 & 7 & 3 \\\\ \hline 1 & 8 & 4 & 8 \\\\ \hline \end{array}$$
Now, let us repeat the search, but on a much larger scale:
Ora ripetiamo la ricerca, ma su una scala molto più grande:
First, generate four million pseudo-random numbers using a specific form of what is known as a "Lagged Fibonacci Generator":
In primo luogo, generare quattro milioni di numeri pseudo-casuali utilizzando una forma specifica di quello che è noto come "Lagged Fibonacci Generator":
For 1 ≤ k ≤ 55, sk = \[100003 200003k + 300007k3] (modulo 1000000) 500000. For 56 ≤ k ≤ 4000000, sk = \[sk24 + sk55 + 1000000] (modulo 1000000) 500000.
Per $1 ≤ k ≤ 55$, $s_k = (100003 200003k + 300007{k}^3) \\ (modulo\\ 1000000) 500000$.
Thus, s10 = 393027 and s100 = 86613.
Per $56 ≤ k ≤ 4000000$, $s_k = (s_{k 24} + s_{k 55} + 1000000) \\ (modulo\\ 1000000) 500000$.
The terms of s are then arranged in a 2000×2000 table, using the first 2000 numbers to fill the first row (sequentially), the next 2000 numbers to fill the second row, and so on.
Così, $s_{10} = 393027$ e $s_{100} = 86613$.
Finally, find the greatest sum of (any number of) adjacent entries in any direction (horizontal, vertical, diagonal or anti-diagonal).
I termini di $s$ sono poi disposti in una tabella 2000×2000, usando i primi 2000 numeri per riempire la prima riga (sequenzialmente), i prossimi 2000 numeri per riempire la seconda riga, e così via.
Infine, trova la più grande somma di (qualsiasi numero di) voci adiacenti in qualsiasi direzione (orizzontale, verticale, diagonale o anti-diagonale).
# --hints--
`euler149()` should return 52852124.
`maximumSubSequence()` dovrebbe restituire `52852124`.
```js
assert.strictEqual(euler149(), 52852124);
assert.strictEqual(maximumSubSequence(), 52852124);
```
# --seed--
@ -37,12 +39,12 @@ assert.strictEqual(euler149(), 52852124);
## --seed-contents--
```js
function euler149() {
function maximumSubSequence() {
return true;
}
euler149();
maximumSubSequence();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4031000cf542c50ff15
title: >-
Problem 150: Searching a triangular array for a sub-triangle having minimum-sum
Problema 150: Ricerca di una matrice triangolare per un subtriangolo con somma minima
challengeType: 5
forumTopicId: 301781
dashedName: problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum
@ -9,32 +9,34 @@ dashedName: problem-150-searching-a-triangular-array-for-a-sub-triangle-having-m
# --description--
In a triangular array of positive and negative integers, we wish to find a sub-triangle such that the sum of the numbers it contains is the smallest possible.
In una serie triangolare di numeri interi positivi e negativi, desideriamo trovare un subtriangolo in modo che la somma dei numeri che contiene sia la più piccola possibile.
In the example below, it can be easily verified that the marked triangle satisfies this condition having a sum of 42.
Nell'esempio sottostante si può facilmente verificare che il triangolo marcato soddisfi questa condizione con una somma di 42.
We wish to make such a triangular array with one thousand rows, so we generate 500500 pseudo-random numbers sk in the range ±219, using a type of random number generator (known as a Linear Congruential Generator) as follows: t := 0
<img class="img-responsive center-block" alt="array triangolare, con subtriangolo marcato, avente una somma di -42" src="https://cdn.freecodecamp.org/curriculum/project-euler/searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum.gif" style="background-color: white; padding: 10px;" />
for k = 1 up to k = 500500:
Vogliamo creare una tale matrice triangolare con mille righe, in modo da generare 500500 numeri pseudo-casuali $s_k$ nel range $±2^{19}$, utilizzando un tipo di generatore di numeri casuali (noto come generatore di elementi costitutivi lineari) come segue:
t := (615949\*t + 797807) modulo 220 sk := t219 Thus: s1 = 273519, s2 = 153582, s3 = 450905 etc Our triangular array is then formed using the pseudo-random numbers thus:
$$\begin{align} t := & \\ 0\\\\ \text{for}\\ & k = 1\\ \text{up to}\\ k = 500500:\\\\ & t := (615949 × t + 797807)\\ \text{modulo}\\ 2^{20}\\\\ & s_k := t 219\\\\ \end{align}$$
s1 s2 s3 s4 s5 s6
Thus: $s_1 = 273519$, $s_2 = 153582$, $s_3 = 450905$ etc.
s7 s8 s9 s10 ...
La nostra matrice triangolare è poi formata utilizzando i numeri pseudo-casuali in questo modo:
Sub-triangles can start at any element of the array and extend down as far as we like (taking-in the two elements directly below it from the next row, the three elements directly below from the row after that, and so on).
$$ s_1 \\\\ s_2\\;s_3 \\\\ s_4\\; s_5\\; s_6 \\\\ s_7\\; s_8\\; s_9\\; s_{10} \\\\ \ldots $$
The "sum of a sub-triangle" is defined as the sum of all the elements it contains.
I sub-triangoli possono iniziare da qualsiasi elemento dell'array ed estendersi quanto vogliamo (prendendo i due elementi direttamente sotto di esso dalla riga successiva, i tre elementi direttamente al di sotto dalla riga successiva, e così via).
Find the smallest possible sub-triangle sum.
La "somma di un subtriangolo" è definita come la somma di tutti gli elementi che contiene.
Trova la somma subtriangolare più piccola possibile.
# --hints--
`euler150()` should return -271248680.
`smallestSubTriangleSum()` dovrebbe restituire `-271248680`.
```js
assert.strictEqual(euler150(), -271248680);
assert.strictEqual(smallestSubTriangleSum(), -271248680);
```
# --seed--
@ -42,12 +44,12 @@ assert.strictEqual(euler150(), -271248680);
## --seed-contents--
```js
function euler150() {
function smallestSubTriangleSum() {
return true;
}
euler150();
smallestSubTriangleSum();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4031000cf542c50ff16
title: 'Problem 151: Paper sheets of standard sizes: an expected-value problem'
title: 'Problema 151: fogli di carta di dimensioni standard: un problema di valore atteso'
challengeType: 5
forumTopicId: 301782
dashedName: problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem
@ -8,22 +8,28 @@ dashedName: problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem
# --description--
A printing shop runs 16 batches (jobs) every week and each batch requires a sheet of special colour-proofing paper of size A5.
Un negozio di stampa esegue 16 lotti (lavori) ogni settimana e ogni lotto richiede un foglio di carta speciale per la prova del colore di dimensione A5.
Every Monday morning, the foreman opens a new envelope, containing a large sheet of the special paper with size A1.
Ogni lunedì mattina, il caposquadra apre una nuova busta, contenente un grande foglio di carta speciale di formato A1.
He proceeds to cut it in half, thus getting two sheets of size A2. Then he cuts one of them in half to get two sheets of size A3 and so on until he obtains the A5-size sheet needed for the first batch of the week.
Prosegue tagliandolo a metà, ottenendo così due fogli di formato A2. Poi taglia uno di loro a metà per ottenere due fogli di formato A3 e così via fino a quando ottiene il foglio di formato A5 necessario per il primo lotto della settimana.
All the unused sheets are placed back in the envelope.
Tutti i fogli inutilizzati sono riposizionati nella busta.
At the beginning of each subsequent batch, he takes from the envelope one sheet of paper at random. If it is of size A5, he uses it. If it is larger, he repeats the 'cut-in-half' procedure until he has what he needs and any remaining sheets are always placed back in the envelope. Excluding the first and last batch of the week, find the expected number of times (during each week) that the foreman finds a single sheet of paper in the envelope. Give your answer rounded to six decimal places using the format x.xxxxxx .
<img class="img-responsive center-block" alt="Foglio formato A1 diviso in: A2, A3, A4 e due fogli A5" src="https://cdn.freecodecamp.org/curriculum/project-euler/paper-sheets-of-standard-sizes-an-expected-value-problem.png" style="background-color: white; padding: 10px;" />
All'inizio di ogni lotto successivo, prende un foglio di carta dalla busta a caso. Se è di dimensioni A5, lo usa. Se è più grande, ripete la procedura "taglia a metà" fino a quando non ha quello di cui ha bisogno, e tutti i fogli rimanenti sono sempre riposti nella busta.
Escluso il primo e lultimo lotto della settimana, trovare il numero previsto di volte (nel corso di ogni settimana) in cui il caposquadra trova un unico foglio di carta nella busta.
Dare la risposta arrotondata a sei decimali utilizzando il formato `x.xxxxxx`.
# --hints--
`euler151()` should return 0.464399.
`expectedValueProblem()` dovrebbe restituire `0.464399`.
```js
assert.strictEqual(euler151(), 0.464399);
assert.strictEqual(expectedValueProblem(), 0.464399);
```
# --seed--
@ -31,12 +37,12 @@ assert.strictEqual(euler151(), 0.464399);
## --seed-contents--
```js
function euler151() {
function expectedValueProblem() {
return true;
}
euler151();
expectedValueProblem();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4041000cf542c50ff17
title: 'Problem 152: Writing one half as a sum of inverse squares'
title: 'Problema 152: Scrittura di un mezzo come somma di quadrati inversi'
challengeType: 5
forumTopicId: 301783
dashedName: problem-152-writing-one-half-as-a-sum-of-inverse-squares
@ -8,18 +8,22 @@ dashedName: problem-152-writing-one-half-as-a-sum-of-inverse-squares
# --description--
There are several ways to write the number 1/2 as a sum of inverse squares using distinct integers.
Ci sono diversi modi per scrivere il numero $\frac{1}{2}$ come somma di quadrati inversi utilizzando numeri interi distinti.
For instance, the numbers {2,3,4,5,7,12,15,20,28,35} can be used:
Per esempio, possono essere utilizzati i numeri {2,3,4,5,7,12,15,20,28,35}:
In fact, only using integers between 2 and 45 inclusive, there are exactly three ways to do it, the remaining two being: {2,3,4,6,7,9,10,20,28,35,36,45} and {2,3,4,6,7,9,12,15,28,30,35,36,45}. How many ways are there to write the number 1/2 as a sum of inverse squares using distinct integers between 2 and 80 inclusive?
$$\frac{1}{2} = \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \frac{1}{5^2} + \frac{1}{7^2} + \frac{1}{{12}^2} + \frac{1}{{15}^2} + \frac{1}{{20}^2} + \frac{1}{{28}^2} + \frac{1}{{35}^2}$$
Infatti, utilizzando solo interi compresi tra 2 e 45 inclusi, ci sono esattamente tre modi per farlo, i restanti due essendo: {2,3,4,6,7,9,10,20,28,35,36,45} e {2,3,4,6,7,9,12,15,28,30,35,36,45}.
Quanti modi ci sono per scrivere il numero $\frac{1}{2}$ come somma di quadrati inversi utilizzando numeri interi distinti tra 2 e 80 inclusi?
# --hints--
`euler152()` should return 301.
`sumInverseSquares()` dovrebbe restituire `301`.
```js
assert.strictEqual(euler152(), 301);
assert.strictEqual(sumInverseSquares(), 301);
```
# --seed--
@ -27,12 +31,12 @@ assert.strictEqual(euler152(), 301);
## --seed-contents--
```js
function euler152() {
function sumInverseSquares() {
return true;
}
euler152();
sumInverseSquares();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4051000cf542c50ff18
title: 'Problem 153: Investigating Gaussian Integers'
title: 'Problema 153: Indagare sugli interi Gaussiani'
challengeType: 5
forumTopicId: 301784
dashedName: problem-153-investigating-gaussian-integers
@ -8,46 +8,60 @@ dashedName: problem-153-investigating-gaussian-integers
# --description--
As we all know the equation x2=-1 has no solutions for real x.
Come tutti sappiamo l'equazione $x^2 = -1$ non ha soluzioni per $x$ reale.
If we however introduce the imaginary number i this equation has two solutions: x=i and x=-i.
Se però introduciamo il numero immaginario $i$ questa equazione ha due soluzioni: $x = i$ e $x = -i$.
If we go a step further the equation (x-3)2=-4 has two complex solutions: x=3+2i and x=3-2i. x=3+2i and x=3-2i are called each others' complex conjugate.
Se andiamo oltre l'equazione ${(x - 3)}^2 = -4$ ha due soluzioni complesse: $x = 3 + 2i$ e $x = 3 - 2i$, che sono chiamati l'uno il complesso coniugato dell'altro.
Numbers of the form a+bi are called complex numbers.
I numeri del tipo $a + bi$ sono chiamati numeri complessi.
In general a+bi and abi are each other's complex conjugate. A Gaussian Integer is a complex number a+bi such that both a and b are integers.
In generale $a + bi$ e $a bi$ sono l'uno il complesso coniugato dell'altro. Un intero Gaussiano è un numero complesso $a + bi$ tale che sia $a$ che $b$ siano interi.
The regular integers are also Gaussian integers (with b=0).
Gli interi regolari sono anche interi gaussiani (con $b = 0$).
To distinguish them from Gaussian integers with b ≠ 0 we call such integers "rational integers."
Per distinguerli dagli interi gaussiani con $b ≠ 0$ chiamiamo tali interi "interi razionali"
A Gaussian integer is called a divisor of a rational integer n if the result is also a Gaussian integer.
Un intero gaussiano è chiamato divisore di un intero razionale $n$ se il risultato è anche un intero gaussiano.
If for example we divide 5 by 1+2i we can simplify in the following manner:
Se, ad esempio, dividiamo 5 per $1 + 2i$ possiamo semplificare nel modo seguente:
Multiply numerator and denominator by the complex conjugate of 1+2i: 12i.
Moltiplicare numeratore e denominatore per il complesso coniugato di $1 + 2i$: $1 2i$.
The result is .
Il risultato è:
So 1+2i is a divisor of 5.
$$\frac{5}{1 + 2i} = \frac{5}{1 + 2i} \frac{1 - 2i}{1 - 2i} = \frac{5(1 - 2i)}{1 - {(2i)}^2} = \frac{5(1 - 2i)}{1 - (-4)} = \frac{5(1 - 2i)}{5} = 1 - 2i$$
Note that 1+i is not a divisor of 5 because .
Così $1 + 2i$ è un divisore di 5.
Note also that if the Gaussian Integer (a+bi) is a divisor of a rational integer n, then its complex conjugate (abi) is also a divisor of n. In fact, 5 has six divisors such that the real part is positive: {1, 1 + 2i, 1 2i, 2 + i, 2 i, 5}.
Si noti che $1 + i$ non è un divisore di 5 perché:
The following is a table of all of the divisors for the first five positive rational integers:
$$\frac{5}{1 + i} = \frac{5}{2} - \frac{5}{2}i$$
n Gaussian integer divisors with positive real partSum s(n) of these
Nota anche che se l'intero gaussiano ($a + bi$) è un divisore di un intero razionale $n$, allora il suo complesso coniugato ($a bi$) è anch'esso un divisore di $n$. Infatti, 5 ha sei divisori la cui parte reale è positiva: {1, 1 + 2i, 1 - 2i, 2 + i, 2 - i, 5}.
divisors111 21, 1+i, 1-i, 25 31, 34 41, 1+i, 1-i, 2, 2+2i, 2-2i,413 51, 1+2i, 1-2i, 2+i, 2-i, 512 For divisors with positive real parts, then, we have: . For 1 ≤ n ≤ 105, ∑ s(n)=17924657155. What is ∑ s(n) for 1 ≤ n ≤ 108?
La seguente è una tabella di tutti i divisori per i primi cinque interi razionali positivi:
| n | Divisori interi gaussiani con parte reale positiva | Somma s(n) di questi divisori |
| - | -------------------------------------------------- | ----------------------------- |
| 1 | 1 | 1 |
| 2 | 1, 1 + i, 1 - i, 2 | 5 |
| 3 | 1, 3 | 4 |
| 4 | 1, 1 + i, 1 - i, 2, 2 + 2i, 2 - 2i, 4 | 13 |
| 5 | 1, 1 + 2i, 1 - 2i, 2 + i, 2 - i, 5 | 12 |
Per i divisori con parti reali positive, poi, abbiamo: $\displaystyle\sum_{n=1}^5 s(n) = 35$.
Per $1 ≤ n ≤ {10}^5$, $\displaystyle\sum_{n = 1}^{{10}^5} s(n) = 17924657155$.
Cos'è $\displaystyle\sum_{n=1}^{{10}^8} s(n)$?
# --hints--
`euler153()` should return 17971254122360636.
`sumGaussianIntegers()` dovrebbe restituire `17971254122360636`.
```js
assert.strictEqual(euler153(), 17971254122360636);
assert.strictEqual(sumGaussianIntegers(), 17971254122360636);
```
# --seed--
@ -55,12 +69,12 @@ assert.strictEqual(euler153(), 17971254122360636);
## --seed-contents--
```js
function euler153() {
function sumGaussianIntegers() {
return true;
}
euler153();
sumGaussianIntegers();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4071000cf542c50ff19
title: 'Problem 154: Exploring Pascal''s pyramid'
title: 'Problema 154: Esplorare la piramide di Pascal'
challengeType: 5
forumTopicId: 301785
dashedName: problem-154-exploring-pascals-pyramid
@ -8,16 +8,22 @@ dashedName: problem-154-exploring-pascals-pyramid
# --description--
A triangular pyramid is constructed using spherical balls so that each ball rests on exactly three balls of the next lower level.
Una piramide triangolare è costruita utilizzando palline sferiche in modo che ogni sfera poggi esattamente su tre palline del livello inferiore.
Then, we calculate the number of paths leading from the apex to each position: A path starts at the apex and progresses downwards to any of the three spheres directly below the current position. Consequently, the number of paths to reach a certain position is the sum of the numbers immediately above it (depending on the position, there are up to three numbers above it). The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion (x + y + z)n. How many coefficients in the expansion of (x + y + z)200000 are multiples of 1012?
<img class="img-responsive center-block" alt="piramide triangolare costruita con palline sferiche a quattro livelli" src="https://cdn.freecodecamp.org/curriculum/project-euler/exploring-pascals-pyramid.png" style="background-color: white; padding: 10px;" />
Poi calcoliamo il numero di percorsi che conducono dall'apice a ogni posizione: un percorso inizia all'apice e procede verso il basso in una qualsiasi delle tre sfere direttamente al di sotto della posizione attuale. Di conseguenza, il numero di percorsi per raggiungere una certa posizione è la somma dei numeri immediatamente sopra di esso (a seconda della posizione, ci sono fino a tre numeri sopra di esso).
Il risultato è la piramide di Pascal, e i numeri a ogni livello n sono i coefficienti dell'espansione trinomiale ${(x + y + z)}^n$.
Quanti coefficienti nell'espansione di ${(x + y + z)}^{200000}$ sono multipli di ${10}^{12}$?
# --hints--
`euler154()` should return 479742450.
`pascalsPyramid()` dovrebbe restituire `479742450`.
```js
assert.strictEqual(euler154(), 479742450);
assert.strictEqual(pascalsPyramid(), 479742450);
```
# --seed--
@ -25,12 +31,12 @@ assert.strictEqual(euler154(), 479742450);
## --seed-contents--
```js
function euler154() {
function pascalsPyramid() {
return true;
}
euler154();
pascalsPyramid();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4081000cf542c50ff1a
title: 'Problem 155: Counting Capacitor Circuits'
title: 'Problema 155: Contando i circuiti dei condensatori'
challengeType: 5
forumTopicId: 301786
dashedName: problem-155-counting-capacitor-circuits
@ -8,20 +8,26 @@ dashedName: problem-155-counting-capacitor-circuits
# --description--
An electric circuit uses exclusively identical capacitors of the same value C.
Un circuito elettrico usa solo condensatori identici dello stesso valore C.
The capacitors can be connected in series or in parallel to form sub-units, which can then be connected in series or in parallel with other capacitors or other sub-units to form larger sub-units, and so on up to a final circuit. Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values:
I condensatori possono essere collegati in serie o in parallelo per formare sub-unità, le quali poi possono essere collegate in serie o in parallelo ad altri capacitori o altre sub unità per formare sub unità più grandi, e così via fino al circuito finale.
If we denote by D(n) the number of distinct total capacitance values we can obtain when using up to n equal-valued capacitors and the simple procedure described above, we have: D(1)=1, D(2)=3, D(3)=7 ... Find D(18). Reminder : When connecting capacitors C1, C2 etc in parallel, the total capacitance is CT = C1 + C2 +...,
Usando questa semplice procedura e fino a n condensatori identici, possiamo creare circuiti che hanno un range di diverse capacitanze totali. Per esempio, usando fino a $n = 3$ condensatori di $60 μF$ ognuno, possiamo ottenere sette valori totali di capacitanza distinti:
whereas when connecting them in series, the overall capacitance is given by:
<img class="img-responsive center-block" alt="circuito di esempio avente fino a tre condensatori, ognuno di 60 μF" src="https://cdn.freecodecamp.org/curriculum/project-euler/counting-capacitor-circuits.gif" style="background-color: white; padding: 10px;" />
Sia $D(n)$ il numero di valori di capacitanza distinti totali che si possono ottenere con $n$ condensatori di uguale capacitanza e la semplice procedura descritta sopra, abbiamo: $D(1) = 1, D(2) = 3, D(3) = 7, \ldots$
Trova $D(18)$.
Promemoria: Quando si connettono i condensatori $C_1$, $C_2$ ecc in parallelo, la capacitanza totale è $C_T = C_1 + C_2 + \cdots$, mentre quando si connettono in serie, la capacitanza totale è data da: $\frac{1}{C_T} = \frac{1}{C_1} + \frac{1}{C_2} + \cdots$.
# --hints--
`euler155()` should return 3857447.
`capacitanceValues()` dovrebbe restituire `3857447`.
```js
assert.strictEqual(euler155(), 3857447);
assert.strictEqual(capacitanceValues(), 3857447);
```
# --seed--
@ -29,12 +35,12 @@ assert.strictEqual(euler155(), 3857447);
## --seed-contents--
```js
function euler155() {
function capacitanceValues() {
return true;
}
euler155();
capacitanceValues();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4091000cf542c50ff1b
title: 'Problem 156: Counting Digits'
title: 'Problema 156: Contare le cifre'
challengeType: 5
forumTopicId: 301787
dashedName: problem-156-counting-digits
@ -8,28 +8,44 @@ dashedName: problem-156-counting-digits
# --description--
Starting from zero the natural numbers are written down in base 10 like this:
A partire da zero i numeri naturali sono scritti in base 10 in questo modo:
0 1 2 3 4 5 6 7 8 9 10 11 12....
Consider the digit d=1. After we write down each number n, we will update the number of ones that have occurred and call this number f(n,1). The first values for f(n,1), then, are as follows:
Considera la cifra $d = 1$. Dopo aver annotato ogni numero n, aggiorneremo il numero di uno che si sono verificati e chiameremo questo numero $f(n, 1)$. I primi valori per $f(n, 1)$, quindi, sono i seguenti:
nf(n,1) 00 11 21 31 41 51 61 71 81 91 102 114 125
| $n$ | $f(n, 1)$ |
| --- | --------- |
| 0 | 0 |
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 5 | 1 |
| 6 | 1 |
| 7 | 1 |
| 8 | 1 |
| 9 | 1 |
| 10 | 2 |
| 11 | 4 |
| 12 | 5 |
Note that f(n,1) never equals 3.
Nota che $f(n, 1)$ non è mai uguale a 3.
So the first two solutions of the equation f(n,1)=n are n=0 and n=1. The next solution is n=199981. In the same manner the function f(n,d) gives the total number of digits d that have been written down after the number n has been written.
Quindi le prime due soluzioni dell'equazione $f(n, 1) = n$ sono $n = 0$ e $n = 1$. La soluzione successiva è $n = 199981$. Allo stesso modo la funzione $f(n, d)$ dà il numero totale di cifre d che sono state scritte dopo che il numero $n$ è stato scritto.
In fact, for every digit d ≠ 0, 0 is the first solution of the equation f(n,d)=n. Let s(d) be the sum of all the solutions for which f(n,d)=n.
Infatti, per ogni cifra $d =0$, 0 è la prima soluzione dell'equazione $f(n, d) = n$. Sia $s(d)$ sia la somma di tutte le soluzioni per le quali $f(n, d) = n$.
You are given that s(1)=22786974071. Find ∑ s(d) for 1 ≤ d ≤ 9. Note: if, for some n, f(n,d)=n for more than one value of d this value of n is counted again for every value of d for which f(n,d)=n.
Dato $s(1) = 22786974071$. Trova $\sum{s(d)}$ per $1 ≤ d ≤ 9$.
Nota: se, per alcuni $n$, $f(n, d) = n$ per più di un valore di $d$ questo valore di $n$ è contato di nuovo per ogni valore di $d$ per il quale $f(n, d) = n$.
# --hints--
`euler156()` should return 21295121502550.
`countingDigits()` dovrebbe restituire `21295121502550`.
```js
assert.strictEqual(euler156(), 21295121502550);
assert.strictEqual(countingDigits(), 21295121502550);
```
# --seed--
@ -37,12 +53,12 @@ assert.strictEqual(euler156(), 21295121502550);
## --seed-contents--
```js
function euler156() {
function countingDigits() {
return true;
}
euler156();
countingDigits();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4091000cf542c50ff1c
title: 'Problem 157: Solving the diophantine equation'
title: 'Problema 157: Risolvere l''equazione diofantina'
challengeType: 5
forumTopicId: 301788
dashedName: problem-157-solving-the-diophantine-equation
@ -8,58 +8,20 @@ dashedName: problem-157-solving-the-diophantine-equation
# --description--
Consider the diophantine equation 1/a+1/b= p/10n with a, b, p, n positive integers and a ≤ b.
Considera l'equazione diofantina $\frac{1}{a} + \frac{1}{b} = \frac{p}{{10}^n}$ con $a$, $b$, $p$, $n$ interi positivi e $a ≤ b$.
For n=1 this equation has 20 solutions that are listed below:
Per $n = 1$ questa equazione ha 20 soluzioni che sono elencate di seguito:
1/1+1/1=20/10
$$\begin{array}{lllll} \frac{1}{1} + \frac{1}{1} = \frac{20}{10} & \frac{1}{1} + \frac{1}{2} = \frac{15}{10} & \frac{1}{1} + \frac{1}{5} = \frac{12}{10} & \frac{1}{1} + \frac{1}{10} = \frac{11}{10} & \frac{1}{2} + \frac{1}{2} = \frac{10}{10} \\\\ \frac{1}{2} + \frac{1}{5} = \frac{7}{10} & \frac{1}{2} + \frac{1}{10} = \frac{6}{10} & \frac{1}{3} + \frac{1}{6} = \frac{5}{10} & \frac{1}{3} + \frac{1}{15} = \frac{4}{10} & \frac{1}{4} + \frac{1}{4} = \frac{5}{10} \\\\ \frac{1}{4} + \frac{1}{4} = \frac{5}{10} & \frac{1}{5} + \frac{1}{5} = \frac{4}{10} & \frac{1}{5} + \frac{1}{10} = \frac{3}{10} & \frac{1}{6} + \frac{1}{30} = \frac{2}{10} & \frac{1}{10} + \frac{1}{10} = \frac{2}{10} \\\\ \frac{1}{11} + \frac{1}{110} = \frac{1}{10} & \frac{1}{12} + \frac{1}{60} = \frac{1}{10} & \frac{1}{14} + \frac{1}{35} = \frac{1}{10} & \frac{1}{15} + \frac{1}{30} = \frac{1}{10} & \frac{1}{20} + \frac{1}{20} = \frac{1}{10} \end{array}$$
1/1+1/2=15/10
1/1+1/5=12/10
1/1+1/10=11/10
1/2+1/2=10/10
1/2+1/5=7/10
1/2+1/10=6/10
1/3+1/6=5/10
1/3+1/15=4/10
1/4+1/4=5/10
1/4+1/20=3/10
1/5+1/5=4/10
1/5+1/10=3/10
1/6+1/30=2/10
1/10+1/10=2/10
1/11+1/110=1/10
1/12+1/60=1/10
1/14+1/35=1/10
1/15+1/30=1/10
1/20+1/20=1/10
How many solutions has this equation for 1 ≤ n ≤ 9?
Quante soluzioni ha questa equazione per $1 ≤ n ≤ 9$?
# --hints--
`euler157()` should return 53490.
`diophantineEquation()` dovrebbe restituire `53490`.
```js
assert.strictEqual(euler157(), 53490);
assert.strictEqual(diophantineEquation(), 53490);
```
# --seed--
@ -67,12 +29,12 @@ assert.strictEqual(euler157(), 53490);
## --seed-contents--
```js
function euler157() {
function diophantineEquation() {
return true;
}
euler157();
diophantineEquation();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f40a1000cf542c50ff1d
title: >-
Problem 158: Exploring strings for which only one character comes lexicographically after its neighbour to the left
Problema 158: Esplorare le stringhe per le quali un solo carattere viene lessicograficamente dopo il suo vicino a sinistra
challengeType: 5
forumTopicId: 301789
dashedName: >-
@ -10,28 +10,28 @@ dashedName: >-
# --description--
Taking three different letters from the 26 letters of the alphabet, character strings of length three can be formed.
Prendendo tre lettere diverse dalle 26 lettere dell'alfabeto, si possono formare stringhe di caratteri di lunghezza tre.
Examples are 'abc', 'hat' and 'zyx'.
Esempi sono 'abc', 'hat' e 'zyx'.
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
Quando studiamo questi tre esempi vediamo che per 'abc' due caratteri vengono lessicograficamente dopo il loro vicino a sinistra.
For 'hat' there is exactly one character that comes lexicographically after its neighbour to the left. For 'zyx' there are zero characters that come lexicographically after its neighbour to the left.
Per 'hat' c'è esattamente un carattere che viene lessicograficamente dopo il suo vicino a sinistra. Per 'zyx' ci sono zero caratteri che vengono lessicograficamente dopo il loro vicino a sinistra.
In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbour to the left.
In tutto ci sono 10400 stringhe di lunghezza 3 per le quali esattamente un carattere viene lessicograficamente dopo il suo vicino a sinistra.
We now consider strings of n ≤ 26 different characters from the alphabet.
Ora consideriamo stringhe di $n ≤ 26$ caratteri diversi dell'alfabeto.
For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left.
Per ogni $n$, $p(n)$ è il numero di stringhe di lunghezza $n$ per cui esattamente un carattere viene lessicograficamente dopo il suo vicino a sinistra.
What is the maximum value of p(n)?
Qual è il valore massimo di $p(n)$?
# --hints--
`euler158()` should return 409511334375.
`lexicographicNeighbours()` dovrebbe tornare `409511334375`.
```js
assert.strictEqual(euler158(), 409511334375);
assert.strictEqual(lexicographicNeighbours(), 409511334375);
```
# --seed--
@ -39,12 +39,12 @@ assert.strictEqual(euler158(), 409511334375);
## --seed-contents--
```js
function euler158() {
function lexicographicNeighbours() {
return true;
}
euler158();
lexicographicNeighbours();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f40c1000cf542c50ff1e
title: 'Problem 159: Digital root sums of factorisations'
title: 'Problema 159: Somma di radici numeriche di fattorizzazione'
challengeType: 5
forumTopicId: 301790
dashedName: problem-159-digital-root-sums-of-factorisations
@ -8,17 +8,33 @@ dashedName: problem-159-digital-root-sums-of-factorisations
# --description--
A composite number can be factored many different ways.
Un numero composito può essere fattorizzato in molti modi diversi.
For instance, not including multiplication by one, 24 can be factored in 7 distinct ways:
Per esempio, senza includere la moltiplicazione per 1, 24 può essere fattorizzato in 7 modi distinti:
24 = 2x2x2x3 24 = 2x3x4 24 = 2x2x6 24 = 4x6 24 = 3x8 24 = 2x12 24 = 24
$$\begin{align} & 24 = 2 \times 2 \times 2 \times 3\\\\ & 24 = 2 \times 3 \times 4 \\\\ & 24 = 2 \times 2 \times 6 \\\\ & 24 = 4 \times 6 \\\\ & 24 = 3 \times 8 \\\\ & 24 = 2 \times 12 \\\\ & 24 = 24 \end{align}$$
Recall that the digital root of a number, in base 10, is found by adding together the digits of that number, and repeating that process until a number is arrived at that is less than 10. Thus the digital root of 467 is 8. We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number. The chart below demonstrates all of the DRS values for 24. FactorisationDigital Root Sum2x2x2x3 92x3x4 92x2x6 104x6 103x8 112x12 524 6The maximum Digital Root Sum of 24 is 11. The function mdrs(n) gives the maximum Digital Root Sum of n. So mdrs(24)=11. Find ∑mdrs(n) for 1 &lt; n &lt; 1,000,000.
Ricordati che le radice numerica di un numero, in base 10, si trova sommando le cifre del numero e ripetendo il processo fino a che il risultato non è inferiore a 10. Quindi la radice numerica di 467 è 8.
Sia la Digital Root Sum (DRS) la somma delle radici numeriche dei fattori individuali dei nostri numeri. La tabella sotto mostra tutti i valori DRS di 24.
| Fattorizzazione | DRS |
| --------------- | --- |
| 2x2x2x3 | 9 |
| 2x3x4 | 9 |
| 2x2x6 | 10 |
| 4x6 | 10 |
| 3x8 | 11 |
| 2x12 | 5 |
| 24 | 6 |
La DRS più grande di 24 è 11. La funzione $mdrs(n)$ restituisce il massimo DRS di $n$. Quindi $mdrs(24) = 11$.
Trova $\sum{mdrs(n)}$ per $1 &lt; n &lt; 1 000 000$.
# --hints--
`euler159()` should return 14489159.
`euler159()` dovrebbe restituire `14489159`.
```js
assert.strictEqual(euler159(), 14489159);

View File

@ -1,6 +1,6 @@
---
id: 5900f40d1000cf542c50ff1f
title: 'Problem 160: Factorial trailing digits'
title: 'Problema 160: Cifre finali dei fattoriali'
challengeType: 5
forumTopicId: 301794
dashedName: problem-160-factorial-trailing-digits
@ -8,24 +8,20 @@ dashedName: problem-160-factorial-trailing-digits
# --description--
For any N, let f(N) be the last five digits before the trailing zeroes in N!.
Per ogni $N$, $f(N)$ rappresenti le ultime cinque cifre prima degli zero finali in $N!$.
For example,
Ad esempio,
9! = 362880 so f(9)=36288
$$\begin{align} & 9! = 362880 \\; \text{so} \\; f(9) = 36288 \\\\ & 10! = 3628800 \\; \text{so} \\; f(10) = 36288 \\\\ & 20! = 2432902008176640000 \\; \text{so} \\; f(20) = 17664 \end{align}$$
10! = 3628800 so f(10)=36288
20! = 2432902008176640000 so f(20)=17664
Find f(1,000,000,000,000)
Trova $f(1,000,000,000,000)$
# --hints--
`euler160()` should return 16576.
`factorialTrailingDigits()` dovrebbe restituire `16576`.
```js
assert.strictEqual(euler160(), 16576);
assert.strictEqual(factorialTrailingDigits(), 16576);
```
# --seed--
@ -33,12 +29,12 @@ assert.strictEqual(euler160(), 16576);
## --seed-contents--
```js
function euler160() {
function factorialTrailingDigits() {
return true;
}
euler160();
factorialTrailingDigits();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f40d1000cf542c50ff20
title: 'Problem 161: Triominoes'
title: 'Problema 161: Triomini'
challengeType: 5
forumTopicId: 301795
dashedName: problem-161-triominoes
@ -8,22 +8,28 @@ dashedName: problem-161-triominoes
# --description--
A triomino is a shape consisting of three squares joined via the edges.
Un triomino è una figura che consiste di tre quadrati uniti per i lati.
There are two basic forms:
Ci sono due forme base:
If all possible orientations are taken into account there are six:
<img class="img-responsive center-block" alt="le due forme base dei triomini" src="https://cdn.freecodecamp.org/curriculum/project-euler/triominoes-1.gif" style="background-color: white; padding: 10px;" />
Any n by m grid for which nxm is divisible by 3 can be tiled with triominoes. If we consider tilings that can be obtained by reflection or rotation from another tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:
Se consideriamo tutte le possibili orientazioni allora ce ne sono sei:
In how many ways can a 9 by 12 grid be tiled in this way by triominoes?
<img class="img-responsive center-block" alt="le forme dei triomini includendo l'orientazione" src="https://cdn.freecodecamp.org/curriculum/project-euler/triominoes-2.gif" style="background-color: white; padding: 10px;" />
Ogni griglia n per m in cui nxm è divisibile per 3 può essere riempita di triomini. Se consideriamo il riempimento che può essere ottenuto come riflessione o rotazione di un altro riempimento come diverso allora ci sono 41 modi diversi per riempire una griglia 2 per 9 con dei triomini:
<img class="img-responsive center-block" alt="una animazione mostrante i 41 modi per riempire una griglia 9x2 con i triomini" src="https://cdn.freecodecamp.org/curriculum/project-euler/triominoes-3.gif" style="background-color: white; padding: 10px;" />
In quanti modi diversi può essere riempita in questo modo una griglia 9 per 12 con i troimini?
# --hints--
`euler161()` should return 20574308184277972.
`triominoes()` dovrebbe restituire `20574308184277972`.
```js
assert.strictEqual(euler161(), 20574308184277972);
assert.strictEqual(triominoes(), 20574308184277972);
```
# --seed--
@ -31,12 +37,12 @@ assert.strictEqual(euler161(), 20574308184277972);
## --seed-contents--
```js
function euler161() {
function triominoes() {
return true;
}
euler161();
triominoes();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f40e1000cf542c50ff21
title: 'Problem 162: Hexadecimal numbers'
title: 'Problema 162: numeri esadecimali'
challengeType: 5
forumTopicId: 301796
dashedName: problem-162-hexadecimal-numbers
@ -8,28 +8,34 @@ dashedName: problem-162-hexadecimal-numbers
# --description--
In the hexadecimal number system numbers are represented using 16 different digits:
Nel sistema esadecimale I numeri sono rappresentati utilizzando 16 cifre diverse:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
$$0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F$$
The hexadecimal number AF when written in the decimal number system equals 10x16+15=175.
Il numero esadecimale AF quando scritto nel sistema di numeri decimali è pari a $10 \times 16 + 15 = 175$.
In the 3-digit hexadecimal numbers 10A, 1A0, A10, and A01 the digits 0,1 and A are all present.
Nei numeri esadecimali a 3 cifre 10A, 1A0, A10 e A01 sono presenti tutte le cifre 0,1 e A.
Like numbers written in base ten we write hexadecimal numbers without leading zeroes.
Come i numeri scritti nella base dieci scriviamo i numeri esadecimali senza zeri iniziali.
How many hexadecimal numbers containing at most sixteen hexadecimal digits exist with all of the digits 0,1, and A present at least once?
Quanti numeri esadecimali contenenti al massimo sedici cifre esadecimali esistono con tutte le cifre 0,1, e A presenti almeno una volta?
Give your answer as a hexadecimal number.
Dai la tua risposta con un numero esadecimale come una stringa.
(A,B,C,D,E and F in upper case, without any leading or trailing code that marks the number as hexadecimal and without leading zeroes , e.g. 1A3F and not: 1a3f and not 0x1a3f and not $1A3F and not #1A3F and not 0000001A3F)
**Nota:** (A,B,C,D,E e F in maiuscolo, senza alcun codice iniziale o finale che contrassegna il numero come esadecimale e senza zeri iniziali, cioè 1A3F e non: 1a3f e non 0x1a3f e $1A3F e non #1A3F e non 0000001A3F)
# --hints--
`euler162()` should return 3D58725572C62302.
`hexadecimalNumbers()` dovrebbe restituire una stringa.
```js
assert.strictEqual(euler162(), '3D58725572C62302');
assert(typeof hexadecimalNumbers() === 'string');
```
`hexadecimalNumbers()` dovrebbe restituire la stringa `3D58725572C62302`.
```js
assert.strictEqual(hexadecimalNumbers(), '3D58725572C62302');
```
# --seed--
@ -37,12 +43,12 @@ assert.strictEqual(euler162(), '3D58725572C62302');
## --seed-contents--
```js
function euler162() {
function hexadecimalNumbers() {
return true;
}
euler162();
hexadecimalNumbers();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f40f1000cf542c50ff22
title: 'Problem 163: Cross-hatched triangles'
title: 'Problema 163: Triangoli incrociati'
challengeType: 5
forumTopicId: 301797
dashedName: problem-163-cross-hatched-triangles
@ -8,16 +8,26 @@ dashedName: problem-163-cross-hatched-triangles
# --description--
Consider an equilateral triangle in which straight lines are drawn from each vertex to the middle of the opposite side, such as in the size 1 triangle in the sketch below.
Considera un triangolo equilatero in cui delle linee sono disegnate da ogni vertice alla metà del lato opposto, come nel triangolo di dimensione 1 nel disegno qua sotto.
Sixteen triangles of either different shape or size or orientation or location can now be observed in that triangle. Using size 1 triangles as building blocks, larger triangles can be formed, such as the size 2 triangle in the above sketch. One-hundred and four triangles of either different shape or size or orientation or location can now be observed in that size 2 triangle. It can be observed that the size 2 triangle contains 4 size 1 triangle building blocks. A size 3 triangle would contain 9 size 1 triangle building blocks and a size n triangle would thus contain n2 size 1 triangle building blocks. If we denote T(n) as the number of triangles present in a triangle of size n, then T(1) = 16 T(2) = 104 Find T(36).
<img class="img-responsive center-block" alt="triangoli di dimensione 1 e di dimensione 2" src="https://cdn.freecodecamp.org/curriculum/project-euler/cross-hatched-triangles.gif" style="background-color: white; padding: 10px;" />
Si possono vedere sedici triangoli di diversa forma o orientazione o posizione dentro quel triangolo. Usando i triangoli di dimensione 1 come unità base, si possono formare triangoli più grandi come il triangolo di dimensione due nel disegno sopra. Nel triangolo di dimensione due si possono osservare centoquattro triangolo di diversa dimensione o forma od orientazione o posizione.
Si può vedere che il triangolo di dimensione 2 contiene 4 triangoli di dimensione 1 come unità base. Un triangolo di dimensione tre conterrebbe 9 unità triangolo di dimensione 1, quindi un triangolo di dimensione $n$ conterrebbe $n^2$ triangoli di dimensione 1.
Sia $T(n)$ il numero di triangoli presenti in un triangolo di dimensione $n$, allora
$$\begin{align} & T(1) = 16 \\\\ & T(2) = 104 \end{align}$$
Trova $T(36)$.
# --hints--
`euler163()` should return 343047.
`crossHatchedTriangles()` dovrebbe restituire `343047`.
```js
assert.strictEqual(euler163(), 343047);
assert.strictEqual(crossHatchedTriangles(), 343047);
```
# --seed--
@ -25,12 +35,12 @@ assert.strictEqual(euler163(), 343047);
## --seed-contents--
```js
function euler163() {
function crossHatchedTriangles() {
return true;
}
euler163();
crossHatchedTriangles();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4111000cf542c50ff23
title: >-
Problem 164: Numbers for which no three consecutive digits have a sum greater than a given value
Problema 164: Numeri per i quali nessuna cifra consecutiva ha una somma maggiore di un dato valore
challengeType: 5
forumTopicId: 301798
dashedName: >-
@ -10,14 +10,14 @@ dashedName: >-
# --description--
How many 20 digit numbers n (without any leading zero) exist such that no three consecutive digits of n have a sum greater than 9?
Quanti numeri di 20 cifre $n$ (senza nessuno zero iniziale) esistono in modo tale che nessun gruppo di tre cifre consecutive di $n$ abbia una somma maggiore di 9?
# --hints--
`euler164()` should return 378158756814587.
`consecutiveDigitsSum()` dovrebbe restituire `378158756814587`.
```js
assert.strictEqual(euler164(), 378158756814587);
assert.strictEqual(consecutiveDigitsSum(), 378158756814587);
```
# --seed--
@ -25,12 +25,12 @@ assert.strictEqual(euler164(), 378158756814587);
## --seed-contents--
```js
function euler164() {
function consecutiveDigitsSum() {
return true;
}
euler164();
consecutiveDigitsSum();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4111000cf542c50ff24
title: 'Problem 165: Intersections'
title: 'Problema 165: intersezioni'
challengeType: 5
forumTopicId: 301799
dashedName: problem-165-intersections
@ -8,22 +8,36 @@ dashedName: problem-165-intersections
# --description--
A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
Un segmento è definito unicamente dai punti terminali. Considerando due segmenti in un piano geometrico ci sono tre possibilità: i due segmenti hanno zero punti, un punto, o infiniti punti in comune.
the segments have zero points, one point, or infinitely many points in common.
In più quando i due segmenti hanno esattamente un punto in comune potrebbe essere che questo sia un terminale di uno o entrambi i segmenti. Se un punto in comune dei due segmenti non è un punto terminale di nessuno dei due allora è un punto interno di entrambi i segnmenti.
Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
Sia $T$, un punto in comune di due segmenti $L_1$ e $L_2$, un vero punto d'intersezione se è il solo punto in comune di $L_1$ e $L_2$ ed è un punto interno di entrambi i segmenti.
We will call a common point T of two segments L1 and L2 a true intersection point of L1 and L2 if T is the only common point of L1 and L2 and T is an interior point of both segments.
Considera i tre segmenti $L_1$, $L_2$, e $L_3$:
Consider the three segments L1, L2, and L3: L1: (27, 44) to (12, 32) L2: (46, 53) to (17, 62) L3: (46, 70) to (22, 40) It can be verified that line segments L2 and L3 have a true intersection point. We note that as the one of the end points of L3: (22,40) lies on L1 this is not considered to be a true point of intersection. L1 and L2 have no common point. So among the three line segments, we find one true intersection point. Now let us do the same for 5000 line segments. To this end, we generate 20000 numbers using the so-called "Blum Blum Shub" pseudo-random number generator. s0 = 290797 sn+1 = sn×sn (modulo 50515093) tn = sn (modulo 500) To create each line segment, we use four consecutive numbers tn. That is, the first line segment is given by: (t1, t2) to (t3, t4) The first four numbers computed according to the above generator should be: 27, 144, 12 and 232. The first segment would thus be (27,144) to (12,232). How many distinct true intersection points are found among the 5000 line segments?
$$\begin{align} & L_1: (27, 44) \\;\text{to}\\; (12, 32) \\\\ & L_2: (46, 53) \\;\text{to}\\; (17, 62) \\\\ & L_3: (46, 70) \\;\text{to}\\; (22, 40) \\\\ \end{align}$$
Si può verificare che i segmenti $L_2$ e $L_3$ hanno un vero punto di intersezione. Notiamo che essendo uno dei terminali di $L_3$: (22, 40) su $L_1$ questo non è un vero punto d'intersezione. $L_1$ e $L_2$ non hanno un punto in comune. Quindi tra i tre segmenti troviamo un vero punto di intersezione.
Adesso facciamo lo stesso per 5000 segmenti. A questo fine, generiamo 20000 numeri casuali usando il generatore pseudo-casuale di numeri chiamato "Blum Blum Shub".
$$\begin{align} & s_0 = 290797 \\\\ & s_{n + 1} = s_n × s_n (\text{modulo}\\; 50515093) \\\\ & t_n = s_n (\text{modulo}\\; 500) \\\\ \end{align}$$
Per creare ogni segmento, usiamo quattro numeri consecutivi $t_n$. Quindi, il primo segmento è dato da:
da ($_t$1, $t_2$) a ($t_3$, $t_4$)
I primi quattro numeri calcolati con il precedente generatore dovrebbero essere: 27, 144, 12 e 232. Quindi il primo segnmento è da (27, 144) a (12, 232).
Quante intersezioni vere sono trovate tra i 5000 segmenti?
# --hints--
`euler165()` should return 2868868.
`distinctIntersections()` should return `2868868`.
```js
assert.strictEqual(euler165(), 2868868);
assert.strictEqual(distinctIntersections(), 2868868);
```
# --seed--
@ -31,12 +45,12 @@ assert.strictEqual(euler165(), 2868868);
## --seed-contents--
```js
function euler165() {
function distinctIntersections() {
return true;
}
euler165();
distinctIntersections();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4131000cf542c50ff25
title: 'Problem 166: Criss Cross'
title: 'Problema 166: Criss Cross'
challengeType: 5
forumTopicId: 301800
dashedName: problem-166-criss-cross
@ -8,22 +8,22 @@ dashedName: problem-166-criss-cross
# --description--
A 4x4 grid is filled with digits d, 0 ≤ d ≤ 9.
Una griglia 4x4 è riempita con cifre $d$, $0 ≤ d ≤ 9$.
It can be seen that in the grid
Si può vedere che nella griglia
6 3 3 0 5 0 4 3 0 7 1 4 1 2 4 5
$$\begin{array}{} 6 & 3 & 3 & 0 \\\\ 5 & 0 & 4 & 3 \\\\ 0 & 7 & 1 & 4 \\\\ 1 & 2 & 4 & 5 \end{array}$$
the sum of each row and each column has the value 12. Moreover the sum of each diagonal is also 12.
la somma di ciascuna riga e di ciascuna colonna ha il valore 12. Inoltre la somma di ogni diagonale è anch'essa 12.
In how many ways can you fill a 4x4 grid with the digits d, 0 ≤ d ≤ 9 so that each row, each column, and both diagonals have the same sum?
In quanti modi puoi riempire una griglia 4x4 con le cifre $d$, $0 ≤ d ≤ 9$ in modo che ogni riga, ogni colonna ed entrambe le diagonali abbiano la stessa somma?
# --hints--
`euler166()` should return 7130034.
`crissCross()` dovrebbe restituire `7130034`.
```js
assert.strictEqual(euler166(), 7130034);
assert.strictEqual(crissCross(), 7130034);
```
# --seed--
@ -31,12 +31,12 @@ assert.strictEqual(euler166(), 7130034);
## --seed-contents--
```js
function euler166() {
function crissCross() {
return true;
}
euler166();
crissCross();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4141000cf542c50ff26
title: 'Problem 167: Investigating Ulam sequences'
title: 'Problema 167: Indagare le sequenze di Ulam'
challengeType: 5
forumTopicId: 301801
dashedName: problem-167-investigating-ulam-sequences
@ -8,24 +8,22 @@ dashedName: problem-167-investigating-ulam-sequences
# --description--
For two positive integers a and b, the Ulam sequence U(a,b) is defined by U(a,b)1 = a, U(a,b)2 = b and for k > 2,
Per due interi positivi $a$ e $b$, la successione di Ulam $U(a,b)$ è definita da ${U{(a,b)}\_1} = a$, ${U{(a,b)}\_2} = b$ e per $k > 2$, ${U{(a,b)}\_k}$ è il più piccolo numero intero maggiore di ${U{(a,b)}\_{(k-1)}}$ che può essere scritto esattamente in un modo come la somma di due membri precedenti distinti di $U(a,b)$.
U(a,b)k is the smallest integer greater than U(a,b)(k-1) which can be written in exactly one way as the sum of two distinct previous members of U(a,b).
Ad esempio, la successione $U(1,2)$ inizia con
For example, the sequence U(1,2) begins with
$$1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2 + 4, 8 = 2 + 6, 11 = 3 + 8$$
1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2 + 4, 8 = 2 + 6, 11 = 3 + 8;
5 non appartiene ad esso perché $5 = 1 + 4 = 2 + 3$ ha due rappresentazioni come la somma di due membri precedenti, così come $7 = 1 + 6 = 3 + 4$.
5 does not belong to it because 5 = 1 + 4 = 2 + 3 has two representations as the sum of two previous members, likewise 7 = 1 + 6 = 3 + 4.
Find ∑U(2,2n+1)k for 2 ≤ n ≤10, where k = 1011.
Trova $\sum {U(2, 2n + 1)_k}$ per $2 ≤ n ≤ 10$, dove $k = {10}^{11}$.
# --hints--
`euler167()` should return 3916160068885.
`ulamSequences()` dovrebbe restituire `3916160068885`.
```js
assert.strictEqual(euler167(), 3916160068885);
assert.strictEqual(ulamSequences(), 3916160068885);
```
# --seed--
@ -33,12 +31,12 @@ assert.strictEqual(euler167(), 3916160068885);
## --seed-contents--
```js
function euler167() {
function ulamSequences() {
return true;
}
euler167();
ulamSequences();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4151000cf542c50ff27
title: 'Problem 168: Number Rotations'
title: 'Problema 168: Rotazioni di numeri'
challengeType: 5
forumTopicId: 301802
dashedName: problem-168-number-rotations
@ -8,20 +8,20 @@ dashedName: problem-168-number-rotations
# --description--
Consider the number 142857. We can right-rotate this number by moving the last digit (7) to the front of it, giving us 714285.
Considera il numero 142857. Possiamo ruotare a destra questo numero spostando l'ultima cifra (7) nella parte anteriore, ottenendo 714285.
It can be verified that 714285=5×142857.
Si può verificare che $714285 = 5 × 142857$.
This demonstrates an unusual property of 142857: it is a divisor of its right-rotation.
Ciò dimostra una proprietà insolita del 142857: è un divisore della sua rotazione a destra.
Find the last 5 digits of the sum of all integers n, 10 &lt; n &lt; 10100, that have this property.
Trova le ultime 5 cifre della somma di tutti gli interi $n$, $10 &lt; n &lt; 10100$, che hanno questa proprietà.
# --hints--
`euler168()` should return 59206.
`numberRotations()` dovrebbe restituire `59206`.
```js
assert.strictEqual(euler168(), 59206);
assert.strictEqual(numberRotations(), 59206);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler168(), 59206);
## --seed-contents--
```js
function euler168() {
function numberRotations() {
return true;
}
euler168();
numberRotations();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4151000cf542c50ff28
title: >-
Problem 169: Exploring the number of different ways a number can be expressed as a sum of powers of 2
Problema 169: esplorando il numero di modi diversi in cui un numero può essere espresso come somma delle potenze di 2
challengeType: 5
forumTopicId: 301803
dashedName: >-
@ -10,26 +10,20 @@ dashedName: >-
# --description--
Define f(0)=1 and f(n) to be the number of different ways n can be expressed as a sum of integer powers of 2 using each power no more than twice.
Sia $f(0) = 1$ e sia $f(n)$ il numero di modi diversi in cui $n$ può essere espresso come numero di potenze intere di 2 usando ogni potenza non più di due volte.
For example, f(10)=5 since there are five different ways to express 10:
Per esempio, $f(10)=5$ visto che ci sono cinque modi diversi di esprimere 10:
1 + 1 + 8
$$\begin{align} & 1 + 1 + 8 \\\\ & 1 + 1 + 4 + 4 \\\\ & 1 + 1 + 2 + 2 + 4 \\\\ & 2 + 4 + 4 \\\\ & 2 + 8 \end{align}$$
1 + 1 + 4 + 41 + 1 + 2 + 2 + 4
2 + 4 + 4
2 + 8
What is f(1025)?
Qual è il valore di $f({10}^{25})$?
# --hints--
`euler169()` should return 178653872807.
`numberOfWaysToExpress()` dovrebbe restituire `178653872807`.
```js
assert.strictEqual(euler169(), 178653872807);
assert.strictEqual(numberOfWaysToExpress(), 178653872807);
```
# --seed--
@ -37,12 +31,12 @@ assert.strictEqual(euler169(), 178653872807);
## --seed-contents--
```js
function euler169() {
function numberOfWaysToExpress() {
return true;
}
euler169();
numberOfWaysToExpress();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4161000cf542c50ff29
title: >-
Problem 170: Find the largest 0 to 9 pandigital that can be formed by concatenating products
Problema 170: trova il pandigitale 0-9 più grande che puoi formare concatenando prodotti
challengeType: 5
forumTopicId: 301805
dashedName: >-
@ -10,22 +10,22 @@ dashedName: >-
# --description--
Take the number 6 and multiply it by each of 1273 and 9854:
Prendi il numero 6 e moltiplicalo per 1273 e 9854:
6 × 1273 = 7638 6 × 9854 = 59124
$$\begin{align} & 6 × 1273 = 7638 \\\\ & 6 × 9854 = 59124 \\\\ \end{align}$$
By concatenating these products we get the 1 to 9 pandigital 763859124. We will call 763859124 the "concatenated product of 6 and (1273,9854)". Notice too, that the concatenation of the input numbers, 612739854, is also 1 to 9 pandigital.
Concatenando questi prodotti otteniamo il pandigitale 1-9 763859124. Chiamiamo 763859124 il "prodotto concatenato di 6 e (1273, 9854)". Nota anche, che la concatenazione dei numeri di input, 612739854, è pure un numero pandigitale 1-9.
The same can be done for 0 to 9 pandigital numbers.
Si può fare lo stesso con numeri 0-9 pandigitali.
What is the largest 0 to 9 pandigital 10-digit concatenated product of an integer with two or more other integers, such that the concatenation of the input numbers is also a 0 to 9 pandigital 10-digit number?
Qual è il più grande prodotto concatenato pandigitale 0-9 a 10 cifre di un numero intero con due o più altri numeri interi, cosicché la concatenazione dei numeri di input è pure un numero a 10 cifre pandigitale 0-9?
# --hints--
`euler170()` should return 9857164023.
`largestPandigital()` dovrebbe restituire `9857164023`.
```js
assert.strictEqual(euler170(), 9857164023);
assert.strictEqual(largestPandigital(), 9857164023);
```
# --seed--
@ -33,12 +33,12 @@ assert.strictEqual(euler170(), 9857164023);
## --seed-contents--
```js
function euler170() {
function largestPandigital() {
return true;
}
euler170();
largestPandigital();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4181000cf542c50ff2a
title: >-
Problem 171: Finding numbers for which the sum of the squares of the digits is a square
Problema 171: Trovare numeri per i quali la somma dei quadrati delle cifre è un quadrato
challengeType: 5
forumTopicId: 301806
dashedName: >-
@ -10,22 +10,18 @@ dashedName: >-
# --description--
For a positive integer n, let f(n) be the sum of the squares of the digits (in base 10) of n, e.g.
Per un numero intero positivo $n$, sia $f(n)$ la somma dei quadrati delle cifre (in base 10) di $n$, es.
f(3) = 32 = 9,
$$\begin{align} & f(3) = 3^2 = 9 \\\\ & f(25) = 2^2 + 5^2 = 4 + 25 = 29 \\\\ & f(442) = 4^2 + 4^2 + 2^2 = 16 + 16 + 4 = 36 \\\\ \end{align}$$
f(25) = 22 + 52 = 4 + 25 = 29,
f(442) = 42 + 42 + 22 = 16 + 16 + 4 = 36
Find the last nine digits of the sum of all n, 0 &lt; n &lt; 1020, such that f(n) is a perfect square.
Trova le ultime nove cifre della somma di tutti $n$, $0 &lt; n &lt; {10}^{20}$, tali che $f(n)$ sia un quadrato perfetto.
# --hints--
`euler171()` should return 142989277.
`lastDigitsSumOfPerfectSquare()` dovrebbe restituire `142989277`.
```js
assert.strictEqual(euler171(), 142989277);
assert.strictEqual(lastDigitsSumOfPerfectSquare(), 142989277);
```
# --seed--
@ -33,12 +29,12 @@ assert.strictEqual(euler171(), 142989277);
## --seed-contents--
```js
function euler171() {
function lastDigitsSumOfPerfectSquare() {
return true;
}
euler171();
lastDigitsSumOfPerfectSquare();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4181000cf542c50ff2b
title: 'Problem 172: Investigating numbers with few repeated digits'
title: 'Problema 172: Investigare numeri con alcune cifre ripetute'
challengeType: 5
forumTopicId: 301807
dashedName: problem-172-investigating-numbers-with-few-repeated-digits
@ -8,14 +8,14 @@ dashedName: problem-172-investigating-numbers-with-few-repeated-digits
# --description--
How many 18-digit numbers n (without leading zeros) are there such that no digit occurs more than three times in n?
Quanti numeri a 18 cifre $n$ (senza contare zeri all'inizio del numero) ci sono cosicché nessuna cifra ripete più di tre volte dentro $n$?
# --hints--
`euler172()` should return 227485267000992000.
`numbersWithRepeatedDigits()` dovrebbe restituire `227485267000992000`.
```js
assert.strictEqual(euler172(), 227485267000992000);
assert.strictEqual(numbersWithRepeatedDigits(), 227485267000992000);
```
# --seed--
@ -23,12 +23,12 @@ assert.strictEqual(euler172(), 227485267000992000);
## --seed-contents--
```js
function euler172() {
function numbersWithRepeatedDigits() {
return true;
}
euler172();
numbersWithRepeatedDigits();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f41a1000cf542c50ff2c
title: >-
Problem 173: Using up to one million tiles how many different "hollow" square laminae can be formed?
Problema 173: Utilizzando fino a un milione di piastrelle quante diverse lamine quadrate "cave" possono essere formate?
challengeType: 5
forumTopicId: 301808
dashedName: >-
@ -10,16 +10,18 @@ dashedName: >-
# --description--
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry. For example, using exactly thirty-two square tiles we can form two different square laminae:
Definiremo una lamina quadrata come un contorno quadrato con un "foro" quadrato in modo che la forma possieda simmetria verticale e orizzontale. Ad esempio, utilizzando esattamente trentadue piastrelle quadrate possiamo formare due lamine quadrate differenti:
With one-hundred tiles, and not necessarily using all of the tiles at one time, it is possible to form forty-one different square laminae. Using up to one million tiles how many different square laminae can be formed?
<img class="img-responsive center-block" alt="due lamine quadrate con fori 2x2 e 7x7" src="https://cdn.freecodecamp.org/curriculum/project-euler/using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.gif" style="background-color: white; padding: 10px;" />
Con cento piastrelle, e non necessariamente utilizzando tutte le piastrelle in una sola volta, è possibile formare quarantuno diverse lamine. Utilizzando fino a un milione di piastrelle quante diverse lamine quadrate possono essere formate?
# --hints--
`euler173()` should return 1572729.
`differentHollowSquareLaminae()` dovrebbe restituire `1572729`.
```js
assert.strictEqual(euler173(), 1572729);
assert.strictEqual(differentHollowSquareLaminae(), 1572729);
```
# --seed--
@ -27,12 +29,12 @@ assert.strictEqual(euler173(), 1572729);
## --seed-contents--
```js
function euler173() {
function differentHollowSquareLaminae() {
return true;
}
euler173();
differentHollowSquareLaminae();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f41a1000cf542c50ff2d
title: >-
Problem 174: Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangements
Problema 174: Contare il numero di lamine quadrate "cave" che possono formare uno, due, tre, ... disposizioni distinte
challengeType: 5
forumTopicId: 301809
dashedName: >-
@ -10,18 +10,24 @@ dashedName: >-
# --description--
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry.
Definiremo una lamina quadrata come un contorno quadrato con un "foro" quadrato in modo che la forma possieda simmetria verticale e orizzontale.
Given eight tiles it is possible to form a lamina in only one way: 3x3 square with a 1x1 hole in the middle. However, using thirty-two tiles it is possible to form two distinct laminae.
Date otto piastrelle è possibile formare una lamina in un solo modo: quadrato 3x3 con un foro 1x1 nel mezzo. Tuttavia, utilizzando trentadue piastrelle è possibile formare due lamine distinte.
If t represents the number of tiles used, we shall say that t = 8 is type L(1) and t = 32 is type L(2). Let N(n) be the number of t ≤ 1000000 such that t is type L(n); for example, N(15) = 832. What is ∑ N(n) for 1 ≤ n ≤ 10?
<img class="img-responsive center-block" alt="due lamine quadrate con fori 2x2 e 7x7" src="https://cdn.freecodecamp.org/curriculum/project-euler/using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.gif" style="background-color: white; padding: 10px;" />
Se $t$ rappresenta il numero di piastrelle utilizzate, diremo che $t = 8$ è di tipo $L(1)$ e $t = 32$ è di tipo $L(2)$.
Lascia che $N(n)$ sia il numero di $t ≤ 1000000$ in modo che $t$ sia di tipo $L(n)$; per esempio, $N(15) = 832$.
Qual è $\sum N(n)$ per $1 ≤ n ≤ 10$?
# --hints--
`euler174()` should return 209566.
`hollowSquareLaminaeDistinctArrangements()` dovrebbe restituire `209566`.
```js
assert.strictEqual(euler174(), 209566);
assert.strictEqual(hollowSquareLaminaeDistinctArrangements(), 209566);
```
# --seed--
@ -29,12 +35,12 @@ assert.strictEqual(euler174(), 209566);
## --seed-contents--
```js
function euler174() {
function hollowSquareLaminaeDistinctArrangements() {
return true;
}
euler174();
hollowSquareLaminaeDistinctArrangements();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f41c1000cf542c50ff2e
title: >-
Problem 175: Fractions involving the number of different ways a number can be expressed as a sum of powers of 2
Problema 175: Frazioni che implicano il numero di modi diversi in cui un numero può essere espresso come una somma di potenze di 2
challengeType: 5
forumTopicId: 301810
dashedName: >-
@ -10,18 +10,36 @@ dashedName: >-
# --description--
Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice.
Definisci $f(0) = 1$ e $f(n)$ in modo che sia il numero di modi per scrivere $n$ come una somma di potenze di 2 nessuna delle quali si verifica più di due volte.
For example, f(10)=5 since there are five different ways to express 10:10 = 8+2 = 8+1+1 = 4+4+2 = 4+2+2+1+1 = 4+4+1+1
Per esempio, $f(10) = 5$ poiché ci sono cinque modi diversi per esprimere 10:
It can be shown that for every fraction p/q (p>0, q>0) there exists at least one integer n such that f(n)/f(n-1)=p/q. For instance, the smallest n for which f(n)/f(n-1)=13/17 is 241. The binary expansion of 241 is 11110001. Reading this binary number from the most significant bit to the least significant bit there are 4 one's, 3 zeroes and 1 one. We shall call the string 4,3,1 the Shortened Binary Expansion of 241. Find the Shortened Binary Expansion of the smallest n for which f(n)/f(n-1)=123456789/987654321. Give your answer as comma separated integers, without any whitespaces.
$$10 = 8 + 2 = 8 + 1 + 1 = 4 + 4 + 2 = 4 + 2 + 2 + 1 + 1 = 4 + 4 + 1 + 1$$
Si può dimostrare che per ogni frazione $\frac{p}{q}\\; (p>0, q>0)$ esiste almeno un numero intero $n$ tale che $\frac{f(n)}{f(n - 1)} = \frac{p}{q}$.
Per esempio, il più piccolo $n$ per il quale $\frac{f(n)}{f(n - 1)} = \frac{13}{17}$ è 241. L'espansione binaria di 241 è 11110001.
Leggendo questo numero binario dal bit più significativo al bit meno significativo ci sono 4 uno, 3 zero e 1 uno. Chiameremo la stringa 4,3,1 l'espansione binaria abbreviata di 241.
Trova l'espansione binaria abbreviata del più piccolo $n$ per cui
$$\frac{f(n)}{f(n - 1)} = \frac{123456789}{987654321}$$
Dai la tua risposta sotto forma di una stringa con interi separati da virgola, senza spazi bianchi.
# --hints--
`euler175()` should return 1, 13717420, 8.
`shortenedBinaryExpansionOfNumber()` dovrebbe restituire una stringa.
```js
assert.strictEqual(euler175(), 1, 13717420, 8);
assert(typeof shortenedBinaryExpansionOfNumber() === 'string');
```
`shortenedBinaryExpansionOfNumber()` dovrebbe restituire la stringa `1,13717420,8`.
```js
assert.strictEqual(shortenedBinaryExpansionOfNumber(), '1,13717420,8');
```
# --seed--
@ -29,12 +47,12 @@ assert.strictEqual(euler175(), 1, 13717420, 8);
## --seed-contents--
```js
function euler175() {
function shortenedBinaryExpansionOfNumber() {
return true;
}
euler175();
shortenedBinaryExpansionOfNumber();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f41c1000cf542c50ff2f
title: 'Problem 176: Right-angled triangles that share a cathetus'
title: 'Problema 176: Triangoli ad angolo retto che condividono un cateto'
challengeType: 5
forumTopicId: 301811
dashedName: problem-176-right-angled-triangles-that-share-a-cathetus
@ -8,16 +8,16 @@ dashedName: problem-176-right-angled-triangles-that-share-a-cathetus
# --description--
The four right-angled triangles with sides (9,12,15), (12,16,20), (5,12,13) and (12,35,37) all have one of the shorter sides (catheti) equal to 12. It can be shown that no other integer sided right-angled triangle exists with one of the catheti equal to 12.
I quattro triangoli rettangoli con lati (9,12,15), (12,16,20), (5,12,13) e (12,35,37) hanno tutti uno dei lati più corti (cateti) pari a 12. Può essere dimostrato che non esiste un altro triangolo rettangolo di lati interi con uno dei cateti pari a 12.
Find the smallest integer that can be the length of a cathetus of exactly 47547 different integer sided right-angled triangles.
Trova il numero intero più piccolo che può essere la lunghezza di un cateto di esattamente 47547 diversi triangoli rettangoli con lati interi.
# --hints--
`euler176()` should return 96818198400000.
`trianglesSharingCathetus()` dovrebbe restituire `96818198400000`.
```js
assert.strictEqual(euler176(), 96818198400000);
assert.strictEqual(trianglesSharingCathetus(), 96818198400000);
```
# --seed--
@ -25,12 +25,12 @@ assert.strictEqual(euler176(), 96818198400000);
## --seed-contents--
```js
function euler176() {
function trianglesSharingCathetus() {
return true;
}
euler176();
trianglesSharingCathetus();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f41e1000cf542c50ff30
title: 'Problem 177: Integer angled Quadrilaterals'
title: 'Problema 177: Quadrilaterali ad angolo intero'
challengeType: 5
forumTopicId: 301812
dashedName: problem-177-integer-angled-quadrilaterals
@ -8,16 +8,24 @@ dashedName: problem-177-integer-angled-quadrilaterals
# --description--
Let ABCD be a convex quadrilateral, with diagonals AC and BD. At each vertex the diagonal makes an angle with each of the two sides, creating eight corner angles.
Lasciate che ABCD sia un quadrilatero convesso, con diagonali AC e BD. Ad ogni vertice la diagonale fa un angolo con ciascuno dei due lati, creando otto angoli angolari.
For example, at vertex A, the two angles are CAD, CAB. We call such a quadrilateral for which all eight corner angles have integer values when measured in degrees an "integer angled quadrilateral". An example of an integer angled quadrilateral is a square, where all eight corner angles are 45°. Another example is given by DAC = 20°, BAC = 60°, ABD = 50°, CBD = 30°, BCA = 40°, DCA = 30°, CDB = 80°, ADB = 50°. What is the total number of non-similar integer angled quadrilaterals? Note: In your calculations you may assume that a calculated angle is integral if it is within a tolerance of 10-9 of an integer value.
<img class="img-responsive center-block" alt="quadrilatero convesso ABCD, con diagonali AC e BD" src="https://cdn.freecodecamp.org/curriculum/project-euler/integer-angled-quadrilaterals.gif" style="background-color: white; padding: 10px;" />
Ad esempio, al vertice A, i due angoli sono CAD, CAB.
Chiamiamo "quadrilatero ad angoli interi" un quadrilatero per il quale tutti gli otto angoli hanno valori interi se misurati in gradi. Un esempio di quadrilatero ad angoli interi è un quadrato dove tutti gli otto angoli sono 45°. Un altro esempio è dato da DAC = 20°, BAC = 60°, ABD = 50°, CBD = 30°, BCA = 40°, DCA = 30°, CDB = 80°, ADB = 50°.
Qual è il numero totale di quadrilateri ad angoli interi non simili?
**Nota:** Nei tuoi calcoli potresti presumere che un angolo calcolato abbia valore intero se è entro una tolleranza di ${10}^{-9}$ di un valore intero.
# --hints--
`euler177()` should return 129325.
`integerAngledQuadrilaterals()` dovrebbe restituire `129325`.
```js
assert.strictEqual(euler177(), 129325);
assert.strictEqual(integerAngledQuadrilaterals(), 129325);
```
# --seed--
@ -25,12 +33,12 @@ assert.strictEqual(euler177(), 129325);
## --seed-contents--
```js
function euler177() {
function integerAngledQuadrilaterals() {
return true;
}
euler177();
integerAngledQuadrilaterals();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f41e1000cf542c50ff31
title: 'Problem 178: Step Numbers'
title: 'Problema 178: passo dei numeri'
challengeType: 5
forumTopicId: 301813
dashedName: problem-178-step-numbers
@ -8,22 +8,22 @@ dashedName: problem-178-step-numbers
# --description--
Consider the number 45656.
Considera il numero 45656.
It can be seen that each pair of consecutive digits of 45656 has a difference of one.
Si può vedere che ogni coppia di cifre consecutive di 45656 ha una differenza di uno.
A number for which every pair of consecutive digits has a difference of one is called a step number.
Un numero per cui ogni coppia di cifre consecutive ha una differenza di uno è chiamato numero di passo.
A pandigital number contains every decimal digit from 0 to 9 at least once.
Un numero pandigitale contiene ogni cifra decimale da 0 a 9 almeno una volta.
How many pandigital step numbers less than 1040 are there?
Quanti numeri di passaggio pandigitali inferiori a ${10}^{40}$ ci sono?
# --hints--
`euler178()` should return 126461847755.
`stepNumbers()` dovrebbe restituire `126461847755`.
```js
assert.strictEqual(euler178(), 126461847755);
assert.strictEqual(stepNumbers(), 126461847755);
```
# --seed--
@ -31,12 +31,12 @@ assert.strictEqual(euler178(), 126461847755);
## --seed-contents--
```js
function euler178() {
function stepNumbers() {
return true;
}
euler178();
stepNumbers();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f41f1000cf542c50ff32
title: 'Problem 179: Consecutive positive divisors'
title: 'Problema 179: divisori consecutivi positivi'
challengeType: 5
forumTopicId: 301814
dashedName: problem-179-consecutive-positive-divisors
@ -8,14 +8,14 @@ dashedName: problem-179-consecutive-positive-divisors
# --description--
Find the number of integers 1 &lt; n &lt; 107, for which n and n + 1 have the same number of positive divisors. For example, 14 has the positive divisors 1, 2, 7, 14 while 15 has 1, 3, 5, 15.
Trova il numero di interi $1 &lt; n &lt; {10}^7$, per cui $n$ e $n + 1$ hanno lo stesso numero di divisori positivi. Per esempio, 14 ha i divisori positivi 1, 2, 7, 14, mentre 15 ha 1, 3, 5, 15.
# --hints--
`euler179()` should return 986262.
`consecutivePositiveDivisors()` dovrebbe restituire `986262`.
```js
assert.strictEqual(euler179(), 986262);
assert.strictEqual(consecutivePositiveDivisors(), 986262);
```
# --seed--
@ -23,12 +23,12 @@ assert.strictEqual(euler179(), 986262);
## --seed-contents--
```js
function euler179() {
function consecutivePositiveDivisors() {
return true;
}
euler179();
consecutivePositiveDivisors();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4201000cf542c50ff33
title: 'Problem 180: Rational zeros of a function of three variables'
title: 'Problema 180: Zeri razionali di una funzione di tre variabili'
challengeType: 5
forumTopicId: 301816
dashedName: problem-180-rational-zeros-of-a-function-of-three-variables
@ -8,30 +8,28 @@ dashedName: problem-180-rational-zeros-of-a-function-of-three-variables
# --description--
For any integer n, consider the three functions
Per qualsiasi intero $n$, considera le tre funzioni
f1,n(x,y,z) = xn+1 + yn+1 zn+1f2,n(x,y,z) = (xy + yz + zx)\*(xn-1 + yn-1 zn-1)f3,n(x,y,z) = xyz\*(xn-2 + yn-2 zn-2)
$$\begin{align} & f_{1,n}(x,y,z) = x^{n + 1} + y^{n + 1} z^{n + 1}\\\\ & f_{2,n}(x,y,z) = (xy + yz + zx) \times (x^{n - 1} + y^{n - 1} z^{n - 1})\\\\ & f_{3,n}(x,y,z) = xyz \times (x^{n - 2} + y^{n - 2} z^{n - 2}) \end{align}$$
and their combination
e la loro combinazione
fn(x,y,z) = f1,n(x,y,z) + f2,n(x,y,z) f3,n(x,y,z)
$$\begin{align} & f_n(x,y,z) = f_{1,n}(x,y,z) + f_{2,n}(x,y,z) f_{3,n}(x,y,z) \end{align}$$
We call (x,y,z) a golden triple of order k if x, y, and z are all rational numbers of the form a / b with
Chiamiamo $(x,y,z)$ una tripletta d'oro di ordine $k$ se $x$, $y$, e $z$ sono tutti i numeri razionali nella forma $\frac{a}{b}$ con $0 &lt; a &lt; b ≤ k$ e c'è (almeno) un intero $n$, tale che $f_n(x,y,z) = 0$.
0 &lt; a &lt; b ≤ k and there is (at least) one integer n, so that fn(x,y,z) = 0.
Sia $s(x,y,z) = x + y + z$.
Let s(x,y,z) = x + y + z.
Sia $t = \frac{u}{v}$ la somma di tutti i distinti $s(x,y,z)$ per tutte le triplette d'oro $(x,y,z)$ di ordine 35. Tutti i $s(x,y,z)$ e $t$ devono essere in forma ridotta.
Let t = u / v be the sum of all distinct s(x,y,z) for all golden triples (x,y,z) of order 35. All the s(x,y,z) and t must be in reduced form.
Find u + v.
Trova $u + v$.
# --hints--
`euler180()` should return 285196020571078980.
`rationalZeros()` dovrebbe restituire `285196020571078980`.
```js
assert.strictEqual(euler180(), 285196020571078980);
assert.strictEqual(rationalZeros(), 285196020571078980);
```
# --seed--
@ -39,12 +37,12 @@ assert.strictEqual(euler180(), 285196020571078980);
## --seed-contents--
```js
function euler180() {
function rationalZeros() {
return true;
}
euler180();
rationalZeros();
```
# --solutions--

View File

@ -1,7 +1,7 @@
---
id: 5900f4231000cf542c50ff34
title: >-
Problem 181: Investigating in how many ways objects of two different colours can be grouped
Problema 181: Indagare in quanti modi possono essere raggruppati oggetti di due colori diversi
challengeType: 5
forumTopicId: 301817
dashedName: >-
@ -10,20 +10,18 @@ dashedName: >-
# --description--
Having three black objects B and one white object W they can be grouped in 7 ways like this:
Dati tre oggetti neri $B$ e un oggetto bianco $W$, essi possono essere raggruppati in 7 modi:
(BBBW)(B,BBW)(B,B,BW)(B,B,B,W)
$$(BBBW)\\;(B,BBW)\\;(B,B,BW)\\;(B,B,B,W)\\;(B,BB,W)\\;(BBB,W)\\;(BB,BW)$$
(B,BB,W)(BBB,W)(BB,BW)
In how many ways can sixty black objects B and forty white objects W be thus grouped?
In quanti modi possono essere raggruppati sessanta oggetti neri $B$ e quaranta oggetti bianchi $W$?
# --hints--
`euler181()` should return 83735848679360670.
`colorsGrouping()` dovrebbe restituire `83735848679360670`.
```js
assert.strictEqual(euler181(), 83735848679360670);
assert.strictEqual(colorsGrouping(), 83735848679360670);
```
# --seed--
@ -31,12 +29,12 @@ assert.strictEqual(euler181(), 83735848679360670);
## --seed-contents--
```js
function euler181() {
function colorsGrouping() {
return true;
}
euler181();
colorsGrouping();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4231000cf542c50ff35
title: 'Problem 182: RSA encryption'
title: 'Problema 182: Crittografia RSA'
challengeType: 5
forumTopicId: 301818
dashedName: problem-182-rsa-encryption
@ -8,47 +8,47 @@ dashedName: problem-182-rsa-encryption
# --description--
The RSA encryption is based on the following procedure:
La crittografia RSA si basa sulla seguente procedura:
Generate two distinct primes `p` and `q`. Compute `n=p*q` and `φ=(p-1)(q-1)`. Find an integer `e`, `1 < e < φ`, such that `gcd(e,φ) = 1`
Genera due primi distinti `p` e `q`. Calcola `n=p*q` e `φ=(p-1)(q-1)`. Trova un numero intero `e`, `1 < e < φ`, in modo che `MCD(e,φ) = 1`
A message in this system is a number in the interval `[0,n-1]`. A text to be encrypted is then somehow converted to messages (numbers in the interval `[0,n-1]`). To encrypt the text, for each message, `m`, c=m<sup>e</sup> mod n is calculated.
Un messaggio in questo sistema è un numero nell'intervallo `[0,n-1]`. Un testo da cifrare viene quindi convertito in qualche modo in messaggi (numeri nell'intervallo `[0,n-1]`). Per cifrare il testo, per ogni messaggio `m` si calcola c=m<sup>e</sup> mod n.
To decrypt the text, the following procedure is needed: calculate `d` such that `ed=1 mod φ`, then for each encrypted message, `c`, calculate m=c<sup>d</sup> mod n.
Per decifrare il testo, è necessaria la seguente procedura: calcola `d` in modo che `ed=1 mod φ`, quindi per ogni messaggio cifrato `c`, calcola m=c<sup>d</sup> mod n.
There exist values of `e` and `m` such that m<sup>e</sup> mod n = m. We call messages `m` for which m<sup>e</sup> mod n=m unconcealed messages.
Esistono valori di `e` e `m` tali che m<sup>e</sup> mod n = m. Chiamiamo i messaggi `m` per i quali m<sup>e</sup> mod n=m messaggi non nascosti.
An issue when choosing `e` is that there should not be too many unconcealed messages. For instance, let `p=19` and `q=37`. Then `n=19*37=703` and `φ=18*36=648`. If we choose `e=181`, then, although `gcd(181,648)=1` it turns out that all possible messages m `(0≤m≤n-1)` are unconcealed when calculating m<sup>e</sup> mod n. For any valid choice of `e` there exist some unconcealed messages. It's important that the number of unconcealed messages is at a minimum.
Un problema quando si sceglie `e` è che non ci dovrebbero essere troppi messaggi non nascosti. Per esempio, sia `p=19` e `q=37`. Quindi `n=19*37=703` e `φ=18*36=648`. Se scegliamo `e=181`, anche se `MCD(181, 48)=1` risulta che tutti i possibili messaggi m `(0≤m≤n-1)` sono nascosti quando si calcola m<sup>e</sup> mod n. Per qualsiasi scelta valida di `e` esistono alcuni messaggi non nascosti. È importante che il numero di messaggi non nascosti sia il minimo.
For any given `p` and `q`, find the sum of all values of `e`, `1 < e < φ(p,q)` and `gcd(e,φ)=1`, so that the number of unconcealed messages for this value of `e` is at a minimum.
Per ogni dato `p` e `q`, trova la somma di tutti i valori di `e`, `1 < e < φ(p,q)` e `MCD(e,φ)=1`, in modo che il numero di messaggi non nascosti per questo valore di `e` sia minimo.
# --hints--
`RSAEncryption` should be a function.
`RSAEncryption` dovrebbe essere una funzione.
```js
assert(typeof RSAEncryption === 'function')
```
`RSAEncryption` should return a number.
`RSAEncryption` dovrebbe restituire un numero.
```js
assert.strictEqual(typeof RSAEncryption(19, 37), 'number');
```
`RSAEncryption(19, 37)` should return `17766`.
`RSAEncryption(19, 37)` dovrebbe restituire `17766`.
```js
assert.strictEqual(RSAEncryption(19, 37), 17766);
```
`RSAEncryption(283, 409)` should return `466196580`.
`RSAEncryption(283, 409)` dovrebbe restituire `466196580`.
```js
assert.strictEqual(RSAEncryption(283, 409), 466196580);
```
`RSAEncryption(1009, 3643)` should return `399788195976`.
`RSAEncryption(1009, 3643)` dovrebbe restituire `399788195976`.
```js
assert.strictEqual(RSAEncryption(19, 37), 17766);

View File

@ -1,6 +1,6 @@
---
id: 5900f4231000cf542c50ff36
title: 'Problem 183: Maximum product of parts'
title: 'Problema 183: Massimo prodotto di parti'
challengeType: 5
forumTopicId: 301819
dashedName: problem-183-maximum-product-of-parts
@ -8,30 +8,30 @@ dashedName: problem-183-maximum-product-of-parts
# --description--
Let N be a positive integer and let N be split into k equal parts, r = N/k, so that N = r + r + ... + r.
Sia $N$ un numero intero positivo che sia divisibile in $k$ parti uguali $r = \frac{N}{k}$, in modo che $N = r + r + \cdots + r$.
Let P be the product of these parts, P = r × r × ... × r = rk.
Sia $P$ il prodotto di queste parti, $P = r × r × \cdots × r = r^k$.
For example, if 11 is split into five equal parts, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2, then P = 2.25 = 51.53632.
Ad esempio, se 11 è diviso in cinque parti uguali, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2, quindi $P = {2.2}^5 = 51.53632$.
Let M(N) = Pmax for a given value of N.
Sia $M(N) = P_{max}$ per un dato valore di $N$.
It turns out that the maximum for N = 11 is found by splitting eleven into four equal parts which leads to Pmax = (11/4)4; that is, M(11) = 14641/256 = 57.19140625, which is a terminating decimal.
Si scopre che il massimo per $N = 11$ è trovato dividendo undici in quattro parti uguali che porta a $P_{max} = {(\frac{11}{4})}^4$; cioè, $M(11) = \frac{14641}{256} = 57.19140625$, che è un decimale finito.
However, for N = 8 the maximum is achieved by splitting it into three equal parts, so M(8) = 512/27, which is a non-terminating decimal.
Tuttavia, per $N = 8$ il massimo è raggiunto dividendolo in tre parti uguali, quindi $M(8) = \frac{512}{27}$, che è un decimale periodico.
Let D(N) = N if M(N) is a non-terminating decimal and D(N) = -N if M(N) is a terminating decimal.
Sia $D(N) = N$ se $M(N)$ è un decimale periodico e $D(N) = -N$ se $M(N)$ è un decimale finito.
For example, ΣD(N) for 5 ≤ N ≤ 100 is 2438.
Ad esempio, $\sum D(N)$ per $5 ≤ N ≤ 100$ è 2438.
Find ΣD(N) for 5 ≤ N ≤ 10000.
Trova $\sum D(N)$ per $5 ≤ N ≤ 10000$.
# --hints--
`euler183()` should return 48861552.
`maximumProductOfParts()` dovrebbe restituire `48861552`.
```js
assert.strictEqual(euler183(), 48861552);
assert.strictEqual(maximumProductOfParts(), 48861552);
```
# --seed--
@ -39,12 +39,12 @@ assert.strictEqual(euler183(), 48861552);
## --seed-contents--
```js
function euler183() {
function maximumProductOfParts() {
return true;
}
euler183();
maximumProductOfParts();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4241000cf542c50ff37
title: 'Problem 184: Triangles containing the origin'
title: 'Problema 184: Triangoli contenenti l''origine'
challengeType: 5
forumTopicId: 301820
dashedName: problem-184-triangles-containing-the-origin
@ -8,20 +8,22 @@ dashedName: problem-184-triangles-containing-the-origin
# --description--
Consider the set Ir of points (x,y) with integer coordinates in the interior of the circle with radius r, centered at the origin, i.e. x2 + y2 &lt; r2.
Considera il set $I_r$ di punti $(x, y)$ con coordinate intere all'interno del cerchio con raggio $r$, centrato all'origine, cioè $x^2 + y^2 &lt; r^2$.
For a radius of 2, I2 contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in I2 which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
Per un raggio di 2, $I_2$ contiene i nove punti (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) e (1,-1). Ci sono otto triangoli con tutti e tre i vertici in $I_2$ che contengono l'origine all'interno. Due di loro sono mostrati di seguito, gli altri sono ottenuti da questi per rotazione.
For a radius of 3, there are 360 triangles containing the origin in the interior and having all vertices in I3 and for I5 the number is 10600.
<img class="img-responsive center-block" alt="cerchio con raggio 2, centrato all'origine, con nove punti contrassegnati e due triangoli - (-1,0), (0,1), (1,-1) e (-1,1), (0,-1), (1,1)" src="https://cdn.freecodecamp.org/curriculum/project-euler/triangles-containing-the-origin.gif" style="background-color: white; padding: 10px;" />
How many triangles are there containing the origin in the interior and having all three vertices in I105?
Per un raggio di 3, ci sono 360 triangoli contenenti l'origine e aventi tutti i vertici in $I_3$ e per $I_5$ il numero è 10600.
Quanti triangoli contengono l'origine all'interno e hanno tutti e tre i vertici in $I_{105}$?
# --hints--
`euler184()` should return 1725323624056.
`trianglesContainingOrigin()` dovrebbe restituire `1725323624056`.
```js
assert.strictEqual(euler184(), 1725323624056);
assert.strictEqual(trianglesConttainingOrigin(), 1725323624056);
```
# --seed--
@ -29,12 +31,12 @@ assert.strictEqual(euler184(), 1725323624056);
## --seed-contents--
```js
function euler184() {
function trianglesContainingOrigin() {
return true;
}
euler184();
trianglesContainingOrigin();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3c81000cf542c50fedb
title: 'Problem 92: Square digit chains'
title: 'Problema 92: catene dei quadrati delle cifre'
challengeType: 5
forumTopicId: 302209
dashedName: problem-92-square-digit-chains
@ -8,43 +8,43 @@ dashedName: problem-92-square-digit-chains
# --description--
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before.
Una catena di numeri è creata sommando in modo continuo i quadrati delle cifre in un numero per formare un nuovo numero fino a che non se ne trova uno già visto.
For example,
Per esempio,
$$\begin{align} & 44 → 32 → 13 → 10 → \boldsymbol{1} → \boldsymbol{1}\\\\ & 85 → \boldsymbol{89} → 145 → 42 → 20 → 4 → 16 → 37 → 58 → \boldsymbol{89}\\\\ \end{align}$$
Therefore any chain that arrives at 1 or 89 will become stuck in an endless loop. What is most amazing is that EVERY starting number will eventually arrive at 1 or 89.
Quindi ogni catena che arriva ad 1 o 89 si bloccherà in un loop senza fine. La cosa affascinante è che OGNI numero iniziale arriverà prima o poi a 1 o 89.
How many starting numbers below `limit` will arrive at 89?
Quanti numeri iniziali sotto `limit` arriveranno ad 89?
# --hints--
`squareDigitChains(100)` should return a number.
`squareDigitChains(100)` dovrebbe restituire un numero.
```js
assert(typeof squareDigitChains(100) === 'number');
```
`squareDigitChains(100)` should return `80`.
`squareDigitChains(100)` dovrebbe restituire `80`.
```js
assert.strictEqual(squareDigitChains(100), 80);
```
`squareDigitChains(1000)` should return `857`.
`squareDigitChains(1000)` dovrebbe restituire `857`.
```js
assert.strictEqual(squareDigitChains(1000), 857);
```
`squareDigitChains(100000)` should return `85623`.
`squareDigitChains(100000)` dovrebbe restituire `85623`.
```js
assert.strictEqual(squareDigitChains(100000), 85623);
```
`squareDigitChains(10000000)` should return `8581146`.
`squareDigitChains(10000000)` dovrebbe restituire `8581146`.
```js
assert.strictEqual(squareDigitChains(10000000), 8581146);

View File

@ -1,6 +1,6 @@
---
id: 5900f3ca1000cf542c50fedc
title: 'Problem 93: Arithmetic expressions'
title: 'Problema 93: Espressioni aritmetiche'
challengeType: 5
forumTopicId: 302210
dashedName: problem-93-arithmetic-expressions
@ -8,9 +8,9 @@ dashedName: problem-93-arithmetic-expressions
# --description--
By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and making use of the four arithmetic operations (+, , \*, /) and brackets/parentheses, it is possible to form different positive integer targets.
Utilizzando ciascuna delle cifre dall'insieme {1, 2, 3, 4} esattamente una volta, e facendo uso delle quattro operazioni aritmetiche (+, , \*, /) e parentesi, è possibile formare diversi target interi positivi.
For example,
Per esempio,
<div style='margin-left: 4em;'>
8 = (4 * (1 + 3)) / 2<br>
@ -19,21 +19,21 @@ For example,
36 = 3 * 4 * (2 + 1)
</div>
Note that concatenations of the digits, like 12 + 34, are not allowed.
Nota che le concatenazioni delle cifre, come 12 + 34, non sono permesse.
Using the set, {1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers of which 36 is the maximum, and each of the numbers 1 to 28 can be obtained before encountering the first non-expressible number.
Utilizzando il set {1, 2, 3, 4} è possibile ottenere trentuno numeri target diversi, di cui 36 è il massimo, e ciascuno dei numeri da 1 a 28 può essere ottenuto prima di incontrare il primo numero non espressibile.
Find the set of four distinct digits, `a` &lt; `b` &lt; `c` &lt; `d`, for which the longest set of consecutive positive integers, 1 to `n`, can be obtained, giving your answer as a string: `abcd`.
Trova l'insieme di quattro cifre distinte, `a` &lt; `b` &lt; `c` &lt; `d`, per cui può essere ottenuto il set più lungo di numeri interi positivi consecutivi, da 1 a `n`, dando la tua risposta come stringa: `abcd`.
# --hints--
`arithmeticExpressions()` should return a number.
`arithmeticExpressions()` dovrebbe restituire un numero.
```js
assert(typeof arithmeticExpressions() === 'number');
```
`arithmeticExpressions()` should return 1258.
`arithmeticExpressions()` dovrebbe restituire 1258.
```js
assert.strictEqual(arithmeticExpressions(), 1258);

View File

@ -1,6 +1,6 @@
---
id: 5900f3ca1000cf542c50fedd
title: 'Problem 94: Almost equilateral triangles'
title: 'Problema 94: Triangoli quasi equilateri'
challengeType: 5
forumTopicId: 302211
dashedName: problem-94-almost-equilateral-triangles
@ -8,39 +8,39 @@ dashedName: problem-94-almost-equilateral-triangles
# --description--
It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the almost equilateral triangle 5-5-6 has an area of 12 square units.
È facilmente dimostrato che non esiste un triangolo equilatero con i lati di lunghezza intera e l'area intera. Tuttavia, il triangolo quasi equilatero 5-5-6 ha una superficie di 12 unità quadrate.
We shall define an <dfn>almost equilateral triangle</dfn> to be a triangle for which two sides are equal and the third differs by no more than one unit.
Definiremo un <dfn>triangolo quasi equilatero</dfn> come un triangolo per il quale due latri sono uguali e il terzo differisce per non più di un'unità.
Find the sum of the perimeters of all almost equilateral triangles with integral side lengths and area and whose perimeters do not exceed `limit`.
Trovare la somma dei perimetri di tutti i triangoli quasi equilateri con lunghezze dei lati e area interi e i cui perimetri non superano `limit`.
# --hints--
`almostEquilateralTriangles(50)` should return a number.
`almostEquilateralTriangles(50)` dovrebbe restituire un numero.
```js
assert(typeof almostEquilateralTriangles(50) === 'number');
```
`almostEquilateralTriangles(50)` should return `66`.
`almostEquilateralTriangles(50)` dovrebbe restituire `66`.
```js
assert.strictEqual(almostEquilateralTriangles(50), 66);
```
`almostEquilateralTriangles(10000)` should return `3688`.
`almostEquilateralTriangles(10000)` dovrebbe restituire `3688`.
```js
assert.strictEqual(almostEquilateralTriangles(10000), 3688);
```
`almostEquilateralTriangles(10000000)` should return `9973078`.
`almostEquilateralTriangles(10000000)` dovrebbe restituire `9973078`.
```js
assert.strictEqual(almostEquilateralTriangles(10000000), 9973078);
```
`almostEquilateralTriangles(1000000000)` should return `518408346`.
`almostEquilateralTriangles(1000000000)` dovrebbe restituire `518408346`.
```js
assert.strictEqual(almostEquilateralTriangles(1000000000), 518408346);

View File

@ -1,6 +1,6 @@
---
id: 5900f3cc1000cf542c50fede
title: 'Problem 95: Amicable chains'
title: 'Problema 95: catene amichevoli'
challengeType: 5
forumTopicId: 302212
dashedName: problem-95-amicable-chains
@ -8,45 +8,45 @@ dashedName: problem-95-amicable-chains
# --description--
The proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of 28 are 1, 2, 4, 7, and 14. As the sum of these divisors is equal to 28, we call it a perfect number.
I divisori propri di un numero sono tutti i divisori, escluso il numero stesso. Ad esempio, i divisori propri di 28 sono 1, 2, 4, 7 e 14. Poiché la somma di questi divisori è uguale a 28, lo chiameremo un numero perfetto.
Interestingly the sum of the proper divisors of 220 is 284 and the sum of the proper divisors of 284 is 220, forming a chain of two numbers. For this reason, 220 and 284 are called an amicable pair.
È interessante notare che la somma dei divisori propri di 220 è 284 e la somma dei divisori propri di 284 è 220, formando una catena di due numeri. Per questo motivo, 220 e 284 sono chiamati una coppia amichevole.
Perhaps less well known are longer chains. For example, starting with 12496, we form a chain of five numbers:
Forse meno note sono catene più lunghe. Per esempio, iniziando con 12496, formiamo una catena di cinque numeri:
$$ 12496 → 14288 → 15472 → 14536 → 14264 \\,(→ 12496 → \cdots) $$
Since this chain returns to its starting point, it is called an amicable chain.
Visto che la catena torna al punto iniziale, è chiamata una catena amichevole.
Find the smallest member of the longest amicable chain with no element exceeding `limit`.
Trova l'elemento più piccolo della catena amichevole più lunga che non abbia alcun elemento che vada sopra `limit`.
# --hints--
`amicableChains(300)` should return a number.
`amicableChains(300)` dovrebbe restituire un numero.
```js
assert(typeof amicableChains(300) === 'number');
```
`amicableChains(300)` should return `220`.
`amicableChains(300)` dovrebbe restituire `220`.
```js
assert.strictEqual(amicableChains(300), 220);
```
`amicableChains(15000)` should return `220`.
`amicableChains(15000)` dovrebbe restituire `220`.
```js
assert.strictEqual(amicableChains(15000), 220);
```
`amicableChains(100000)` should return `12496`.
`amicableChains(100000)` dovrebbe restituire `12496`.
```js
assert.strictEqual(amicableChains(100000), 12496);
```
`amicableChains(1000000)` should return `14316`.
`amicableChains(1000000)` dovrebbe restituire `14316`.
```js
assert.strictEqual(amicableChains(1000000), 14316);

Some files were not shown because too many files have changed in this diff Show More