chore(i18n,curriculum): processed translations (#44193)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4771000cf542c50ff89
|
||||
title: 'Problem 266: Pseudo Square Root'
|
||||
title: 'Problema 266: Pseudorraiz quadrada'
|
||||
challengeType: 5
|
||||
forumTopicId: 301915
|
||||
dashedName: problem-266-pseudo-square-root
|
||||
@ -8,22 +8,22 @@ dashedName: problem-266-pseudo-square-root
|
||||
|
||||
# --description--
|
||||
|
||||
The divisors of 12 are: 1,2,3,4,6 and 12.
|
||||
Os divisores de 12 são: 1, 2, 3, 4, 6 e 12.
|
||||
|
||||
The largest divisor of 12 that does not exceed the square root of 12 is 3.
|
||||
O maior divisor de 12 que não excede a raiz quadrada de 12 é 3.
|
||||
|
||||
We shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.
|
||||
Vamos chamar o maior divisor de um inteiro $n$ que não excede a raiz quadrada de $n$ como a pseudorraiz quadrada ($PSR$) de $n$.
|
||||
|
||||
It can be seen that PSR(3102)=47.
|
||||
Podemos ver que $PSR(3102) = 47$.
|
||||
|
||||
Let p be the product of the primes below 190. Find PSR(p) mod 1016.
|
||||
Considere $p$ como o produto dos números primos abaixo de 190. Encontre $PSR(p)\bmod {10}^{16}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler266()` should return 1096883702440585.
|
||||
`pseudoSquareRoot()` deve retornar `1096883702440585`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler266(), 1096883702440585);
|
||||
assert.strictEqual(pseudoSquareRoot(), 1096883702440585);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -31,12 +31,12 @@ assert.strictEqual(euler266(), 1096883702440585);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler266() {
|
||||
function pseudoSquareRoot() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler266();
|
||||
pseudoSquareRoot();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4771000cf542c50ff8a
|
||||
title: 'Problem 267: Billionaire'
|
||||
title: 'Problema 267: Bilionário'
|
||||
challengeType: 5
|
||||
forumTopicId: 301916
|
||||
dashedName: problem-267-billionaire
|
||||
@ -8,24 +8,24 @@ dashedName: problem-267-billionaire
|
||||
|
||||
# --description--
|
||||
|
||||
You are given a unique investment opportunity.
|
||||
Você recebe uma oportunidade única de investimento.
|
||||
|
||||
Starting with £1 of capital, you can choose a fixed proportion, f, of your capital to bet on a fair coin toss repeatedly for 1000 tosses.
|
||||
Começando com £1 do capital, você pode escolher uma proporção fixa, $f$, do seu capital para apostar em uma moeda justa repetidamente por 1000 lançamentos.
|
||||
|
||||
Your return is double your bet for heads and you lose your bet for tails.
|
||||
Seu retorno é o dobro da sua aposta para cara e você perde a aposta para coroa.
|
||||
|
||||
For example, if f = 1/4, for the first toss you bet £0.25, and if heads comes up you win £0.5 and so then have £1.5. You then bet £0.375 and if the second toss is tails, you have £1.125.
|
||||
Por exemplo, se $f = \frac{1}{4}$, para o primeiro lançamento, você aposta £0,25. Se cara aparecer, você ganha £0,5 e passa a ter £1,5. Você aposta £0,375 e, se o segundo lançamento for coroa, terá £1,125.
|
||||
|
||||
Choosing f to maximize your chances of having at least £1,000,000,000 after 1,000 flips, what is the chance that you become a billionaire?
|
||||
Escolhendo $f$ para maximizar suas chances de ter pelo menos £1.000.000.000 depois de 1.000 lançamentos da moeda, qual é a chance de você se tornar um bilionário?
|
||||
|
||||
All computations are assumed to be exact (no rounding), but give your answer rounded to 12 digits behind the decimal point in the form 0.abcdefghijkl.
|
||||
Todos os cálculos devem ser exatos (sem arredondamento), mas sua resposta deve ser arredondada para 12 algarismos depois da vírgula na forma 0.abcdefghijkl.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler267()` should return 0.999992836187.
|
||||
`billionaire()` deve retornar `0.999992836187`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler267(), 0.999992836187);
|
||||
assert.strictEqual(billionaire(), 0.999992836187);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +33,12 @@ assert.strictEqual(euler267(), 0.999992836187);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler267() {
|
||||
function billionaire() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler267();
|
||||
billionaire();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 5900f4791000cf542c50ff8b
|
||||
title: >-
|
||||
Problem 268: Counting numbers with at least four distinct prime factors less than 100
|
||||
Problema 268: Contagem de números com pelo menos quatro divisores primos distintos menores que 100
|
||||
challengeType: 5
|
||||
forumTopicId: 301917
|
||||
dashedName: >-
|
||||
@ -10,16 +10,16 @@ dashedName: >-
|
||||
|
||||
# --description--
|
||||
|
||||
It can be verified that there are 23 positive integers less than 1000 that are divisible by at least four distinct primes less than 100.
|
||||
É possível verificar que há 23 números inteiros positivos inferiores a 1000 que são divisíveis por, pelo menos, quatro números primos distintos inferiores a 100.
|
||||
|
||||
Find how many positive integers less than 1016 are divisible by at least four distinct primes less than 100.
|
||||
Encontre quantos números inteiros positivos inferiores a ${10}^{16}$ que são divisíveis por, pelo menos, quatro números primos distintos inferiores a 100.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler268()` should return 785478606870985.
|
||||
`fourDistinctPrimeFactors()` deve retornar `785478606870985`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler268(), 785478606870985);
|
||||
assert.strictEqual(fourDistinctPrimeFactors(), 785478606870985);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +27,12 @@ assert.strictEqual(euler268(), 785478606870985);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler268() {
|
||||
function fourDistinctPrimeFactors() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler268();
|
||||
fourDistinctPrimeFactors();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4791000cf542c50ff8c
|
||||
title: 'Problem 269: Polynomials with at least one integer root'
|
||||
title: 'Problema 269: Polinômios com pelo menos uma raiz inteira'
|
||||
challengeType: 5
|
||||
forumTopicId: 301918
|
||||
dashedName: problem-269-polynomials-with-at-least-one-integer-root
|
||||
@ -8,24 +8,30 @@ dashedName: problem-269-polynomials-with-at-least-one-integer-root
|
||||
|
||||
# --description--
|
||||
|
||||
A root or zero of a polynomial P(x) is a solution to the equation P(x) = 0.
|
||||
Uma raiz ou zero de um polinômio $P(x)$ é uma solução para a equação $P(x) = 0$.
|
||||
|
||||
Define Pn as the polynomial whose coefficients are the digits of n.
|
||||
Defina $P_n$ como o polinômio cujos coeficientes são os algarismos de $n$.
|
||||
|
||||
For example, P5703(x) = 5x3 + 7x2 + 3.
|
||||
Por exemplo, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.
|
||||
|
||||
We can see that:Pn(0) is the last digit of n, Pn(1) is the sum of the digits of n, Pn(10) is n itself.Define Z(k) as the number of positive integers, n, not exceeding k for which the polynomial Pn has at least one integer root.
|
||||
Podemos ver que:
|
||||
|
||||
It can be verified that Z(100 000) is 14696.
|
||||
- $P_n(0)$ é o último algarismo de $n$,
|
||||
- $P_n(1)$ é a soma dos algarismos de $n$,
|
||||
- $Pn(10)$ é o próprio $n$.
|
||||
|
||||
What is Z(1016)?
|
||||
Defina $Z(k)$ como a quantidade de números inteiros positivos, $n$, sem exceder $k$, para a qual o polinômio $P_n$ tem pelo menos uma raiz inteira.
|
||||
|
||||
Podemos verificar que $Z(100.000)$ é 14696.
|
||||
|
||||
Qual é a $Z({10}^{16})$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler269()` should return 1311109198529286.
|
||||
`polynomialsWithOneIntegerRoot()` deve retornar `1311109198529286`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler269(), 1311109198529286);
|
||||
assert.strictEqual(polynomialsWithOneIntegerRoot(), 1311109198529286);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +39,12 @@ assert.strictEqual(euler269(), 1311109198529286);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler269() {
|
||||
function polynomialsWithOneIntegerRoot() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler269();
|
||||
polynomialsWithOneIntegerRoot();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f47c1000cf542c50ff8e
|
||||
title: 'Problem 270: Cutting Squares'
|
||||
title: 'Problema 270: Corte dos quadrados'
|
||||
challengeType: 5
|
||||
forumTopicId: 301920
|
||||
dashedName: problem-270-cutting-squares
|
||||
@ -8,24 +8,24 @@ dashedName: problem-270-cutting-squares
|
||||
|
||||
# --description--
|
||||
|
||||
A square piece of paper with integer dimensions N×N is placed with a corner at the origin and two of its sides along the x- and y-axes. Then, we cut it up respecting the following rules:
|
||||
Um pedaço de papel quadrado com dimensões inteiras $N×N$ é colocado com um canto na origem e dois de seus lados ao longo dos eixos $x$ e $y$. Depois, cortamos os quadrados respeitando as seguintes regras:
|
||||
|
||||
We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
|
||||
- Fazemos apenas cortes retos entre dois pontos que estejam em lados diferentes do quadrado e que tenham como coordenadas números inteiros.
|
||||
- Dois cortes não podem se cruzar, mas vários cortes podem se encontrar no mesmo ponto das arestas.
|
||||
- Prosseguimos até que não seja possível fazer mais cortes.
|
||||
|
||||
Two cuts cannot cross, but several cuts can meet at the same border point.
|
||||
Contando quaisquer reflexões ou rotações distintas, chamamos de $C(N)$ o número de maneiras de cortar um quadrado $N×N$. Por exemplo, $C(1) = 2$ e $C(2) = 30$ (mostrados abaixo).
|
||||
|
||||
Proceed until no more legal cuts can be made.
|
||||
<img class="img-responsive center-block" alt="maneiras de cortar o quadrado 2x2, contando reflexões e rotações como distintas" src="https://cdn.freecodecamp.org/curriculum/project-euler/cutting-squares.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
Counting any reflections or rotations as distinct, we call C(N) the number of ways to cut an N×N square. For example, C(1) = 2 and C(2) = 30 (shown below).
|
||||
|
||||
What is C(30) mod 108 ?
|
||||
Qual é o $C(30)\bmod {10}^8$ ?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler270()` should return 82282080.
|
||||
`cuttingSquares()` deve retornar `82282080`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler270(), 82282080);
|
||||
assert.strictEqual(cuttingSquares(), 82282080);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +33,12 @@ assert.strictEqual(euler270(), 82282080);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler270() {
|
||||
function cuttingSquares() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler270();
|
||||
cuttingSquares();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f47b1000cf542c50ff8d
|
||||
title: 'Problem 271: Modular Cubes, part 1'
|
||||
title: 'Problema 271: Cubos modulares, parte 1'
|
||||
challengeType: 5
|
||||
forumTopicId: 301921
|
||||
dashedName: problem-271-modular-cubes-part-1
|
||||
@ -8,18 +8,18 @@ dashedName: problem-271-modular-cubes-part-1
|
||||
|
||||
# --description--
|
||||
|
||||
For a positive number n, define S(n) as the sum of the integers x, for which 1
|
||||
Para um número positivo $n$, defina $S(n)$ como a soma dos números inteiros $x$, para a qual $1 < x < n$ e $x^3 \equiv 1\bmod n$.
|
||||
|
||||
When n=91, there are 8 possible values for x, namely : 9, 16, 22, 29, 53, 74, 79, 81. Thus, S(91)=9+16+22+29+53+74+79+81=363.
|
||||
Quando $n = 91$, existem 8 valores possíveis $x$: 9, 16, 22, 29, 53, 74, 79 e 81. Portanto, $S(91) = 9 + 16 + 22 + 29 + 53 + 74 + 79 + 81 = 363$.
|
||||
|
||||
Find S(13082761331670030).
|
||||
Encontre $S(13.082.761.331.670.030)$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler271()` should return 4617456485273130000.
|
||||
`modularCubesOne()` deve retornar `4617456485273130000`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler271(), 4617456485273130000);
|
||||
assert.strictEqual(modularCubesOne(), 4617456485273130000);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +27,12 @@ assert.strictEqual(euler271(), 4617456485273130000);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler271() {
|
||||
function modularCubesOne() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler271();
|
||||
modularCubesOne();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f47d1000cf542c50ff8f
|
||||
title: 'Problem 272: Modular Cubes, part 2'
|
||||
title: 'Problema 272: Cubos modulares, parte 2'
|
||||
challengeType: 5
|
||||
forumTopicId: 301922
|
||||
dashedName: problem-272-modular-cubes-part-2
|
||||
@ -8,18 +8,18 @@ dashedName: problem-272-modular-cubes-part-2
|
||||
|
||||
# --description--
|
||||
|
||||
For a positive number n, define C(n) as the number of the integers x, for which 1
|
||||
Para um número positivo $n$, defina $C(n)$ como a quantidade de números inteiros $x$, para a qual $1 < x < n$ e $x^3 \equiv 1\bmod n$.
|
||||
|
||||
When n=91, there are 8 possible values for x, namely : 9, 16, 22, 29, 53, 74, 79, 81. Thus, C(91)=8.
|
||||
Quando $n = 91$, existem 8 valores possíveis $x$: 9, 16, 22, 29, 53, 74, 79 e 81. Assim, $C(91) = 8$.
|
||||
|
||||
Find the sum of the positive numbers n≤1011 for which C(n)=242.
|
||||
Encontre a soma dos números positivos $n ≤ {10}^{11}$ para a qual $C(n)=242$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler272()` should return 8495585919506151000.
|
||||
`modularCubesTwo()` deve retornar `8495585919506151000`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler272(), 8495585919506151000);
|
||||
assert.strictEqual(modularCubesTwo(), 8495585919506151000);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +27,12 @@ assert.strictEqual(euler272(), 8495585919506151000);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler272() {
|
||||
function modularCubesTwo() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler272();
|
||||
modularCubesTwo();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f47e1000cf542c50ff90
|
||||
title: 'Problem 273: Sum of Squares'
|
||||
title: 'Problema 273: Soma dos quadrados'
|
||||
challengeType: 5
|
||||
forumTopicId: 301923
|
||||
dashedName: problem-273-sum-of-squares
|
||||
@ -8,16 +8,24 @@ dashedName: problem-273-sum-of-squares
|
||||
|
||||
# --description--
|
||||
|
||||
Consider equations of the form: a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer.
|
||||
Considere as equações da forma: $a^2 + b^2 = N$, $0 ≤ a ≤ b$, sendo $a$, $b$ e $N$ números inteiros.
|
||||
|
||||
For N=65 there are two solutions: a=1, b=8 and a=4, b=7. We call S(N) the sum of the values of a of all solutions of a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer. Thus S(65) = 1 + 4 = 5. Find ∑S(N), for all squarefree N only divisible by primes of the form 4k+1 with 4k+1 < 150.
|
||||
Para $N = 65$, existem duas soluções:
|
||||
|
||||
$a = 1, b = 8$ e $a = 4, b = 7$.
|
||||
|
||||
Chamamos de $S(N)$ a soma dos valores de $a$ de todas as soluções de $a^2 + b^2 = N$, $0 ≤ a ≤ b$, sendo $a$, $b$ e $N$ números inteiros.
|
||||
|
||||
Portanto, $S(65) = 1 + 4 = 5$.
|
||||
|
||||
Encontre $\sum S(N)$, para todos os $N$ sem quadrados, divisíveis apenas por números primos da forma $4k + 1$, com $4k + 1 < 150$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler273()` should return 2032447591196869000.
|
||||
`sumOfSquares()` deve retornar `2032447591196869000`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler273(), 2032447591196869000);
|
||||
assert.strictEqual(sumOfSquares(), 2032447591196869000);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -25,12 +33,12 @@ assert.strictEqual(euler273(), 2032447591196869000);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler273() {
|
||||
function sumOfSquares() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler273();
|
||||
sumOfSquares();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f47f1000cf542c50ff91
|
||||
title: 'Problem 274: Divisibility Multipliers'
|
||||
title: 'Problema 274: Multiplicadores de divisibilidade'
|
||||
challengeType: 5
|
||||
forumTopicId: 301924
|
||||
dashedName: problem-274-divisibility-multipliers
|
||||
@ -8,26 +8,28 @@ dashedName: problem-274-divisibility-multipliers
|
||||
|
||||
# --description--
|
||||
|
||||
For each integer p > 1 coprime to 10 there is a positive divisibility multiplier m < p which preserves divisibility by p for the following function on any positive integer, n:
|
||||
Para cada número inteiro $p > 1$ coprimo de 10, há um multiplicador positivo de divisibilidade $m < p$ que preserva a divisibilidade por $p$ para a seguinte função em qualquer número inteiro positivo, $n$:
|
||||
|
||||
f(n) = (all but the last digit of n) + (the last digit of n) \* m
|
||||
$f(n) = (\text{todos exceto o último algarismo de} \\; n) + (\text{o último algarismo de} \\; n) \times m$
|
||||
|
||||
That is, if m is the divisibility multiplier for p, then f(n) is divisible by p if and only if n is divisible by p.
|
||||
Ou seja, se $m$ for o multiplicador de divisibilidade para $p$, então $f(n)$ é divisível por $p$ se e somente se $n$ for divisível por $p$.
|
||||
|
||||
(When n is much larger than p, f(n) will be less than n and repeated application of f provides a multiplicative divisibility test for p.)
|
||||
Quando $n$ for muito maior que $p$, $f(n)$ será menor que $n$ e a aplicação repetida de $f$ fornecerá um teste de multiplicador de divisibilidade para $p$.
|
||||
|
||||
For example, the divisibility multiplier for 113 is 34.
|
||||
Por exemplo, o multiplicador de divisibilidade para 113 é 34.
|
||||
|
||||
f(76275) = 7627 + 5 *34 = 7797 : 76275 and 7797 are both divisible by 113f(12345) = 1234 + 5* 34 = 1404 : 12345 and 1404 are both not divisible by 113
|
||||
$f(76275) = 7627 + 5 \times 34 = 7797$: 76275 e 7797 são divisíveis por 113
|
||||
|
||||
The sum of the divisibility multipliers for the primes that are coprime to 10 and less than 1000 is 39517. What is the sum of the divisibility multipliers for the primes that are coprime to 10 and less than 107?
|
||||
$f(12345) = 1234 + 5 \times 34 = 1404$: 12345 e 1404 não são divisíveis por 113
|
||||
|
||||
A soma dos multiplicadores de divisibilidade dos números primos que são coprimos de 10 e menores que 1000 é 39517. Qual é a soma dos multiplicadores de divisibilidade dos números primos que são coprimos de 10 e menores que ${10}^7$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler274()` should return 1601912348822.
|
||||
`divisibilityMultipliers()` deve retornar `1601912348822`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler274(), 1601912348822);
|
||||
assert.strictEqual(divisibilityMultipliers(), 1601912348822);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -35,12 +37,12 @@ assert.strictEqual(euler274(), 1601912348822);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler274() {
|
||||
function divisibilityMultipliers() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler274();
|
||||
divisibilityMultipliers();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4801000cf542c50ff92
|
||||
title: 'Problem 275: Balanced Sculptures'
|
||||
title: 'Problema 275: Esculturas balanceadas'
|
||||
challengeType: 5
|
||||
forumTopicId: 301925
|
||||
dashedName: problem-275-balanced-sculptures
|
||||
@ -8,26 +8,27 @@ dashedName: problem-275-balanced-sculptures
|
||||
|
||||
# --description--
|
||||
|
||||
Let us define a balanced sculpture of order n as follows:
|
||||
Vamos definir uma escultura balanceada de ordem $n$ da seguinte forma:
|
||||
|
||||
A polyomino made up of n+1 tiles known as the blocks (n tiles) and the plinth (remaining tile);
|
||||
- Um poliminó composto por $n + 1$ blocos, sendo que $n$ são os "blocos" e o bloco restante (+1) é o "pedestal";
|
||||
- o pedestal tem seu centro na posição ($x = 0$, $y = 0$);
|
||||
- os blocos têm coordenadas $y$ maiores que zero (portanto o pedestal é o único bloco inferior);
|
||||
- o centro de massa de todos os blocos, combinados, tem a coordenada $x$ igual a zero.
|
||||
|
||||
the plinth has its centre at position (x = 0, y = 0);
|
||||
Ao contar as esculturas, todos os arranjos que são simplesmente reflexões sobre o eixo $y$, <u>não</u> são contados como distintos. Por exemplo, as 18 esculturas equilibradas de ordem 6 são mostradas abaixo. Observe que cada par de imagens espelhadas (sobre o eixo $y$) é contado como uma escultura:
|
||||
|
||||
the blocks have y-coordinates greater than zero (so the plinth is the unique lowest tile);
|
||||
<img class="img-responsive center-block" alt="18 esculturas balanceadas da ordem de 6" src="https://cdn.freecodecamp.org/curriculum/project-euler/balanced-sculptures.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
the centre of mass of all the blocks, combined, has x-coordinate equal to zero.
|
||||
Existem 964 esculturas equilibradas da ordem de 10 e 360505 da ordem de 15.
|
||||
|
||||
When counting the sculptures, any arrangements which are simply reflections about the y-axis, are not counted as distinct. For example, the 18 balanced sculptures of order 6 are shown below; note that each pair of mirror images (about the y-axis) is counted as one sculpture:
|
||||
|
||||
There are 964 balanced sculptures of order 10 and 360505 of order 15.How many balanced sculptures are there of order 18?
|
||||
Quantas esculturas equilibradas existem na ordem de 18?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler275()` should return 15030564.
|
||||
`balancedSculptures()` deve retornar `15030564`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler275(), 15030564);
|
||||
assert.strictEqual(balancedSculptures(), 15030564);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -35,12 +36,12 @@ assert.strictEqual(euler275(), 15030564);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler275() {
|
||||
function balancedSculptures() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler275();
|
||||
balancedSculptures();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4811000cf542c50ff94
|
||||
title: 'Problem 277: A Modified Collatz sequence'
|
||||
title: 'Problema 277: Uma sequência de Collatz modificada'
|
||||
challengeType: 5
|
||||
forumTopicId: 301927
|
||||
dashedName: problem-277-a-modified-collatz-sequence
|
||||
@ -8,28 +8,32 @@ dashedName: problem-277-a-modified-collatz-sequence
|
||||
|
||||
# --description--
|
||||
|
||||
A modified Collatz sequence of integers is obtained from a starting value a1 in the following way:
|
||||
Uma sequência de Collatz modificada de inteiros é obtida a partir do valor inicial $a_1$ da seguinte forma:
|
||||
|
||||
an+1 = an/3 if an is divisible by 3. We shall denote this as a large downward step, "D".
|
||||
$a_{n + 1} = \frac{a_n}{3}$ se $a_n$ for divisível por 3. Vamos apresentar isto como um grande passo descendente, "D".
|
||||
|
||||
an+1 = (4an + 2)/3 if an divided by 3 gives a remainder of 1. We shall denote this as an upward step, "U".
|
||||
$a_{n + 1} = \frac{4a_n + 2}{3}$ se $a_n$ dividido por 3 dá resto 1. Vamos apresentar isto como um grande passo ascendente, "U".
|
||||
|
||||
an+1 = (2an - 1)/3 if an divided by 3 gives a remainder of 2. We shall denote this as a small downward step, "d".
|
||||
$a_{n + 1} = \frac{2a_n - 1}{3}$ se $a_n$ dividido por 3 tem 2 como resto. Vamos apresentar isto como um pequeno passo descendente, "d".
|
||||
|
||||
The sequence terminates when some an = 1.
|
||||
A sequência termina quando algum $a_n = 1$.
|
||||
|
||||
Given any integer, we can list out the sequence of steps. For instance if a1=231, then the sequence {an}={231,77,51,17,11,7,10,14,9,3,1} corresponds to the steps "DdDddUUdDD".
|
||||
Dado qualquer número inteiro, podemos listar a sequência de passos. Por exemplo, se $a_1 = 231$, então a sequência $\\{a_n\\} = \\{231, 77, 51, 17, 11, 7, 10, 14, 9, 3, 1\\}$ corresponde aos passos "DdDddUUdDD".
|
||||
|
||||
Of course, there are other sequences that begin with that same sequence "DdDddUUdDD....". For instance, if a1=1004064, then the sequence is DdDddUUdDDDdUDUUUdDdUUDDDUdDD. In fact, 1004064 is the smallest possible a1 > 106 that begins with the sequence DdDddUUdDD.
|
||||
Claro, há outras sequências que começam com a mesma sequência "DdDUUdD...".
|
||||
|
||||
What is the smallest a1 > 1015 that begins with the sequence "UDDDUdddDDUDDddDdDddDDUDDdUUDd"?
|
||||
Por exemplo, se $a_1 = 1004064$, então a sequência será DdDddUUdDDDdUDUUUdDdUUDDDUdDD.
|
||||
|
||||
Na verdade, 1004064 é o menor número possível $a_1 > {10}^6$ que começa com a sequência DdDddUUdDD.
|
||||
|
||||
Qual é o menor número $a_1 > {10}^{15}$ que começa com a sequência "UDDDUdddDDUDDddDdDddDDUDDdUUDd"?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler277()` should return 1125977393124310.
|
||||
`modifiedCollatzSequence()` deve retornar `1125977393124310`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler277(), 1125977393124310);
|
||||
assert.strictEqual(modifiedCollatzSequence(), 1125977393124310);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -37,12 +41,12 @@ assert.strictEqual(euler277(), 1125977393124310);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler277() {
|
||||
function modifiedCollatzSequence() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler277();
|
||||
modifiedCollatzSequence();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4831000cf542c50ff95
|
||||
title: 'Problem 278: Linear Combinations of Semiprimes'
|
||||
title: 'Problema 278: Combinações lineares de semiprimos'
|
||||
challengeType: 5
|
||||
forumTopicId: 301928
|
||||
dashedName: problem-278-linear-combinations-of-semiprimes
|
||||
@ -8,20 +8,20 @@ dashedName: problem-278-linear-combinations-of-semiprimes
|
||||
|
||||
# --description--
|
||||
|
||||
Given the values of integers 1 < a1 < a2 <... < an, consider the linear combination q1a1 + q2a2 + ... + qnan = b, using only integer values qk ≥ 0.
|
||||
Dados os valores de números inteiros $1 < a_1 < a_2 < \ldots < a_n$, considere a combinação linear $q_1a_1 + q_2a_2 + \ldots + q_na_n = b$, usando somente valores em números inteiros $q_k ≥ 0$.
|
||||
|
||||
Note that for a given set of ak, it may be that not all values of b are possible. For instance, if a1 = 5 and a2 = 7, there are no q1 ≥ 0 and q2 ≥ 0 such that b could be 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23.
|
||||
Observe que, para um determinado conjunto de $a_k$, pode ser que nem todos os valores de $b$ sejam possíveis. Por exemplo, se $a_1 = 5$ e $a_2 = 7$, não existem $q_1 ≥ 0$ e $q_2 ≥ 0$ tal que $b$ possa ser 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 ou 23.
|
||||
|
||||
In fact, 23 is the largest impossible value of b for a1 = 5 and a2 = 7. We therefore call f(5, 7) = 23. Similarly, it can be shown that f(6, 10, 15)=29 and f(14, 22, 77) = 195.
|
||||
De fato, 23 é o maior valor impossível de $b$ para $a_1 = 5$ e $a_2 = 7$. Portanto, consideramos $f(5, 7) = 23$. Da mesma forma, pode ser mostrado que $f(6, 10, 15)=29$ e $f(14, 22, 77) = 195$.
|
||||
|
||||
Find ∑ f(p*q,p*r,q\*r), where p, q and r are prime numbers and p < q < r < 5000.
|
||||
Encontre $\sum f(pq,pr,qr)$, onde $p$, $q$ e $r$ são números primos e $p < q < r < 5000$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler278()` should return 1228215747273908500.
|
||||
`linearCombinationOfSemiprimes()` deve retornar `1228215747273908500`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler278(), 1228215747273908500);
|
||||
assert.strictEqual(linearCombinationOfSemiprimes(), 1228215747273908500);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -29,12 +29,12 @@ assert.strictEqual(euler278(), 1228215747273908500);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler278() {
|
||||
function linearCombinationOfSemiprimes() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler278();
|
||||
linearCombinationOfSemiprimes();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4841000cf542c50ff96
|
||||
title: 'Problem 279: Triangles with integral sides and an integral angle'
|
||||
title: 'Problema 279: Triângulos com lados e ângulo em números inteiros'
|
||||
challengeType: 5
|
||||
forumTopicId: 301929
|
||||
dashedName: problem-279-triangles-with-integral-sides-and-an-integral-angle
|
||||
@ -8,14 +8,14 @@ dashedName: problem-279-triangles-with-integral-sides-and-an-integral-angle
|
||||
|
||||
# --description--
|
||||
|
||||
How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed 108?
|
||||
Quantos triângulos existem com lados compostos de números inteiros, ao menos um ângulo em número inteiro (medido em graus) e com um perímetro que não exceda ${10}^8$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler279()` should return 416577688.
|
||||
`trianglesWithIntegralSidesAndAngle()` deve retornar `416577688`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler279(), 416577688);
|
||||
assert.strictEqual(trianglesWithIntegralSidesAndAngle(), 416577688);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -23,12 +23,12 @@ assert.strictEqual(euler279(), 416577688);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler279() {
|
||||
function trianglesWithIntegralSidesAndAngle() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler279();
|
||||
trianglesWithIntegralSidesAndAngle();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4841000cf542c50ff97
|
||||
title: 'Problem 280: Ant and seeds'
|
||||
title: 'Problema 280: Formiga e sementes'
|
||||
challengeType: 5
|
||||
forumTopicId: 301931
|
||||
dashedName: problem-280-ant-and-seeds
|
||||
@ -8,18 +8,18 @@ dashedName: problem-280-ant-and-seeds
|
||||
|
||||
# --description--
|
||||
|
||||
A laborious ant walks randomly on a 5x5 grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are 2, 3 or 4 possible moves at each step depending on the ant's position.
|
||||
Uma formiga trabalhadora anda aleatoriamente em uma grade de 5x5. A caminhada começa do quadrado central. Em cada etapa, a formiga se move aleatoriamente para um quadrado adjacente, sem sair da grade; assim, há 2, 3 ou 4 movimentos possíveis para cada passo, dependendo da posição da formiga.
|
||||
|
||||
At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches.
|
||||
No início da caminhada, uma semente é colocada em cada quadrado da linha inferior. Quando a formiga não estiver carregando uma semente e atingir um quadrado da linha inferior que contém uma semente, começará a carregar a semente. A formiga soltará a semente no primeiro quadrado vazio da linha superior que ela eventualmente alcance.
|
||||
|
||||
What's the expected number of steps until all seeds have been dropped in the top row? Give your answer rounded to 6 decimal places.
|
||||
Qual é o número esperado de passos até que todas as sementes sejam largadas na linha superior? Dê sua resposta arredondada para 6 casas decimais.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler280()` should return 430.088247.
|
||||
`antAndSeeds()` deve retornar `430.088247`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler280(), 430.088247);
|
||||
assert.strictEqual(antAndSeeds(), 430.088247);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +27,12 @@ assert.strictEqual(euler280(), 430.088247);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler280() {
|
||||
function antAndSeeds() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler280();
|
||||
antAndSeeds();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4861000cf542c50ff98
|
||||
title: 'Problem 281: Pizza Toppings'
|
||||
title: 'Problema 281: Coberturas de pizza'
|
||||
challengeType: 5
|
||||
forumTopicId: 301932
|
||||
dashedName: problem-281-pizza-toppings
|
||||
@ -8,20 +8,22 @@ dashedName: problem-281-pizza-toppings
|
||||
|
||||
# --description--
|
||||
|
||||
You are given a pizza (perfect circle) that has been cut into m·n equal pieces and you want to have exactly one topping on each slice.
|
||||
Você recebe uma pizza (círculo perfeito) que foi cortada em $m·n$ peças iguais e você quer ter exatamente um sabor em cada fatia.
|
||||
|
||||
Let f(m,n) denote the number of ways you can have toppings on the pizza with m different toppings (m ≥ 2), using each topping on exactly n slices (n ≥ 1). Reflections are considered distinct, rotations are not.
|
||||
Considere $f(m,n)$ como o número de maneiras de ter coberturas de pizza com $m$ sabores diferentes ($m ≥ 2$), usando cada cobertura em exatamente $n$ fatias ($n ≥ 1$). Reflexões são consideradas distintas, mas as rotações não são.
|
||||
|
||||
Thus, for instance, f(2,1) = 1, f(2,2) = f(3,1) = 2 and f(3,2) = 16. f(3,2) is shown below:
|
||||
Assim, por exemplo, $f(2,1) = 1$, $f(2,2) = f(3,1) = 2$ e $f(3,2) = 16$. $f(3,2)$ é mostrado abaixo:
|
||||
|
||||
Find the sum of all f(m,n) such that f(m,n) ≤ 1015.
|
||||
<img class="img-responsive center-block" alt="animação com 16 maneiras de ter 3 coberturas diferentes em 2 fatias cada" src="https://cdn.freecodecamp.org/curriculum/project-euler/pizza-toppings.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
Encontre a soma de todos os $f(m,n)$, tal que $f(m,n) £ {10}^{15}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler281()` should return 1485776387445623.
|
||||
`pizzaToppings()` deve retornar `1485776387445623`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler281(), 1485776387445623);
|
||||
assert.strictEqual(pizzaToppings(), 1485776387445623);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -29,12 +31,12 @@ assert.strictEqual(euler281(), 1485776387445623);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler281() {
|
||||
function pizzaToppings() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler281();
|
||||
pizzaToppings();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4861000cf542c50ff99
|
||||
title: 'Problem 282: The Ackermann function'
|
||||
title: 'Problema 282: A função de Ackermann'
|
||||
challengeType: 5
|
||||
forumTopicId: 301933
|
||||
dashedName: problem-282-the-ackermann-function
|
||||
@ -8,18 +8,20 @@ dashedName: problem-282-the-ackermann-function
|
||||
|
||||
# --description--
|
||||
|
||||
For non-negative integers m, n, the Ackermann function A(m, n) is defined as follows:
|
||||
Para números inteiros não negativos $m$, $n$, a função de Ackermann $A(m, n)$ é definida da seguinte forma:
|
||||
|
||||
For example A(1, 0) = 2, A(2, 2) = 7 and A(3, 4) = 125.
|
||||
$$A(m, n) = \begin{cases} n + 1 & \text{if $m = 0$} \\\\ A(m - 1, 1) & \text{if $m > 0$ and $n = 0$} \\\\ A(m - 1, A(m, n - 1)) & \text{if $m > 0$ and $n > 0$} \end{cases}$$
|
||||
|
||||
Find A(n, n) and give your answer mod 148.
|
||||
Por exemplo $A(1, 0) = 2$, $A(2, 2) = 7$ e $A(3, 4) = 125$.
|
||||
|
||||
Encontre $\displaystyle\sum_{n = 0}^6 A(n, n)$ e dê sua resposta mod ${14}^8$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler282()` should return 1098988351.
|
||||
`ackermanFunction()` deve retornar `1098988351`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler282(), 1098988351);
|
||||
assert.strictEqual(ackermanFunction(), 1098988351);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +29,12 @@ assert.strictEqual(euler282(), 1098988351);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler282() {
|
||||
function ackermanFunction() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler282();
|
||||
ackermanFunction();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 5900f4881000cf542c50ff9a
|
||||
title: >-
|
||||
Problem 283: Integer sided triangles for which the area * perimeter ratio is integral
|
||||
Problema 283: Triângulos com lados de números inteiros para os quais a proporção de área * perímetro é um número inteiro
|
||||
challengeType: 5
|
||||
forumTopicId: 301934
|
||||
dashedName: >-
|
||||
@ -10,22 +10,22 @@ dashedName: >-
|
||||
|
||||
# --description--
|
||||
|
||||
Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24.
|
||||
Considere o triângulo com os lados 6, 8 e 10. Podemos ver que o perímetro e a área são ambos equivalentes a 24.
|
||||
|
||||
So the area/perimeter ratio is equal to 1.
|
||||
Portanto, a proporção $\frac{\text{área}}{\text{perímetro}}$ é igual a 1.
|
||||
|
||||
Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84.
|
||||
Considere o triângulo com os lados 13, 14 e 15. O perímetro é igual a 42, enquanto a área é igual a 84.
|
||||
|
||||
So for this triangle the area/perimeter ratio is equal to 2.
|
||||
Assim, para esse triângulo, a proporção $\frac{\text{área}}{\text{perímetro}}$ é igual a 2.
|
||||
|
||||
Find the sum of the perimeters of all integer sided triangles for which the area/perimeter ratios are equal to positive integers not exceeding 1000.
|
||||
Encontre a soma dos perímetros de todos os triângulos com os lados de números inteiros para os quais as proporções da área/perímetro são iguais a números inteiros positivos que não excedem 1000.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler283()` should return 28038042525570324.
|
||||
`integralAreaPerimeterRatio()` deve retornar `28038042525570324`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler283(), 28038042525570324);
|
||||
assert.strictEqual(integralAreaPerimeterRatio(), 28038042525570324);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +33,12 @@ assert.strictEqual(euler283(), 28038042525570324);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler283() {
|
||||
function integralAreaPerimeterRatio() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler283();
|
||||
integralAreaPerimeterRatio();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4891000cf542c50ff9b
|
||||
title: 'Problem 284: Steady Squares'
|
||||
title: 'Problema 284: Quadrados estáveis'
|
||||
challengeType: 5
|
||||
forumTopicId: 301935
|
||||
dashedName: problem-284-steady-squares
|
||||
@ -8,20 +8,26 @@ dashedName: problem-284-steady-squares
|
||||
|
||||
# --description--
|
||||
|
||||
The 3-digit number 376 in the decimal numbering system is an example of numbers with the special property that its square ends with the same digits: 3762 = 141376. Let's call a number with this property a steady square.
|
||||
O número de 3 algarismos 376 no sistema de numeração decimal é um exemplo de números com a propriedade especial de que o quadrado termina com os mesmos algarismos: ${376}^2 = 141376$. Vamos chamar um número com essa propriedade de um quadrado estável.
|
||||
|
||||
Steady squares can also be observed in other numbering systems. In the base 14 numbering system, the 3-digit number c37 is also a steady square: c372 = aa0c37, and the sum of its digits is c+3+7=18 in the same numbering system. The letters a, b, c and d are used for the 10, 11, 12 and 13 digits respectively, in a manner similar to the hexadecimal numbering system.
|
||||
Os quadrados estáveis também podem ser observados em outros sistemas de numeração. No sistema de numeração de base 14, o número de 3 algarismos $c37$ também é um quadrado estável: $c37^2 = aa0c37$ e a soma de seus algarismos é $c+3+7=18$ no mesmo sistema de numeração. As letras $a$, $b$, $c$ e $d$ são usadas para os algarismos 10, 11, 12 e 13, respectivamente, de uma maneira semelhante ao sistema de numeração hexadecimal.
|
||||
|
||||
For 1 ≤ n ≤ 9, the sum of the digits of all the n-digit steady squares in the base 14 numbering system is 2d8 (582 decimal). Steady squares with leading 0's are not allowed.
|
||||
Para $1 ≤ n ≤ 9$, a soma dos algarismos de todos os quadrados estáveis de $n$ algarismos no sistema de numeração de base 14 é $2d8$ (582 no sistema decimal). Não são permitidos quadrados estáveis com zeros à esquerda.
|
||||
|
||||
Find the sum of the digits of all the n-digit steady squares in the base 14 numbering system for 1 ≤ n ≤ 10000 (decimal) and give your answer in the base 14 system using lower case letters where necessary.
|
||||
Encontre a soma dos algarismos de todos os quadrados estáveis de $n$ algarismos no sistema de numeração de base 14 para $1 ≤ n ≤ 10000$ (no sistema decimal) e dê sua resposta como uma string no sistema de base 14 usando letras minúsculas, quando necessário.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler284()` should return 5a411d7b.
|
||||
`steadySquares()` deve retornar uma string.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler284(), '5a411d7b');
|
||||
assert(typeof steadySquares() === 'string');
|
||||
```
|
||||
|
||||
`steadySquares()` deve retornar a string `5a411d7b`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(steadySquares(), '5a411d7b');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -29,12 +35,12 @@ assert.strictEqual(euler284(), '5a411d7b');
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler284() {
|
||||
function steadySquares() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler284();
|
||||
steadySquares();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48a1000cf542c50ff9c
|
||||
title: 'Problem 285: Pythagorean odds'
|
||||
title: 'Problema 285: Probabilidades pitagóricas'
|
||||
challengeType: 5
|
||||
forumTopicId: 301936
|
||||
dashedName: problem-285-pythagorean-odds
|
||||
@ -8,22 +8,22 @@ dashedName: problem-285-pythagorean-odds
|
||||
|
||||
# --description--
|
||||
|
||||
Albert chooses a positive integer k, then two real numbers a, b are randomly chosen in the interval \[0,1] with uniform distribution.
|
||||
Albert escolhe um número inteiro positivo $k$, depois dois números reais $a$, $b$ são escolhidos aleatoriamente no intervalo [0,1] com distribuição uniforme.
|
||||
|
||||
The square root of the sum (k·a+1)2 + (k·b+1)2 is then computed and rounded to the nearest integer. If the result is equal to k, he scores k points; otherwise he scores nothing.
|
||||
A raiz quadrada da soma ${(ka + 1)}^2 + {(kb + 1)}^2$ é então computada e arredondada para o número inteiro mais próximo. Se o resultado for igual a $k$, ele pontua $k$ pontos. Caso contrário, ele não pontua.
|
||||
|
||||
For example, if k = 6, a = 0.2 and b = 0.85, then (k·a+1)2 + (k·b+1)2 = 42.05. The square root of 42.05 is 6.484... and when rounded to the nearest integer, it becomes 6. This is equal to k, so he scores 6 points.
|
||||
Por exemplo, if $k = 6$, $a = 0.2$ e $b = 0.85$, então ${(ka + 1)}^2 + {(kb + 1)}^2 = 42.05$. A raiz quadrada de 42,05 é 6,484... e, quando arredondada para o inteiro mais próximo, ela se torna 6. Isso é igual a $k$, então ele marca 6 pontos.
|
||||
|
||||
It can be shown that if he plays 10 turns with k = 1, k = 2, ..., k = 10, the expected value of his total score, rounded to five decimal places, is 10.20914.
|
||||
Pode-se mostra que, se ele jogar 10 vezes, com $k = 1, k = 2, \ldots, k = 10$, o valor esperado de sua pontuação total, arredondado para cinco casas decimais, é 10,20914.
|
||||
|
||||
If he plays 105 turns with k = 1, k = 2, k = 3, ..., k = 105, what is the expected value of his total score, rounded to five decimal places?
|
||||
Se ele jogar ${10}^5$ vezes com $k = 1, k = 2, k = 3, \ldots, k = {10}^5$, qual é o valor esperado de sua pontuação total, arredondada para cinco casas decimais?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler285()` should return 157055.80999.
|
||||
`pythagoreanOdds()` deve retornar `157055.80999`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler285(), 157055.80999);
|
||||
assert.strictEqual(pythagoreanOdds(), 157055.80999);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -31,12 +31,12 @@ assert.strictEqual(euler285(), 157055.80999);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler285() {
|
||||
function pythagoreanOdds() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler285();
|
||||
pythagoreanOdds();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48a1000cf542c50ff9d
|
||||
title: 'Problem 286: Scoring probabilities'
|
||||
title: 'Problema 286: Probabilidades de pontuação'
|
||||
challengeType: 5
|
||||
forumTopicId: 301937
|
||||
dashedName: problem-286-scoring-probabilities
|
||||
@ -8,18 +8,18 @@ dashedName: problem-286-scoring-probabilities
|
||||
|
||||
# --description--
|
||||
|
||||
Barbara is a mathematician and a basketball player. She has found that the probability of scoring a point when shooting from a distance x is exactly (1 - x/q), where q is a real constant greater than 50.
|
||||
Barbara é matemática e jogadora de basquete. Ela descobriu que a probabilidade de marcar um ponto ao lançar a bola de uma distância $x$ é exatamente ($1 - \frac{x}{q}$), onde $q$ é uma constante real maior que 50.
|
||||
|
||||
During each practice run, she takes shots from distances x = 1, x = 2, ..., x = 50 and, according to her records, she has precisely a 2 % chance to score a total of exactly 20 points.
|
||||
Durante cada prática, ela arremessa das distâncias $x = 1, x = 2, \ldots, x = 50$ e, de acordo com os seus registros, tem precisamente 2% de chance de fazer um total de 20 pontos.
|
||||
|
||||
Find q and give your answer rounded to 10 decimal places.
|
||||
Encontre $q$ e dê sua resposta arredondada para 10 casas decimais.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler286()` should return 52.6494571953.
|
||||
`scoringProbabilities()` deve retornar `52.6494571953`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler286(), 52.6494571953);
|
||||
assert.strictEqual(scoringProbabilities(), 52.6494571953);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -27,12 +27,12 @@ assert.strictEqual(euler286(), 52.6494571953);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler286() {
|
||||
function scoringProbabilities() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler286();
|
||||
scoringProbabilities();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48b1000cf542c50ff9e
|
||||
title: 'Problem 287: Quadtree encoding (a simple compression algorithm)'
|
||||
title: 'Problema 287: Codificação quadtree (um algoritmo simples de compressão)'
|
||||
challengeType: 5
|
||||
forumTopicId: 301938
|
||||
dashedName: problem-287-quadtree-encoding-a-simple-compression-algorithm
|
||||
@ -8,30 +8,35 @@ dashedName: problem-287-quadtree-encoding-a-simple-compression-algorithm
|
||||
|
||||
# --description--
|
||||
|
||||
The quadtree encoding allows us to describe a 2N×2N black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this:
|
||||
A codificação quadtree nos permite descrever uma imagem $2^N×2^N$ preta e branca como uma sequência de bits (0 e 1). Essas sequências devem ser lidas da esquerda para a direita assim:
|
||||
|
||||
the first bit deals with the complete 2N×2N region;
|
||||
- o primeiro bit tem a ver com a região completa do $2^N×2^N$;
|
||||
- "0" indica uma divisão:
|
||||
- a região atual $2^n×2^n$ é dividida em 4 sub-regiões de dimensão $2^{n - 1}×2^{n - 1}$,
|
||||
- os próximos bits contêm a descrição das sub-regiões superior esquerda, superior direita, inferior esquerda e inferior direita - nessa ordem;
|
||||
- "10" indica que a região atual contém apenas pixels pretos;
|
||||
- "11" indica que a região atual contém apenas pixels brancos.
|
||||
|
||||
"0" denotes a split:
|
||||
Considere a seguinte imagem 4×4 (pontos coloridos denotam lugares onde uma divisão pode ocorrer):
|
||||
|
||||
the current 2n×2n region is divided into 4 sub-regions of dimension 2n-1×2n-1,
|
||||
<img class="img-responsive center-block" alt="imagem 4x4 com marcas coloridas denotam lugares onde a divisão pode ocorrer" src="https://cdn.freecodecamp.org/curriculum/project-euler/quadtree-encoding-a-simple-compression-algorithm.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
the next bits contains the description of the top left, top right, bottom left and bottom right sub-regions - in that order;
|
||||
Essa imagem pode ser descrita por várias sequências, por exemplo: "<strong><span style="color: red">0</span></strong><strong><span style="color: blue">0</span></strong>10101010<strong><span style="color: green">0</span></strong>1011111011<strong><span style="color: orange">0</span></strong>10101010", de comprimento 30, ou "<strong><span style="color: red">0</span></strong>10<strong><span style="color: green">0</span></strong>101111101110", de comprimento 16, que é a sequência mínima para essa imagem.
|
||||
|
||||
"10" indicates that the current region contains only black pixels;
|
||||
Para um número inteiro positivo $N$, defina $D_N$ como a imagem $2^N×2^N$ com o seguinte esquema de cores:
|
||||
|
||||
"11" indicates that the current region contains only white pixels.Consider the following 4×4 image (colored marks denote places where a split can occur):
|
||||
- o pixel com coordenadas $x = 0$, $y = 0$ corresponde ao pixel inferior esquerdo,
|
||||
- se ${(x - 2^{N - 1})}^2 + {(y - 2^{N - 1})}^2 ≤ 2^{2N - 2}$, o pixel é preto,
|
||||
- caso contrário, o pixel é branco.
|
||||
|
||||
This image can be described by several sequences, for example : "001010101001011111011010101010", of length 30, or "0100101111101110", of length 16, which is the minimal sequence for this image.
|
||||
|
||||
For a positive integer N, define DN as the 2N×2N image with the following coloring scheme: the pixel with coordinates x = 0, y = 0 corresponds to the bottom left pixel, if (x - 2N-1)2 + (y - 2N-1)2 ≤ 22N-2 then the pixel is black, otherwise the pixel is white.What is the length of the minimal sequence describing D24 ?
|
||||
Qual é o comprimento da sequência mínima que descreve $D_{24}$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler287()` should return 313135496.
|
||||
`quadtreeEncoding()` deve retornar `313135496`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler287(), 313135496);
|
||||
assert.strictEqual(quadtreeEncoding(), 313135496);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -39,12 +44,12 @@ assert.strictEqual(euler287(), 313135496);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler287() {
|
||||
function quadtreeEncoding() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler287();
|
||||
quadtreeEncoding();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48d1000cf542c50ff9f
|
||||
title: 'Problem 288: An enormous factorial'
|
||||
title: 'Problema 288: Um fatorial enorme'
|
||||
challengeType: 5
|
||||
forumTopicId: 301939
|
||||
dashedName: problem-288-an-enormous-factorial
|
||||
@ -8,24 +8,24 @@ dashedName: problem-288-an-enormous-factorial
|
||||
|
||||
# --description--
|
||||
|
||||
For any prime p the number N(p,q) is defined by
|
||||
Para qualquer número primo $p$, o número $N(p,q)$ é definido por $N(p,q) = \sum_{n=0}^q T_n \times p^n$ com $T_n$ gerado pelo seguinte gerador aleatório de números:
|
||||
|
||||
N(p,q) = ∑n=0 to q Tn\*pn with Tn generated by the following random number generator:
|
||||
$$\begin{align} & S_0 = 290797 \\\\ & S_{n + 1} = {S_n}^2\bmod 50.515.093 \\\\ & T_n = S_n\bmod p \end{align}$$
|
||||
|
||||
S0 = 290797 Sn+1 = Sn2 mod 50515093 Tn = Sn mod p
|
||||
Considere $Nfac(p,q)$ como o fatorial de $N(p,q)$.
|
||||
|
||||
Let Nfac(p,q) be the factorial of N(p,q). Let NF(p,q) be the number of factors p in Nfac(p,q).
|
||||
Considere $NF(p,q)$ como o número de divisores $p$ em $Nfac(p,q)$.
|
||||
|
||||
You are given that NF(3,10000) mod 320=624955285.
|
||||
Você é informado de que $NF(3,10000) \bmod 3^{20} = 624.955.285$.
|
||||
|
||||
Find NF(61,107) mod 6110
|
||||
Encontre $NF(61,{10}^7)\bmod {61}^{10}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler288()` should return 605857431263982000.
|
||||
`enormousFactorial()` deve retornar `605857431263982000`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler288(), 605857431263982000);
|
||||
assert.strictEqual(enormousFactorial(), 605857431263982000);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +33,12 @@ assert.strictEqual(euler288(), 605857431263982000);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler288() {
|
||||
function enormousFactorial() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler288();
|
||||
enormousFactorial();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48d1000cf542c50ffa0
|
||||
title: 'Problem 289: Eulerian Cycles'
|
||||
title: 'Problema 289: Ciclos eulerianos'
|
||||
challengeType: 5
|
||||
forumTopicId: 301940
|
||||
dashedName: problem-289-eulerian-cycles
|
||||
@ -8,24 +8,26 @@ dashedName: problem-289-eulerian-cycles
|
||||
|
||||
# --description--
|
||||
|
||||
Let C(x,y) be a circle passing through the points (x, y), (x, y+1), (x+1, y) and (x+1, y+1).
|
||||
Considere $C(x,y)$ como um círculo passando pelos pontos ($x$, $y$), ($x$, $y + 1$), ($x + 1$, $y$) e ($x + 1$, $y + 1$).
|
||||
|
||||
For positive integers m and n, let E(m,n) be a configuration which consists of the m·n circles: { C(x,y): 0 ≤ x < m, 0 ≤ y < n, x and y are integers }
|
||||
Para os números positivos inteiros $m$ e $n$, considere $E(m,n)$ como a configuração que consiste em $m·n$ círculos: { $C(x,y)$: $0 ≤ x < m$, $0 ≤ y < n$, sendo que $x$ e $y$ são números inteiros }
|
||||
|
||||
An Eulerian cycle on E(m,n) is a closed path that passes through each arc exactly once. Many such paths are possible on E(m,n), but we are only interested in those which are not self-crossing: A non-crossing path just touches itself at lattice points, but it never crosses itself.
|
||||
Um ciclo euleriano em $E(m,n)$ é um caminho fechado que passa por cada arco exatamente uma vez. Muitos caminhos são possíveis em $E(m,n)$, mas apenas nos interessamos por aqueles que não são cruzam a si mesmos: um caminho que não cruze a si mesmo apenas toca nos pontos da rede, mas nunca cruza a si mesmo.
|
||||
|
||||
The image below shows E(3,3) and an example of an Eulerian non-crossing path.
|
||||
A imagem abaixo mostra $E(3,3)$ e um exemplo de um caminho que euleriano sem cruzamentos.
|
||||
|
||||
Let L(m,n) be the number of Eulerian non-crossing paths on E(m,n). For example, L(1,2) = 2, L(2,2) = 37 and L(3,3) = 104290.
|
||||
<img class="img-responsive center-block" alt="ciclo Euleriano (3, 3) e caminho euleriano sem cruzamento" src="https://cdn.freecodecamp.org/curriculum/project-euler/eulerian-cycles.gif" style="background-color: white; padding: 10px;" />
|
||||
|
||||
Find L(6,10) mod 1010.
|
||||
Considere $L(m,n)$ como o número de caminhos eulerianos sem cruzamento em $E(m,n)$. Por exemplo, $L(1,2) = 2$, $L(2,2) = 37$ e $L(3,3) = 104290$.
|
||||
|
||||
Encontre $L(6,10)\bmod {10}^{10}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler289()` should return 6567944538.
|
||||
`eulerianCycles()` deve retornar `6567944538`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler289(), 6567944538);
|
||||
assert.strictEqual(eulerianCycles(), 6567944538);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -33,12 +35,12 @@ assert.strictEqual(euler289(), 6567944538);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler289() {
|
||||
function eulerianCycles() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler289();
|
||||
eulerianCycles();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f48f1000cf542c50ffa1
|
||||
title: 'Problem 290: Digital Signature'
|
||||
title: 'Problema 290: Assinatura digital'
|
||||
challengeType: 5
|
||||
forumTopicId: 301942
|
||||
dashedName: problem-290-digital-signature
|
||||
@ -8,14 +8,14 @@ dashedName: problem-290-digital-signature
|
||||
|
||||
# --description--
|
||||
|
||||
How many integers 0 ≤ n < 1018 have the property that the sum of the digits of n equals the sum of digits of 137n?
|
||||
Quantos números inteiro $0 ≤ n < {10}^{18}$ têm a propriedade de que a soma dos algarismos de $n$ é igual à soma dos algarismos de $137n$?
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler290()` should return 20444710234716470.
|
||||
`digitalSignature()` deve retornar `20444710234716470`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler290(), 20444710234716470);
|
||||
assert.strictEqual(digitalSignature(), 20444710234716470);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -23,12 +23,12 @@ assert.strictEqual(euler290(), 20444710234716470);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler290() {
|
||||
function digitalSignature() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler290();
|
||||
digitalSignature();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
Reference in New Issue
Block a user