chore(i18n,curriculum): update translations (#44154)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4111000cf542c50ff24
|
||||
title: 'Problem 165: Intersections'
|
||||
title: 'Problema 165: Interseções'
|
||||
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:
|
||||
Um segmento é definido exclusivamente por seus dois pontos de extremidade. Considerando dois segmentos de reta em geometria plana, há três possibilidades: os segmentos têm zero pontos, um ponto, ou infinitos pontos em comum.
|
||||
|
||||
the segments have zero points, one point, or infinitely many points in common.
|
||||
Além disso, quando dois segmentos têm exatamente um ponto em comum, pode acontecer que esse ponto comum seja um ponto de extremidade de um dos segmentos ou de ambos. Se um ponto comum de dois segmentos não for um ponto de extremidade de nenhum dos segmentos, ele é um ponto interno de ambos os segmentos.
|
||||
|
||||
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.
|
||||
Chamaremos de ponto comum $T$ de dois segmentos $L_1$ e $L_2$ um ponto de interseção verdadeira de $L_1$ e $L_2$ se $T$ for o único ponto comum de $L_1$ e $L_2$ e se $T$ for um ponto interior de ambos os segmentos.
|
||||
|
||||
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.
|
||||
Considere os três segmentos $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}$$
|
||||
|
||||
É possível verificar que os segmentos de reta $L_2$ e $L_3$ têm um ponto de interseção verdadeira. Percebemos que, como um dos pontos de extremidade de $L_3$: (22, 40) fica sobre $L_1$, este não é considerado um ponto de interseção verdadeira. $L_1$ e $L_2$ não têm um ponto em comum. Portanto, entre os três segmentos de reta, encontramos um ponto de interseção verdadeira.
|
||||
|
||||
Façamos agora o mesmo em 5.000 segmentos de reta. Para isso, geramos 20.000 números usando o chamado gerador pseudoaleatório de números "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}$$
|
||||
|
||||
Para criar cada segmento de reta, usamos quatro números consecutivos $t_n$. Ou seja, o primeiro segmento de reta é dado por:
|
||||
|
||||
($_t$1, $t_2$) a ($t_3$, $t_4$)
|
||||
|
||||
Os primeiros quatro números calculados de acordo com o gerador acima devem ser: 27, 144, 12 e 232. O primeiro segmento seria, portanto, de (27, 144) a (12, 232).
|
||||
|
||||
Quantos pontos de interseção verdadeira distintos se encontram entre os 5.000 segmentos de reta?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler165()` should return 2868868.
|
||||
`distinctIntersections()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4131000cf542c50ff25
|
||||
title: 'Problem 166: Criss Cross'
|
||||
title: 'Problema 166: Cruzamentos'
|
||||
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.
|
||||
Uma grade de 4x4 é preenchida por algarismos $d$, sendo que $0 ≤ d ≤ 9$.
|
||||
|
||||
It can be seen that in the grid
|
||||
Pode-se ver que na grade
|
||||
|
||||
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.
|
||||
a soma de cada linha e de cada coluna tem o valor 12. Além disso, a soma de cada diagonal também é 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?
|
||||
De quantas maneiras você pode preencher uma grade 4x4 com os dígitos $d$, sendo que $0 ≤ d ≤ 9$, de modo que cada linha, cada coluna e as duas diagonais tenham a mesma soma?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler166()` should return 7130034.
|
||||
`crissCross()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4141000cf542c50ff26
|
||||
title: 'Problem 167: Investigating Ulam sequences'
|
||||
title: 'Problema 167: Investigação de sequências de 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,
|
||||
Para dois números inteiros positivos, $a$ e $b$, a sequência de Ulam $U(a,b)$ é definida por ${U{(a,b)}\_1} = a$, ${U{(a,b)}\_2} = b$ e por $k > 2$. ${U{(a,b)}\_k}$ é o menor número inteiro maior que ${U{(a,b)}\_{(k-1)}}$ que pode ser escrito exatamente de um modo como a soma dos dois membros distintos anteriores de $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).
|
||||
Por exemplo, a sequência $U(1,2)$ começa com
|
||||
|
||||
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 não pertence a ela porque $5 = 1 + 4 = 2 + 3$ tem duas representações como a soma de dois membros anteriores. Da mesma forma, $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.
|
||||
Encontre a $\sum {U(2, 2n + 1)_k}$ para $2 ≤ n ≤ 10$, onde $k = {10}^{11}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler167()` should return 3916160068885.
|
||||
`ulamSequences()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4151000cf542c50ff27
|
||||
title: 'Problem 168: Number Rotations'
|
||||
title: 'Problema 168: Rotações de números'
|
||||
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.
|
||||
Considere o número 142857. Podemos girar esse número para a direita movendo o último algarismo (7) para a frente dele, nos dando 714285.
|
||||
|
||||
It can be verified that 714285=5×142857.
|
||||
Pode-se ver que $714285 = 5 × 142857$.
|
||||
|
||||
This demonstrates an unusual property of 142857: it is a divisor of its right-rotation.
|
||||
Isto demonstra uma propriedade incomum de 142857: ele é um divisor de sua rotação à direita.
|
||||
|
||||
Find the last 5 digits of the sum of all integers n, 10 < n < 10100, that have this property.
|
||||
Encontre os últimos 5 dígitos da soma de todos os números inteiros $n$, sendo que $10 < n < 10100$, que têm essa propriedade.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler168()` should return 59206.
|
||||
`numberRotations()` deve retornar `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--
|
||||
|
@ -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: Explorar o número de maneiras diferentes pelas quais um número pode ser expresso como uma soma de potências de 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.
|
||||
Defina $f(0)=1$ e $f(n)$ como o número de diferentes maneiras pelas quais $n$ pode ser expresso como uma soma de potências inteiras de 2 usando cada potência não mais que duas vezes.
|
||||
|
||||
For example, f(10)=5 since there are five different ways to express 10:
|
||||
Por exemplo, $f(10)=5$ já que há cinco maneiras diferentes de expressar 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 é $f({10}^{25})$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler169()` should return 178653872807.
|
||||
`numberOfWaysToExpress()` deve retornar `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--
|
||||
|
@ -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: Encontrar o maior pandigital de 0 a 9 que pode ser formado concatenando produtos
|
||||
challengeType: 5
|
||||
forumTopicId: 301805
|
||||
dashedName: >-
|
||||
@ -10,22 +10,22 @@ dashedName: >-
|
||||
|
||||
# --description--
|
||||
|
||||
Take the number 6 and multiply it by each of 1273 and 9854:
|
||||
Pegue o número 6 e multiplique-o por 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.
|
||||
Ao concatenar esses produtos, temos o pandigital de 1 a 9 763859124. Chamaremos 763859124 de "produto concatenado de 6 e (1273, 9854)". Observe, também, que a concatenação dos números de entrada, 612739854, também é um pandigital de 1 a 9.
|
||||
|
||||
The same can be done for 0 to 9 pandigital numbers.
|
||||
O mesmo pode ser feito com os números pandigitais de 0 e 9.
|
||||
|
||||
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 é o maior pandigital de 0 a 9 que é, ao mesmo tempo, o produto concatenado de um número inteiro com dois ou mais números inteiros diversos, de modo que a concatenação dos números de entrada seja também um número pandigital de 0 a 9 com 10 algarismos?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler170()` should return 9857164023.
|
||||
`largestPandigital()` deve retornar `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--
|
||||
|
@ -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: Encontrar números para os quais a soma dos quadrados dos algarismos é um quadrado
|
||||
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.
|
||||
Para um número inteiro positivo $n$, considere $f(n)$ como a soma dos quadrados dos algarismos (na base 10) de $n$, por exemplo,
|
||||
|
||||
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 < n < 1020, such that f(n) is a perfect square.
|
||||
Encontre os últimos nove dígitos da soma de todos os $n$, sendo que $0 < n < {10}^{20}$, de modo que $f(n)$ seja um quadrado perfeito.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler171()` should return 142989277.
|
||||
`lastDigitsSumOfPerfectSquare()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4181000cf542c50ff2b
|
||||
title: 'Problem 172: Investigating numbers with few repeated digits'
|
||||
title: 'Problema 172: Investigação dos números com poucos dígitos repetidos'
|
||||
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?
|
||||
Quantos números de 18 algarismos $n$ (sem zeros à esquerda) existem de modo que nenhum algarismo se repita mais de três vezes em $n$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler172()` should return 227485267000992000.
|
||||
`numbersWithRepeatedDigits()` deve retornar `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--
|
||||
|
@ -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: Usando até um milhão de blocos, quantas lâminas quadradas "ocas" diferentes podem ser formadas?
|
||||
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:
|
||||
Definiremos um lâmina quadrada como um esboço quadrado com um "buraco", de modo que a forma possua simetria vertical e horizontal. Por exemplo, usando exatamente trinta e dois blocos quadrados, podemos formar duas lâminas quadradas diferentes:
|
||||
|
||||
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="duas lâminas quadradas com buracos 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;" />
|
||||
|
||||
Com cem blocos, e não necessariamente usando todos eles de uma só vez, é possível formar quarenta e uma lâminas quadradas diferentes. Usando até um milhão de blocos, quantas lâminas quadradas diferentes podem ser formadas?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler173()` should return 1572729.
|
||||
`differentHollowSquareLaminae()` deve retornar `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--
|
||||
|
@ -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: Contar o número de lâminas quadradas "ocas" que podem formar um, dois, três... arranjos distintos
|
||||
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.
|
||||
Definiremos um lâmina quadrada como um esboço quadrado com um "buraco", de modo que a forma possua simetria vertical e horizontal.
|
||||
|
||||
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.
|
||||
Com oito blocos, é possível formar uma lâmina de uma só forma: um quadrado de 3x3 com um buraco de 1x1 no meio. No entanto, com trinta e dois blocos, é possível formar duas lâminas distintas.
|
||||
|
||||
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="duas lâminas quadradas com buracos 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$ representa o número de blocos utilizados, diremos que $t = 8$ é do tipo $L(1)$ e $t = 32$ é do tipo $L(2)$.
|
||||
|
||||
Considere $N(n)$ o número de $t ≤ 1000000$, de modo que $t$ é do tipo $L(n)$; por exemplo, $N(15) = 832$.
|
||||
|
||||
Qual é a $\sum N(n)$ para $1 ≤ n ≤ 10$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler174()` should return 209566.
|
||||
`hollowSquareLaminaeDistinctArrangements()` deve retornar `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--
|
||||
|
@ -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: Frações envolvendo o número de maneiras diferentes pelas quais um número pode ser expresso como uma soma de potências de 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.
|
||||
Defina $f(0) = 1$ e $f(n)$ como o número de formas de escrever $n$ como uma soma de potências de 2 onde nenhuma potência ocorra mais de duas vezes.
|
||||
|
||||
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
|
||||
Por exemplo, $f(10) = 5$ já que há cinco maneiras diferentes de expressar 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$$
|
||||
|
||||
Pode-se mostrar que, para cada fração $\frac{p}{q}\\; (p>0, q>0)$ existe pelo menos um número inteiro $n$ de modo que $\frac{f(n)}{f(n - 1)} = \frac{p}{q}$.
|
||||
|
||||
Por exemplo, o menor $n$ para o qual $\frac{f(n)}{f(n - 1)} = \frac{13}{17}$ é 241. A expansão binária de 241 é 11110001.
|
||||
|
||||
Ao ler este número binário, a partir do bit mais significativo até o bit menos significativo, que há 4 números um, 3 zeros e um 1. Chamaremos a string 4,3,1 de expansão binária reduzida de 241.
|
||||
|
||||
Encontre a expansão binária reduzida do menor $n$ para o qual
|
||||
|
||||
$$\frac{f(n)}{f(n - 1)} = \frac{123456789}{987654321}$$
|
||||
|
||||
Dê sua resposta como uma string com inteiros separados por vírgula, sem nenhum espaço em branco.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler175()` should return 1, 13717420, 8.
|
||||
`shortenedBinaryExpansionOfNumber()` deve retornar uma string.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler175(), 1, 13717420, 8);
|
||||
assert(typeof shortenedBinaryExpansionOfNumber() === 'string');
|
||||
```
|
||||
|
||||
`shortenedBinaryExpansionOfNumber()` deve retornar a string `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f41c1000cf542c50ff2f
|
||||
title: 'Problem 176: Right-angled triangles that share a cathetus'
|
||||
title: 'Problema 176: Triângulos retos que compartilham um 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.
|
||||
Os quatro triângulos retos com lados (9,12,15), (12,16,20), (5,12,13) e (12,35,37) têm um dos lados menores (catetos) igual a 12. Pode-se mostrar que nenhum outro triângulo reto existe com um dos catetos igual a 12.
|
||||
|
||||
Find the smallest integer that can be the length of a cathetus of exactly 47547 different integer sided right-angled triangles.
|
||||
Encontre o menor número inteiro que pode ser o comprimento de um cateto de exatamente 47547 triângulos retos de lados diferentes de números inteiros.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler176()` should return 96818198400000.
|
||||
`trianglesSharingCathetus()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f41e1000cf542c50ff30
|
||||
title: 'Problem 177: Integer angled Quadrilaterals'
|
||||
title: 'Problema 177: Quadriláteros de ângulos inteiros'
|
||||
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.
|
||||
Considere ABCD um quadrilátero convexo, com suas diagonais AC e BD. Em cada vértice, a diagonal faz um ângulo com cada um dos dois lados, criando oito ângulos de canto.
|
||||
|
||||
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="quadrilátero convexo ABCD com diagonais AC e BD" src="https://cdn.freecodecamp.org/curriculum/project-euler/integer-angled-quadrilaterals.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
Por exemplo, no vértice A, os dois ângulos são CAD e CAB.
|
||||
|
||||
Chamamos um quadrilátero como esse, para o qual todos os oito ângulos têm valores em números inteiros quando medidos em graus um "quadrilátero de ângulos inteiros". Um exemplo de um quadrilátero de ângulos inteiros é um quadrado, onde todos os oito ângulos são de 45°. Outro exemplo é dado por DAC = 20°, BAC = 60°, ABD = 50°, CBD = 30°, BCA = 40°, DCA = 30°, CDB = 80°, ADB = 50°.
|
||||
|
||||
Qual é o número total de quadriláteros de ângulos inteiros não semelhantes?
|
||||
|
||||
**Observação:** nos seus cálculos, você pode supor que um ângulo calculado é inteiro se estiver dentro de uma tolerância de ${10}^{-9}$ de um valor inteiro.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler177()` should return 129325.
|
||||
`integerAngledQuadrilaterals()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f41e1000cf542c50ff31
|
||||
title: 'Problem 178: Step Numbers'
|
||||
title: 'Problema 178: Números com passos'
|
||||
challengeType: 5
|
||||
forumTopicId: 301813
|
||||
dashedName: problem-178-step-numbers
|
||||
@ -8,22 +8,22 @@ dashedName: problem-178-step-numbers
|
||||
|
||||
# --description--
|
||||
|
||||
Consider the number 45656.
|
||||
Considere o número 45656.
|
||||
|
||||
It can be seen that each pair of consecutive digits of 45656 has a difference of one.
|
||||
Podemos ver que cada par de algarismos consecutivos de 45656 tem uma diferença de um.
|
||||
|
||||
A number for which every pair of consecutive digits has a difference of one is called a step number.
|
||||
Um número para o qual cada par de algarismos consecutivos tem uma diferença de um é chamado de um número com passos.
|
||||
|
||||
A pandigital number contains every decimal digit from 0 to 9 at least once.
|
||||
Um número pandigital contém todos os algarismos decimais de 0 a 9 pelo menos uma vez.
|
||||
|
||||
How many pandigital step numbers less than 1040 are there?
|
||||
Quantos números com passos pandigitais menores que ${10}^{40}$ existem?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler178()` should return 126461847755.
|
||||
`stepNumbers()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f41f1000cf542c50ff32
|
||||
title: 'Problem 179: Consecutive positive divisors'
|
||||
title: 'Problema 179: Divisores positivos consecutivos'
|
||||
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 < n < 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.
|
||||
Encontre o número de inteiros sendo que $1 < n < {10}^7$, para os quais $n$ e $n + 1$ têm o mesmo número de divisores positivos. Por exemplo, 14 têm os divisores positivos 1, 2, 7, 14, enquanto 15 tem 1, 3, 5, 15.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler179()` should return 986262.
|
||||
`consecutivePositiveDivisors()` deve retornar `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--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4201000cf542c50ff33
|
||||
title: 'Problem 180: Rational zeros of a function of three variables'
|
||||
title: 'Problema 180: Zeros racionais de uma função de três variáveis'
|
||||
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
|
||||
Para qualquer número inteiro $n$, considere as três funções
|
||||
|
||||
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 suas combinações
|
||||
|
||||
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
|
||||
Chamaremos $(x,y,z)$ de um trio dourado de ordem $k$ se $x$, $y$ e $z$ forem todos números racionais na forma $\frac{a}{b}$, com $0 < a < b ≤ k$, e se houver (pelo menos) um número inteiro $n$, de modo que $f_n(x,y,z) = 0$.
|
||||
|
||||
0 < a < b ≤ k and there is (at least) one integer n, so that fn(x,y,z) = 0.
|
||||
Considere $s(x,y,z) = x + y + z$.
|
||||
|
||||
Let s(x,y,z) = x + y + z.
|
||||
Considere $t = \frac{u}{v}$ como a soma de todos os $s(x,y,z)$ distintos para todos os trios dourados $(x,y,z)$ de ordem 35. Todos os $s(x,y,z)$ e $t$ devem estar na forma reduzida.
|
||||
|
||||
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.
|
||||
Encontre $u + v$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler180()` should return 285196020571078980.
|
||||
`rationalZeros()` deve retornar `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--
|
||||
|
Reference in New Issue
Block a user