From 2ef9ecfb4d61386a178f59aa2d74a6b8a4bc8593 Mon Sep 17 00:00:00 2001 From: camperbot Date: Mon, 22 Nov 2021 09:25:21 -0800 Subject: [PATCH] chore(i18n,curriculum): update translations (#44227) --- ...a-more-complex-shape-using-css-and-html.md | 2 +- ...create-complex-multi-dimensional-arrays.md | 2 +- .../handle-a-disconnect.md | 16 +++---- .../how-to-put-a-profile-together.md | 14 +++--- .../how-to-use-passport-strategies.md | 18 ++++---- ...create-complex-multi-dimensional-arrays.md | 2 +- .../project-euler/problem-227-the-chase.md | 2 +- ...em-341-golombs-self-describing-sequence.md | 20 +++++---- ...m-342-the-totient-of-a-square-is-a-cube.md | 19 ++++---- .../problem-343-fractional-sequences.md | 31 +++++++------ .../problem-344-silver-dollar-game.md | 30 +++++++------ .../project-euler/problem-345-matrix-sum.md | 20 +++++---- .../problem-346-strong-repunits.md | 16 +++---- ...largest-integer-divisible-by-two-primes.md | 22 +++++----- .../problem-348-sum-of-a-square-and-a-cube.md | 20 +++++---- .../project-euler/problem-349-langtons-ant.md | 21 +++++---- ...e-least-greatest-and-the-greatest-least.md | 22 +++++----- .../problem-351-hexagonal-orchards.md | 22 +++++----- .../project-euler/problem-352-blood-tests.md | 44 ++++++++++++------- .../project-euler/problem-353-risky-moon.md | 28 ++++++------ ...oblem-354-distances-in-a-bees-honeycomb.md | 20 +++++---- .../problem-355-maximal-coprime-subset.md | 16 +++---- ...-356-largest-roots-of-cubic-polynomials.md | 18 ++++---- .../problem-357-prime-generating-integers.md | 16 +++---- .../problem-358-cyclic-numbers.md | 26 ++++++----- .../problem-359-hilberts-new-hotel.md | 33 +++++++++----- .../project-euler/problem-360-scary-sphere.md | 22 ++++++---- 27 files changed, 285 insertions(+), 237 deletions(-) diff --git a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md index 9c4e065285..6238a7b761 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md @@ -9,7 +9,7 @@ dashedName: create-a-more-complex-shape-using-css-and-html # --description-- -Una de las formas más populares en el mundo es la forma del corazón, y en este desafío crearás una usando CSS puro. Pero primero, debes comprender los pseudo-elements `::before` y `::after`. Estos pseudo-elements se utilizan para agregar algo antes o después de un elemento seleccionado. En el siguiente ejemplo, se utiliza un pseudo-elemento `::before` para agregar un rectángulo a un elemento con la clase `heart`: +Una de las formas más populares en el mundo es la forma del corazón, y en este desafío crearás una usando CSS puro. Pero primero, debes comprender los pseudo-elements `::before` y `::after`. ::before crea un pseudo-elemento que es el primer hijo del elemento seleccionado; ::after crea un pseudo-elemento que es el último hijo del elemento seleccionado. En el siguiente ejemplo, se utiliza un pseudo-elemento `::before` para agregar un rectángulo a un elemento con la clase `heart`: ```css .heart::before { diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md index 3f90d32edf..eb5f72a7fc 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md @@ -10,7 +10,7 @@ dashedName: create-complex-multi-dimensional-arrays ¡Fantástico! ¡Acabas de aprender un montón sobre arreglos! Esta ha sido una visión general de alto nivel, y hay mucho más que aprender sobre el trabajo con arreglos, mucho de lo cual verás en secciones posteriores. Pero antes de pasar a ver los Objetos, vamos a echar un vistazo más, y ver cómo los arreglos pueden llegar a ser un poco más complejos de lo que hemos visto en los desafíos anteriores. -Una de las características más poderosas cuando se piensa en los arreglos como estructuras de datos, es que los arreglos pueden contener, o incluso estar completamente formados por otros arreglos. Hemos visto arreglos que contienen arreglos en desafíos anteriores, pero bastante simples. Sin embargo, los arreglos pueden contener una profundidad infinita de arreglos que pueden contener otros arreglos, cada uno con sus propios niveles arbitrarios de profundidad, y así sucesivamente. De esta manera, un arreglo puede convertirse rápidamente en una estructura de datos muy compleja, conocida como multidimensional, o arreglo anidado. Considera el siguiente ejemplo: +Una de las características más poderosas cuando se piensa en los arreglos como estructuras de datos, es que los arreglos pueden contener, o incluso estar completamente formados por otros arreglos. Hemos visto arreglos que contienen arreglos en desafíos anteriores, pero bastante simples. Sin embargo, los arreglos pueden contener una profundidad infinita de arreglos que pueden contener otros arreglos, cada uno con sus propios niveles arbitrarios de profundidad, y así sucesivamente. De esta manera, un arreglo puede convertirse rápidamente en una estructura de datos muy compleja, conocido como multidimensional, o arreglo anidado. Considera el siguiente ejemplo: ```js let nestedArray = [ diff --git a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md index 2873c18ff2..899c56507a 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md +++ b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md @@ -1,6 +1,6 @@ --- id: 589fc831f9fc0f352b528e76 -title: Handle a Disconnect +title: Maneja una desconexión challengeType: 2 forumTopicId: 301552 dashedName: handle-a-disconnect @@ -8,9 +8,9 @@ dashedName: handle-a-disconnect # --description-- -You may notice that up to now you have only been increasing the user count. Handling a user disconnecting is just as easy as handling the initial connect, except you have to listen for it on each socket instead of on the whole server. +Puedes observar que hasta ahora sólo has aumentado el recuento de usuarios. Manejar la desconexión de un usuario es tan fácil como manejar la conexión inicial, excepto que tienes que escucharlo en cada socket en lugar de en todo el servidor. -To do this, add another listener inside the existing `'connect'` listener that listens for `'disconnect'` on the socket with no data passed through. You can test this functionality by just logging that a user has disconnected to the console. +Para ello, añade otro oyente (listener) dentro del oyente existente `'connect'` que escuche `'disconnect'` en el socket sin que pasen datos. Puedes probar esta funcionalidad simplemente registrando que un usuario se ha desconectado en la consola. ```js socket.on('disconnect', () => { @@ -18,15 +18,15 @@ socket.on('disconnect', () => { }); ``` -To make sure clients continuously have the updated count of current users, you should decrease the currentUsers by 1 when the disconnect happens then emit the 'user count' event with the updated count! +Para asegurarse de que los clientes tienen continuamente el recuento actualizado de los usuarios actuales, ¡debes disminuir el currentUsers en 1 cuando se produce la desconexión y luego emitir el evento 'user count' con el recuento actualizado! -**Note:** Just like `'disconnect'`, all other events that a socket can emit to the server should be handled within the connecting listener where we have 'socket' defined. +**Nota:** Al igual que `'disconnect'`, todos los demás eventos que un socket puede emitir al servidor deben ser manejados dentro del oyente de conexión donde tenemos definido 'socket'. -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/ab1007b76069884fb45b215d3c4496fa). +Envía tu página cuando creas que lo has hecho bien. Si te encuentras con errores, puedes revisar el proyecto completado hasta este punto [aquí](https://gist.github.com/camperbot/ab1007b76069884fb45b215d3c4496fa). # --hints-- -Server should handle the event disconnect from a socket. +El servidor debe manejar la desconexión del evento de un socket. ```js (getUserInput) => @@ -40,7 +40,7 @@ Server should handle the event disconnect from a socket. ); ``` -Your client should be listening for 'user count' event. +Tu cliente debe estar escuchando el evento 'user count'. ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-put-a-profile-together.md b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-put-a-profile-together.md index bd17bbb9a6..aa721ea089 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-put-a-profile-together.md +++ b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-put-a-profile-together.md @@ -1,6 +1,6 @@ --- id: 5895f70ef9fc0f352b528e6b -title: How to Put a Profile Together +title: Cómo elaborar un perfil challengeType: 2 forumTopicId: 301554 dashedName: how-to-put-a-profile-together @@ -8,27 +8,27 @@ dashedName: how-to-put-a-profile-together # --description-- -Now that we can ensure the user accessing the `/profile` is authenticated, we can use the information contained in `req.user` on our page! +Ahora que podemos asegurarnos de que el usuario que accede al `/profile` está autenticado, ¡podemos utilizar la información contenida en `req.user` en nuestra página! -Pass an object containing the property `username` and value of `req.user.username` as the second argument for the render method of the profile view. Then, go to your `profile.pug` view, and add the following line below the existing `h1` element, and at the same level of indentation: +Pasa un objeto que contenga la propiedad `username` y el valor de `req.user.username` como segundo argumento para el método render de la vista de perfil. Luego, ve a tu perfil `profile.pug` y agrega la siguiente línea debajo del elemento existente `h1` y al mismo nivel de indentación: ```pug h2.center#welcome Welcome, #{username}! ``` -This creates an `h2` element with the class '`center`' and id '`welcome`' containing the text '`Welcome,`' followed by the username. +Esto crea un elemento `h2` con la clase '`center`' e id '`welcome`' conteniendo el texto '`Welcome,`' seguido por el nombre de usuario. -Also, in `profile.pug`, add a link referring to the `/logout` route, which will host the logic to unauthenticate a user. +Además, en `profile.pug`, añade un enlace que haga referencia a la ruta `/logout`, que alojará la lógica para des-autentificar a un usuario. ```pug a(href='/logout') Logout ``` -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/136b3ad611cc80b41cab6f74bb460f6a). +Envía tu página cuando creas que lo has hecho bien. Si te encuentras con errores, puedes revisar el proyecto completado hasta este punto [aquí](https://gist.github.com/camperbot/136b3ad611cc80b41cab6f74bb460f6a). # --hints-- -You should correctly add a Pug render variable to /profile. +Debes agregar correctamente una variable de renderizado Pug a /profile. ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md index ba78302a8c..d2fdb12364 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md +++ b/curriculum/challenges/espanol/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md @@ -1,6 +1,6 @@ --- id: 5895f70df9fc0f352b528e69 -title: How to Use Passport Strategies +title: Cómo utilizar las estrategias de Passport challengeType: 2 forumTopicId: 301555 dashedName: how-to-use-passport-strategies @@ -8,21 +8,21 @@ dashedName: how-to-use-passport-strategies # --description-- -In the `index.pug` file supplied, there is actually a login form. It has previously been hidden because of the inline JavaScript `if showLogin` with the form indented after it. Before `showLogin` as a variable was never defined, so it never rendered the code block containing the form. Go ahead and on the `res.render` for that page add a new variable to the object `showLogin: true`. When you refresh your page, you should then see the form! This form is set up to **POST** on `/login`, so this is where we should set up to accept the POST and authenticate the user. +En el archivo `index.pug` proporcionado, hay realmente un formulario de inicio de sesión. Anteriormente ha estado oculto debido al JavaScript inline `if showLogin` con el formulario indentado después de él. Antes `showLogin` como variable nunca se definía, por lo que nunca renderizaba el bloque de código que contenía el formulario. Sigue adelante y en el `res.render` de esa página añade una nueva variable al objeto `showLogin: true`. Cuando actualices la página, ¡deberías ver el formulario! Este formulario está configurado para hacer una petición **POST** en `/login`, así que aquí es donde debemos configurar para aceptar el POST y autentificar al usuario. -For this challenge you should add the route `/login` to accept a POST request. To authenticate on this route, you need to add a middleware to do so before then sending a response. This is done by just passing another argument with the middleware before your `function(req,res)` with your response! The middleware to use is `passport.authenticate('local')`. +Para este desafío debes añadir la ruta `/login` para aceptar una petición POST. Para autentificarse en esta ruta, es necesario añadir un middleware para hacerlo antes de enviar una respuesta. ¡Esto se hace simplemente pasando otro argumento con el middleware antes de tu `function(req,res)` con tu respuesta! El middleware a usar es `passport.authenticate('local')`. -`passport.authenticate` can also take some options as an argument such as: `{ failureRedirect: '/' }` which is incredibly useful, so be sure to add that in as well. The response after using the middleware (which will only be called if the authentication middleware passes) should be to redirect the user to `/profile` and that route should render the view `profile.pug`. +`passport.authenticate` también puede tomar algunas opciones como un argumento como: `{ failureRedirect: '/' }` que es increíblemente útil, así que asegúrate de añadirlo también. La respuesta después de usar el middleware (que sólo se llamará si el middleware de autentificación pasa) debe ser redirigir al usuario a `/profile` y esa ruta debe renderizar el perfil `profile.pug`. -If the authentication was successful, the user object will be saved in `req.user`. +Si la autentificación fue exitosa, el user object se guardará en `req.user`. -At this point, if you enter a username and password in the form, it should redirect to the home page `/`, and the console of your server should display `'User {USERNAME} attempted to log in.'`, since we currently cannot login a user who isn't registered. +En este punto, si introduces un nombre de usuario y una contraseña en el formulario, debe redirigirse a la página de inicio `/`, y la consola de tu servidor debe mostrar `'User {USERNAME} attempted to log in.'`, ya que actualmente no podemos iniciar la sesión de un usuario que no está registrado. -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/7ad011ac54612ad53188b500c5e99cb9). +Envía tu página cuando creas que lo has hecho bien. Si te encuentras con errores, puedes revisar el proyecto completado hasta este punto [aquí](https://gist.github.com/camperbot/7ad011ac54612ad53188b500c5e99cb9). # --hints-- -All steps should be correctly implemented in the server.js. +Todos los pasos deben ser correctamente implementados en el server.js. ```js (getUserInput) => @@ -50,7 +50,7 @@ All steps should be correctly implemented in the server.js. ); ``` -A POST request to /login should correctly redirect to /. +Una solicitud POST a /login debe redirigir correctamente a /. ```js (getUserInput) => diff --git a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md index 0748aa61d1..9c2a8f9e78 100644 --- a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md +++ b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.md @@ -10,7 +10,7 @@ dashedName: create-complex-multi-dimensional-arrays Excelente! Você acabou de aprender muito sobre arrays! Esta foi uma visão geral de nível bastante elevado, e há muito mais a aprender para trabalhar com arrays. Muitas dessas questões você verá em sessões posteriores. Mas antes de passarmos a examinar os objetos, vamos dar mais uma olhada e ver como os arrays podem se tornar um pouco mais complexos do que aquilo que vimos nos desafios anteriores. -Uma das características mais poderosas ao pensar em arrays como estruturas de dados é que arrays podem conter, ou mesmo ser completamente compostos por outros arrays. Vimos arrays que contêm arrays em desafios anteriores, mas que são bastante simples. No entanto, os arrays podem conter uma profundidade infinita de arrays que podem conter outros arrays, cada um com seus próprios níveis arbitrários de profundidade, e assim por diante. Desta forma, um array pode muito rapidamente se tornar uma estrutura de dados muito complexa, conhecida como array multidimensionalou array aninhado. Considere o seguinte exemplo: +Uma das características mais poderosas ao pensar em arrays como estruturas de dados é que arrays podem conter, ou mesmo ser completamente compostos por outros arrays. Vimos arrays que contêm arrays em desafios anteriores, mas que são bastante simples. No entanto, os arrays podem conter uma profundidade infinita de arrays que podem conter outros arrays, cada um com seus próprios níveis arbitrários de profundidade, e assim por diante. Desta forma, um array pode muito rapidamente se tornar uma estrutura de dados muito complexa, conhecida como array multidimensional ou array aninhado. Considere o seguinte exemplo: ```js let nestedArray = [ diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-227-the-chase.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-227-the-chase.md index b15665560d..4481044a9c 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-227-the-chase.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-227-the-chase.md @@ -27,7 +27,7 @@ Em um jogo com 100 jogadores, qual é o número esperado de turnos que dure o jo `theChase()` deve retornar `3780.618622`. ```js -assert.strictEqual(theChase(), 0.618622); +assert.strictEqual(theChase(), 3780.618622); ``` # --seed-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.md index 740ef0d751..7d7705ce06 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.md @@ -1,6 +1,6 @@ --- id: 5900f4c11000cf542c50ffd3 -title: 'Problem 341: Golomb''s self-describing sequence' +title: 'Problema 341: Sequência autodescritiva de Golomb' challengeType: 5 forumTopicId: 302000 dashedName: problem-341-golombs-self-describing-sequence @@ -8,20 +8,22 @@ dashedName: problem-341-golombs-self-describing-sequence # --description-- -The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are +A sequência autodescritiva de Golomb ($G(n)$) é a única sequência não decrescente de números naturais, tal que $n$ aparece exatamente $G(n)$ vezes na sequência. Os valores de $G(n)$ para os primeiros $n$ são -n123456789101112131415…G(n)122334445556666… +$$\begin{array}{c} n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & \ldots \\\\ G(n) & 1 & 2 & 2 & 3 & 3 & 4 & 4 & 4 & 5 & 5 & 5 & 6 & 6 & 6 & 6 & \ldots \end{array}$$ -You are given that G(103) = 86, G(106) = 6137. You are also given that ΣG(n3) = 153506976 for 1 ≤ n < 103. +Você é informado de que $G({10}^3) = 86$, $G({10}^6) = 6137$. -Find ΣG(n3) for 1 ≤ n < 106. +Você também fica sabendo de que $\sum G(n^3) = 153.506.976$ para $1 ≤ n < {10}^3$. + +Encontre $\sum G(n^3)$ para $1 ≤ n < {10}^6$. # --hints-- -`euler341()` should return 56098610614277016. +`golombsSequence()` deve retornar `56098610614277016`. ```js -assert.strictEqual(euler341(), 56098610614277016); +assert.strictEqual(golombsSequence(), 56098610614277016); ``` # --seed-- @@ -29,12 +31,12 @@ assert.strictEqual(euler341(), 56098610614277016); ## --seed-contents-- ```js -function euler341() { +function golombsSequence() { return true; } -euler341(); +golombsSequence(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.md index 2253ce390f..3aaaaafd47 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.md @@ -1,6 +1,6 @@ --- id: 5900f4c31000cf542c50ffd5 -title: 'Problem 342: The totient of a square is a cube' +title: 'Problema 342: O totiente de um quadrado é um cubo' challengeType: 5 forumTopicId: 302001 dashedName: problem-342-the-totient-of-a-square-is-a-cube @@ -8,22 +8,21 @@ dashedName: problem-342-the-totient-of-a-square-is-a-cube # --description-- -Consider the number 50. +Considere o número 50. -502 = 2500 = 22 × 54, so φ(2500) = 2 × 4 × 53 = 8 × 53 = 23 × 53. 1 +${50}^2 = 2500 = 2^2 × 5^4$, então $φ(2500) = 2 × 4 × 5^3 = 8 × 5^3 = 2^3 × 5^3$. $φ$ é a função totiente de Euler. -So 2500 is a square and φ(2500) is a cube. +Portanto, 2500 é um quadrado e $φ(2500)$ é um cubo. -Find the sum of all numbers n, 1 < n < 1010 such that φ(n2) is a cube. +Encontre a soma de todos os números $n$, $1 < n < {10}^{10}$, tal que $φ(n^2)$ é um cubo. -1 φ denotes Euler's totient function. # --hints-- -`euler342()` should return 5943040885644. +`totientOfSquare()` deve retornar `5943040885644`. ```js -assert.strictEqual(euler342(), 5943040885644); +assert.strictEqual(totientOfSquare(), 5943040885644); ``` # --seed-- @@ -31,12 +30,12 @@ assert.strictEqual(euler342(), 5943040885644); ## --seed-contents-- ```js -function euler342() { +function totientOfSquare() { return true; } -euler342(); +totientOfSquare(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-343-fractional-sequences.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-343-fractional-sequences.md index 3102009e8c..411bcd3b18 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-343-fractional-sequences.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-343-fractional-sequences.md @@ -1,6 +1,6 @@ --- id: 5900f4c41000cf542c50ffd6 -title: 'Problem 343: Fractional Sequences' +title: 'Problema 343: Sequências fracionárias' challengeType: 5 forumTopicId: 302002 dashedName: problem-343-fractional-sequences @@ -8,32 +8,31 @@ dashedName: problem-343-fractional-sequences # --description-- -For any positive integer k, a finite sequence ai of fractions xi/yi is defined by: +Para qualquer número inteiro positivo $k$, uma sequência finita $a_i$ de frações $\frac{x_i}{y_i}$ é definida por: -a1 = 1/k and +- $a_1 = \displaystyle\frac{1}{k}$ e +- $a_i = \displaystyle\frac{(x_{i - 1} + 1)}{(y_{i - 1} - 1)}$ reduzida aos menores termos para $i > 1$. -ai = (xi-1+1)/(yi-1-1) reduced to lowest terms for i>1. +Quando $a_i$ alcança um número inteiro $n$, a sequência para. (Ou seja, quando $y_i = 1$.) -When ai reaches some integer n, the sequence stops. (That is, when yi=1.) +Defina $f(k) = n$. -Define f(k) = n. +Por exemplo, para $k = 20$: -For example, for k = 20: +$$\frac{1}{20} → \frac{2}{19} → \frac{3}{18} = \frac{1}{6} → \frac{2}{5} → \frac{3}{4} → \frac{4}{3} → \frac{5}{2} → \frac{6}{1} = 6$$ -1/20 → 2/19 → 3/18 = 1/6 → 2/5 → 3/4 → 4/3 → 5/2 → 6/1 = 6 +Então, $f(20) = 6$. -So f(20) = 6. +Além disso $f(1) = 1$, $f(2) = 2$, $f(3) = 1$ e $\sum f(k^3) = 118.937$ for $1 ≤ k ≤ 100$. -Also f(1) = 1, f(2) = 2, f(3) = 1 and Σf(k3) = 118937 for 1 ≤ k ≤ 100. - -Find Σf(k3) for 1 ≤ k ≤ 2×106. +Encontre $\sum f(k^3)$ para $1 ≤ k ≤ 2 × {10}^6$. # --hints-- -`euler343()` should return 269533451410884200. +`fractionalSequences()` deve retornar `269533451410884200`. ```js -assert.strictEqual(euler343(), 269533451410884200); +assert.strictEqual(fractionalSequences(), 269533451410884200); ``` # --seed-- @@ -41,12 +40,12 @@ assert.strictEqual(euler343(), 269533451410884200); ## --seed-contents-- ```js -function euler343() { +function fractionalSequences() { return true; } -euler343(); +fractionalSequences(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-344-silver-dollar-game.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-344-silver-dollar-game.md index f4fb768b65..9a289747ba 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-344-silver-dollar-game.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-344-silver-dollar-game.md @@ -1,6 +1,6 @@ --- id: 5900f4c51000cf542c50ffd7 -title: 'Problem 344: Silver dollar game' +title: 'Problema 344: Jogo do dólar de prata' challengeType: 5 forumTopicId: 302003 dashedName: problem-344-silver-dollar-game @@ -8,30 +8,32 @@ dashedName: problem-344-silver-dollar-game # --description-- -One variant of N.G. de Bruijn's silver dollar game can be described as follows: +O jogo de N.G. de Bruijn, conhecido como o jogo do dólar de prata, tem uma variante que pode ser descrita da seguinte forma: -On a strip of squares a number of coins are placed, at most one coin per square. Only one coin, called the silver dollar, has any value. Two players take turns making moves. At each turn a player must make either a regular or a special move. +Em uma faixa de quadrados, várias moedas são colocadas, estando, no máximo, uma moeda por quadrado. Apenas uma moeda, chamada de dólar de prata, tem qualquer valor. Dois jogadores se revezam fazendo movimentos. Em cada turno, um jogador deve fazer um movimento regular ou especial. -A regular move consists of selecting one coin and moving it one or more squares to the left. The coin cannot move out of the strip or jump on or over another coin. +Um movimento regular consiste em selecionar uma moeda e movê-la um ou mais quadrados para a esquerda. A moeda não pode se mover para fora da faixa, ou saltar sobre ou por cima de outra moeda. -Alternatively, the player can choose to make the special move of pocketing the leftmost coin rather than making a regular move. If no regular moves are possible, the player is forced to pocket the leftmost coin. +Como alternativa, o jogador pode escolher fazer o movimento especial de guardar a moeda mais à esquerda, em vez de fazer um movimento regular. Se nenhum movimento regular for possível, o jogador será forçado a guardar a moeda mais à esquerda. -The winner is the player who pockets the silver dollar. +O vencedor é o jogador que guarda o dólar de prata. -A winning configuration is an arrangement of coins on the strip where the first player can force a win no matter what the second player does. +jogo do dólar de prata -Let W(n,c) be the number of winning configurations for a strip of n squares, c worthless coins and one silver dollar. +Uma configuração vencedora é um arranjo de moedas na faixa onde o primeiro jogador pode forçar uma vitória, não importa o que o segundo jogador fizer. -You are given that W(10,2) = 324 and W(100,10) = 1514704946113500. +Considere $W(n, c)$ como o número de configurações vencedoras para uma faixa de $n$ quadrados, $c$ moedas sem valor e um dólar de prata. -Find W(1 000 000, 100) modulo the semiprime 1000 036 000 099 (= 1 000 003 · 1 000 033). +Você é informado de que $W(10, 2) = 324$ e $W(100, 10) = 1.514.704.946.113.500$. + +Encontre $W(1.000.000, 100)$ modulo o número semiprimo $1000.036.000.099 (= 1.000.003 \times 1.000.033)$. # --hints-- -`euler344()` should return 65579304332. +`silverDollarGame()` deve retornar `65579304332`. ```js -assert.strictEqual(euler344(), 65579304332); +assert.strictEqual(silverDollarGame(), 65579304332); ``` # --seed-- @@ -39,12 +41,12 @@ assert.strictEqual(euler344(), 65579304332); ## --seed-contents-- ```js -function euler344() { +function silverDollarGame() { return true; } -euler344(); +silverDollarGame(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-345-matrix-sum.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-345-matrix-sum.md index 9cb8157d07..5603798be3 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-345-matrix-sum.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-345-matrix-sum.md @@ -1,6 +1,6 @@ --- id: 5900f4c81000cf542c50ffda -title: 'Problem 345: Matrix Sum' +title: 'Problema 345: Soma interna da matriz' challengeType: 5 forumTopicId: 302004 dashedName: problem-345-matrix-sum @@ -8,20 +8,22 @@ dashedName: problem-345-matrix-sum # --description-- -We define the Matrix Sum of a matrix as the maximum sum of matrix elements with each element being the only one in his row and column. For example, the Matrix Sum of the matrix below equals 3315 ( = 863 + 383 + 343 + 959 + 767): +Definimos a soma interna da matriz como a soma máxima dos elementos da matriz com cada elemento sendo o único em sua linha e coluna. -7 53 183 439 863 497 383 563 79 973 287 63 343 169 583 627 343 773 959 943767 473 103 699 303 +Por exemplo, a soma interna da matriz abaixo é igual a $3315 ( = 863 + 383 + 343 + 959 + 767)$: -Find the Matrix Sum of: +$$\begin{array}{rrrrr} 7 & 53 & 183 & 439 & \color{lime}{863} \\\\ 497 & \color{lime}{383} & 563 & 79 & 973 \\\\ 287 & 63 & \color{lime}{343} & 169 & 583 \\\\ 627 & 343 & 773 & \color{lime}{959} & 943 \\\\ \color{lime}{767} & 473 & 103 & 699 & 303 \end{array}$$ -7 53 183 439 863 497 383 563 79 973 287 63 343 169 583 627 343 773 959 943 767 473 103 699 303 957 703 583 639 913 447 283 463 29 23 487 463 993 119 883 327 493 423 159 743 217 623 3 399 853 407 103 983 89 463 290 516 212 462 350 960 376 682 962 300 780 486 502 912 800 250 346 172 812 350 870 456 192 162 593 473 915 45 989 873 823 965 425 329 803 973 965 905 919 133 673 665 235 509 613 673 815 165 992 326 322 148 972 962 286 255 941 541 265 323 925 281 601 95 973 445 721 11 525 473 65 511 164 138 672 18 428 154 448 848 414 456 310 312 798 104 566 520 302 248 694 976 430 392 198 184 829 373 181 631 101 969 613 840 740 778 458 284 760 390 821 461 843 513 17 901 711 993 293 157 274 94 192 156 574 34 124 4 878 450 476 712 914 838 669 875 299 823 329 699 815 559 813 459 522 788 168 586 966 232 308 833 251 631 107 813 883 451 509 615 77 281 613 459 205 380 274 302 35 805 +Encontre a soma interna da matriz de: + +$$\\begin{array}{r} 7 & 53 & 183 & 439 & 863 & 497 & 383 & 563 & 79 & 973 & 287 & 63 & 343 & 169 & 583 \\\\ 627 & 343 & 773 & 959 & 943 & 767 & 473 & 103 & 699 & 303 & 957 & 703 & 583 & 639 & 913 \\\\ 447 & 283 & 463 & 29 & 23 & 487 & 463 & 993 & 119 & 883 & 327 & 493 & 423 & 159 & 743 \\\\ 217 & 623 & 3 & 399 & 853 & 407 & 103 & 983 & 89 & 463 & 290 & 516 & 212 & 462 & 350 \\\\ 960 & 376 & 682 & 962 & 300 & 780 & 486 & 502 & 912 & 800 & 250 & 346 & 172 & 812 & 350 \\\\ 870 & 456 & 192 & 162 & 593 & 473 & 915 & 45 & 989 & 873 & 823 & 965 & 425 & 329 & 803 \\\\ 973 & 965 & 905 & 919 & 133 & 673 & 665 & 235 & 509 & 613 & 673 & 815 & 165 & 992 & 326 \\\\ 322 & 148 & 972 & 962 & 286 & 255 & 941 & 541 & 265 & 323 & 925 & 281 & 601 & 95 & 973 \\\\ 445 & 721 & 11 & 525 & 473 & 65 & 511 & 164 & 138 & 672 & 18 & 428 & 154 & 448 & 848 \\\\ 414 & 456 & 310 & 312 & 798 & 104 & 566 & 520 & 302 & 248 & 694 & 976 & 430 & 392 & 198 \\\\ 184 & 829 & 373 & 181 & 631 & 101 & 969 & 613 & 840 & 740 & 778 & 458 & 284 & 760 & 390 \\\\ 821 & 461 & 843 & 513 & 17 & 901 & 711 & 993 & 293 & 157 & 274 & 94 & 192 & 156 & 574 \\\\ 34 & 124 & 4 & 878 & 450 & 476 & 712 & 914 & 838 & 669 & 875 & 299 & 823 & 329 & 699 \\\\ 815 & 559 & 813 & 459 & 522 & 788 & 168 & 586 & 966 & 232 & 308 & 833 & 251 & 631 & 107 \\\\ 813 & 883 & 451 & 509 & 615 & 77 & 281 & 613 & 459 & 205 & 380 & 274 & 302 & 35 & 805 \end{array}$$ # --hints-- -`euler345()` should return 13938. +`matrixSum()` deve retornar `13938`. ```js -assert.strictEqual(euler345(), 13938); +assert.strictEqual(matrixSum(), 13938); ``` # --seed-- @@ -29,12 +31,12 @@ assert.strictEqual(euler345(), 13938); ## --seed-contents-- ```js -function euler345() { +function matrixSum() { return true; } -euler345(); +matrixSum(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-346-strong-repunits.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-346-strong-repunits.md index 49a1f6b2c2..019834cfce 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-346-strong-repunits.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-346-strong-repunits.md @@ -1,6 +1,6 @@ --- id: 5900f4c71000cf542c50ffd8 -title: 'Problem 346: Strong Repunits' +title: 'Problema 346: Repunits fortes' challengeType: 5 forumTopicId: 302005 dashedName: problem-346-strong-repunits @@ -8,18 +8,18 @@ dashedName: problem-346-strong-repunits # --description-- -The number 7 is special, because 7 is 111 written in base 2, and 11 written in base 6 (i.e. 710 = 116 = 1112). In other words, 7 is a repunit in at least two bases b > 1. +O número 7 é especial, porque 7 é 111 escrito na base 2 e 11 escrito na base 6 (ou seja, $7_{10} = {11}_6 = {111}_2$). Em outras palavras, 7 é um repunit em pelo menos duas bases $b > 1$. -We shall call a positive integer with this property a strong repunit. It can be verified that there are 8 strong repunits below 50: {1,7,13,15,21,31,40,43}. Furthermore, the sum of all strong repunits below 1000 equals 15864. +Vamos chamar um número inteiro positivo com essa propriedade de um repunit forte. É possível verificar que há 8 repunits fortes abaixo de 50: {1, 7, 13, 15, 21, 31, 40, 43}. Além disso, a soma de todos os repunits fortes inferiores a 1000 é igual a 15864. -Find the sum of all strong repunits below 1012. +Encontre a soma de todos os repunits fortes abaixo de ${10}^{12}$. # --hints-- -`euler346()` should return 336108797689259260. +`strongRepunits()` deve retornar `336108797689259260`. ```js -assert.strictEqual(euler346(), 336108797689259260); +assert.strictEqual(strongRepunits(), 336108797689259260); ``` # --seed-- @@ -27,12 +27,12 @@ assert.strictEqual(euler346(), 336108797689259260); ## --seed-contents-- ```js -function euler346() { +function strongRepunits() { return true; } -euler346(); +strongRepunits(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.md index 70845508fa..b81aad257e 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.md @@ -1,6 +1,6 @@ --- id: 5900f4c81000cf542c50ffd9 -title: 'Problem 347: Largest integer divisible by two primes' +title: 'Problema 347: Maior número inteiro divisível por dois primos' challengeType: 5 forumTopicId: 302006 dashedName: problem-347-largest-integer-divisible-by-two-primes @@ -8,24 +8,24 @@ dashedName: problem-347-largest-integer-divisible-by-two-primes # --description-- -The largest integer ≤ 100 that is only divisible by both the primes 2 and 3 is 96, as 96=32\*3=25\*3. +O maior número inteiro $≤ 100$ que só é divisível pelos dois primos 2 e 3 é 96, como $96 = 32 \times 3 = 2^5 \times 3$. -For two distinct primes p and q let M(p,q,N) be the largest positive integer ≤N only divisible +Para dois primos distintos $p$ e $q$, considere $M(p, q, N)$ como o maior número inteiro positivo $≤ N$ divisível apenas por $p$ e $q$ e $M(p, q, N)=0$ se um número inteiro positivo como esse não existir. -by both p and q and M(p,q,N)=0 if such a positive integer does not exist. +Ex: $M(2, 3, 100) = 96$. -E.g. M(2,3,100)=96. M(3,5,100)=75 and not 90 because 90 is divisible by 2 ,3 and 5. Also M(2,73,100)=0 because there does not exist a positive integer ≤ 100 that is divisible by both 2 and 73. +$M(3, 5, 100) = 75$ e não 90, pois 90 é divisível por 2, 3 e 5. Além disso $M(2, 73, 100) = 0$, pois não existe um número positivo inteiro $≤ 100$ que seja divisível por 2 e por 73. -Let S(N) be the sum of all distinct M(p,q,N). S(100)=2262. +Considere $S(N)$ como a soma de todos os $M(p, q, N)$ distintos. $S(100)=2262$. -Find S(10 000 000). +Encontre $S(10.000.000)$. # --hints-- -`euler347()` should return 11109800204052. +`integerDivisibleByTwoPrimes()` deve retornar `11109800204052`. ```js -assert.strictEqual(euler347(), 11109800204052); +assert.strictEqual(integerDivisibleByTwoPrimes(), 11109800204052); ``` # --seed-- @@ -33,12 +33,12 @@ assert.strictEqual(euler347(), 11109800204052); ## --seed-contents-- ```js -function euler347() { +function integerDivisibleByTwoPrimes() { return true; } -euler347(); +integerDivisibleByTwoPrimes(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.md index 2fe6e2bc13..98b506b5d9 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.md @@ -1,6 +1,6 @@ --- id: 5900f4c81000cf542c50ffdb -title: 'Problem 348: Sum of a square and a cube' +title: 'Problema 348: Soma de um quadrado e de um cubo' challengeType: 5 forumTopicId: 302007 dashedName: problem-348-sum-of-a-square-and-a-cube @@ -8,18 +8,22 @@ dashedName: problem-348-sum-of-a-square-and-a-cube # --description-- -Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way. +Muitos números podem ser expressos como a soma de um quadrado e um cubo. Alguns deles de mais de uma forma. -Consider the palindromic numbers that can be expressed as the sum of a square and a cube, both greater than 1, in exactly 4 different ways. For example, 5229225 is a palindromic number and it can be expressed in exactly 4 different ways: 22852 + 203 22232 + 663 18102 + 1253 11972 + 1563 +Considere os números palíndromos que podem ser expressos como a soma de um quadrado e um cubo, ambos maiores do que 1, em exatamente 4 formas diferentes. -Find the sum of the five smallest such palindromic numbers. +Por exemplo, 5229225 é um número palíndromo e pode ser expresso de exatamente 4 formas diferentes: + +$$\begin{align} & {2285}^2 + {20}^3 \\\\ & {2223}^2 + {66}^3 \\\\ & {1810}^2 + {125}^3 \\\\ & {1197}^2 + {156}^3 \end{align}$$ + +Encontre a soma dos cinco menores números palíndromos deste tipo. # --hints-- -`euler348()` should return 1004195061. +`sumOfSquareAndCube()` deve retornar `1004195061`. ```js -assert.strictEqual(euler348(), 1004195061); +assert.strictEqual(sumOfSquareAndCube(), 1004195061); ``` # --seed-- @@ -27,12 +31,12 @@ assert.strictEqual(euler348(), 1004195061); ## --seed-contents-- ```js -function euler348() { +function sumOfSquareAndCube() { return true; } -euler348(); +sumOfSquareAndCube(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-349-langtons-ant.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-349-langtons-ant.md index 239ba5a6a1..b5bda991c6 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-349-langtons-ant.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-349-langtons-ant.md @@ -1,6 +1,6 @@ --- id: 5900f4ca1000cf542c50ffdc -title: 'Problem 349: Langton''s ant' +title: 'Problema 349: Formiga de Langton' challengeType: 5 forumTopicId: 302008 dashedName: problem-349-langtons-ant @@ -8,22 +8,21 @@ dashedName: problem-349-langtons-ant # --description-- -An ant moves on a regular grid of squares that are coloured either black or white. +Uma formiga se move em uma grade regular de quadrados coloridos em preto ou branco. -The ant is always oriented in one of the cardinal directions (left, right, up or down) and moves from square to adjacent square according to the following rules: +A formiga está sempre orientada em uma das direções cardeais (esquerda, direita, para cima ou para baixo) e se move do quadrado para um quadrado adjacente de acordo com as seguintes regras: -\- if it is on a black square, it flips the color of the square to white, rotates 90 degrees counterclockwise and moves forward one square. +- se estiver em um quadrado preto, ela transforma a cor do quadrado para branco, gira 90° no sentido anti-horário e avança um quadrado. +- se estiver em um quadrado branco, ela transforma a cor do quadrado para preto, gira 90° no sentido horário e avança um quadrado. -\- if it is on a white square, it flips the color of the square to black, rotates 90 degrees clockwise and moves forward one square. - -Starting with a grid that is entirely white, how many squares are black after 1018 moves of the ant? +Começando com uma grade que é inteiramente branca, quantos quadrados são pretos após ${10}^{18}$ movimentos da formiga? # --hints-- -`euler349()` should return 115384615384614940. +`langtonsAnt()` deve retornar `115384615384614940`. ```js -assert.strictEqual(euler349(), 115384615384614940); +assert.strictEqual(langtonsAnt(), 115384615384614940); ``` # --seed-- @@ -31,12 +30,12 @@ assert.strictEqual(euler349(), 115384615384614940); ## --seed-contents-- ```js -function euler349() { +function langtonsAnt() { return true; } -euler349(); +langtonsAnt(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.md index ebc52998b5..f59e83381f 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.md @@ -1,6 +1,6 @@ --- id: 5900f4cb1000cf542c50ffdd -title: 'Problem 350: Constraining the least greatest and the greatest least' +title: 'Problema 350: Restringindo o menor máximo e o maior mínimo' challengeType: 5 forumTopicId: 302010 dashedName: problem-350-constraining-the-least-greatest-and-the-greatest-least @@ -8,24 +8,24 @@ dashedName: problem-350-constraining-the-least-greatest-and-the-greatest-least # --description-- -A list of size n is a sequence of n natural numbers. Examples are (2,4,6), (2,6,4), (10,6,15,6), and (11). +Uma lista de tamanho $n$ é uma sequência de $n$ números naturais. Os exemplos são (2, 4, 6), (2, 6, 4), (10, 6, 15, 6) e (11). -The greatest common divisor, or gcd, of a list is the largest natural number that divides all entries of the list. Examples: gcd(2,6,4) = 2, gcd(10,6,15,6) = 1 and gcd(11) = 11. +O maior divisor comum, ou $gcd$, de uma lista é o maior número natural que divide todas as entradas da lista. Exemplos: $gcd(2, 6, 4) = 2$, $gcd(10, 6, 15, 6) = 1$ e $gcd(11) = 11$. -The least common multiple, or lcm, of a list is the smallest natural number divisible by each entry of the list. Examples: lcm(2,6,4) = 12, lcm(10,6,15,6) = 30 and lcm(11) = 11. +O mínimo múltiplo comum, ou $lcm$, de uma lista é o menor número natural divisível por cada entradas da lista. Exemplos: $lcm(2, 6, 4) = 12$, $lcm(10, 6, 15, 6) = 30$ e $lcm(11) = 11$. -Let f(G, L, N) be the number of lists of size N with gcd ≥ G and lcm ≤ L. For example: +Considere $f(G, L, N)$ como o número de listas de tamanho $N$ com $gcd ≥ G$ e $lcm ≤ L$. Por exemplo: -f(10, 100, 1) = 91. f(10, 100, 2) = 327. f(10, 100, 3) = 1135. f(10, 100, 1000) mod 1014 = 3286053. +$$\begin{align} & f(10, 100, 1) = 91 \\\\ & f(10, 100, 2) = 327 \\\\ & f(10, 100, 3) = 1135 \\\\ & f(10, 100, 1000)\bmod {101}^4 = 3.286.053 \end{align}$$ -Find f(106, 1012, 1018) mod 1014. +Encontre $f({10}^6, {10}^{12}, {10}^{18})\bmod {101}^4$. # --hints-- -`euler350()` should return 84664213. +`leastGreatestAndGreatestLeast()` deve retornar `84664213`. ```js -assert.strictEqual(euler350(), 84664213); +assert.strictEqual(leastGreatestAndGreatestLeast(), 84664213); ``` # --seed-- @@ -33,12 +33,12 @@ assert.strictEqual(euler350(), 84664213); ## --seed-contents-- ```js -function euler350() { +function leastGreatestAndGreatestLeast() { return true; } -euler350(); +leastGreatestAndGreatestLeast(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.md index 33f0089171..e8deb60d12 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.md @@ -1,6 +1,6 @@ --- id: 5900f4cb1000cf542c50ffde -title: 'Problem 351: Hexagonal orchards' +title: 'Problema 351: Pomares hexagonais' challengeType: 5 forumTopicId: 302011 dashedName: problem-351-hexagonal-orchards @@ -8,22 +8,24 @@ dashedName: problem-351-hexagonal-orchards # --description-- -A hexagonal orchard of order n is a triangular lattice made up of points within a regular hexagon with side n. The following is an example of a hexagonal orchard of order 5: +Um pomar hexagonal de ordem $n$ é uma rede triangular, composta de pontos dentro de um hexágono regular com o lado $n$. Abaixo vemos um exemplo de pomar hexagonal da ordem 5: -Highlighted in green are the points which are hidden from the center by a point closer to it. It can be seen that for a hexagonal orchard of order 5, 30 points are hidden from the center. +pomar hexagonal de ordem 5, com pontos verdes em destaque, que são escondidos do centro por um ponto mais próximo dele -Let H(n) be the number of points hidden from the center in a hexagonal orchard of order n. +O destaque em verde são os pontos que ficam ocultados do centro por um ponto mais próximo dele. Pode-se ver que, para um pomar hexagonal da ordem 5, 30 pontos estão escondidos do centro. -H(5) = 30. H(10) = 138. H(1 000) = 1177848. +Considere $H(n)$ como o número de pontos escondidos do centro em um pomar hexagonal de ordem $n$. -Find H(100 000 000). +$H(5) = 30$. $H(10) = 138$. $H(1.000)$ = $1.177.848$. + +Encontre $H(100.000.000)$. # --hints-- -`euler351()` should return 11762187201804552. +`hexagonalOrchards()` deve retornar `11762187201804552`. ```js -assert.strictEqual(euler351(), 11762187201804552); +assert.strictEqual(hexagonalOrchards(), 11762187201804552); ``` # --seed-- @@ -31,12 +33,12 @@ assert.strictEqual(euler351(), 11762187201804552); ## --seed-contents-- ```js -function euler351() { +function hexagonalOrchards() { return true; } -euler351(); +hexagonalOrchards(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-352-blood-tests.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-352-blood-tests.md index 76af2f075c..3116e24937 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-352-blood-tests.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-352-blood-tests.md @@ -1,6 +1,6 @@ --- id: 5900f4cd1000cf542c50ffdf -title: 'Problem 352: Blood tests' +title: 'Problema 352: Testes sanguíneos' challengeType: 5 forumTopicId: 302012 dashedName: problem-352-blood-tests @@ -8,32 +8,46 @@ dashedName: problem-352-blood-tests # --description-- -Each one of the 25 sheep in a flock must be tested for a rare virus, known to affect 2% of the sheep population. +Cada uma das 25 ovelhas que se encontram em um rebanho tem de ser testada para um vírus raro, conhecido por afetar 2% da população de ovinos. -An accurate and extremely sensitive PCR test exists for blood samples, producing a clear positive / negative result, but it is very time-consuming and expensive. +Existe um teste de PCR preciso e extremamente sensível para amostras de sangue, produzindo um resultado claramente positivo/negativo, mas é muito demorado e caro. -Because of the high cost, the vet-in-charge suggests that instead of performing 25 separate tests, the following procedure can be used instead: The sheep are split into 5 groups of 5 sheep in each group. For each group, the 5 samples are mixed together and a single test is performed. Then, If the result is negative, all the sheep in that group are deemed to be virus-free. If the result is positive, 5 additional tests will be performed (a separate test for each animal) to determine the affected individual(s). +Devido ao alto custo, a veterinária encarregada sugere que, em vez de executar 25 testes separados, o seguinte procedimento seja usado: -Since the probability of infection for any specific animal is only 0.02, the first test (on the pooled samples) for each group will be: Negative (and no more tests needed) with probability 0.985 = 0.9039207968. Positive (5 additional tests needed) with probability 1 - 0.9039207968 = 0.0960792032. +As ovelhas são divididas em 5 grupos de 5 ovelhas em cada grupo. Para cada grupo, as 5 amostras são misturadas e realiza-se um único teste. Então, -Thus, the expected number of tests for each group is 1 + 0.0960792032 × 5 = 1.480396016. Consequently, all 5 groups can be screened using an average of only 1.480396016 × 5 = 7.40198008 tests, which represents a huge saving of more than 70% ! +- Se o resultado for negativo, todas as ovelhas desse grupo são consideradas sem vírus. +- Se o resultado for positivo, serão realizados 5 testes adicionais (um teste separado para cada animal) para determinar o(s) indivíduo(s). -Although the scheme we have just described seems to be very efficient, it can still be improved considerably (always assuming that the test is sufficiently sensitive and that there are no adverse effects caused by mixing different samples). E.g.: We may start by running a test on a mixture of all the 25 samples. It can be verified that in about 60.35% of the cases this test will be negative, thus no more tests will be needed. Further testing will only be required for the remaining 39.65% of the cases. If we know that at least one animal in a group of 5 is infected and the first 4 individual tests come out negative, there is no need to run a test on the fifth animal (we know that it must be infected). We can try a different number of groups / different number of animals in each group, adjusting those numbers at each level so that the total expected number of tests will be minimised. +Como a probabilidade de infecção para qualquer animal específico é de apenas 0,02, o primeiro teste (nas amostras em conjunto) de cada grupo será: -To simplify the very wide range of possibilities, there is one restriction we place when devising the most cost-efficient testing scheme: whenever we start with a mixed sample, all the sheep contributing to that sample must be fully screened (i.e. a verdict of infected / virus-free must be reached for all of them) before we start examining any other animals. +- Negativo (e sem mais testes necessários) com probabilidade ${0.98}^5 = 0.9039207968$. +- Positivo (5 testes adicionais necessários) com probabilidade $1 - 0.9039207968 = 0.0960792032$. -For the current example, it turns out that the most cost-efficient testing scheme (we'll call it the optimal strategy) requires an average of just 4.155452 tests! +Assim, o número esperado de testes para cada grupo é $1 + 0.0960792032 × 5 = 1.480396016$. -Using the optimal strategy, let T(s,p) represent the average number of tests needed to screen a flock of s sheep for a virus having probability p to be present in any individual. Thus, rounded to six decimal places, T(25, 0.02) = 4.155452 and T(25, 0.10) = 12.702124. +Consequentemente, todos os 5 grupos podem ser avaliados com uma média de apenas US$1.480396016 × 5 = \mathbf{7.40198008}$ testes, o que representa uma grande economia de mais de 70%! -Find ΣT(10000, p) for p=0.01, 0.02, 0.03, ... 0.50. Give your answer rounded to six decimal places. +Embora o regime que acabamos de descrever pareça muito eficiente, ele ainda pode ser melhorado consideravelmente (partindo sempre do princípio de que o teste é suficientemente sensível e que não há efeitos adversos causados pela mistura de amostras diferentes). Ex: + +- Podemos começar por fazer um teste com uma mistura de todas as 25 amostras. É possível verificar que em cerca de 60,35% dos casos este teste será negativo, pelo que não serão necessários mais testes. Só serão necessários mais testes para os 39,65% restantes dos casos. +- Se sabemos que pelo menos um animal em um grupo de 5 é infectado e que os 4 primeiros testes individuais são negativos, não há necessidade de realizar um ensaio no quinto animal (sabemos que deve ser infectado). +- Podemos tentar um número diferente de grupos/um número diferente de animais em cada grupo, ajustando esses números a cada nível para que o número total esperado de testes seja minimizado. + +Para simplificar a vasta gama de possibilidades, há uma restrição que impomos ao criar o esquema de testes mais econômico: sempre que começamos com uma amostra mista, todas as ovelhas que contribuem para essa amostra devem ser totalmente testadas (ou seja, é preciso chegar a um veredito sobre ela estar infectada/sem vírus) antes de começarmos a examinar qualquer outro animal. + +Para o exemplo atual, ocorre que o esquema de testes mais econômico (chamamos isso de estratégia ideal) requer uma média de apenas 4,155452 testes! + +Usando a estratégia ideal, considere $T(s, p)$ como representando o número médio de testes necessários para analisar um rebanho de $s$ ovelhas para o vírus, com a probabilidade de $p$ de o vírus estar presente em qualquer indivíduo. Assim, arredondado para seis casas decimais, $T(25, 0,02) = 4,155452$ e $T(25, 0,10) = 12,702124$. + +Encontre $\sum T(10.000, p)$ para $p = 0.01, 0.02, 0.03, \ldots 0.50$. Dê sua resposta arredondada para seis casas decimais. # --hints-- -`euler352()` should return 378563.260589. +`bloodTests()` deve retornar `378563.260589`. ```js -assert.strictEqual(euler352(), 378563.260589); +assert.strictEqual(bloodTests(), 378563.260589); ``` # --seed-- @@ -41,12 +55,12 @@ assert.strictEqual(euler352(), 378563.260589); ## --seed-contents-- ```js -function euler352() { +function bloodTests() { return true; } -euler352(); +bloodTests(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-353-risky-moon.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-353-risky-moon.md index 74faf24c26..b682be0a76 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-353-risky-moon.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-353-risky-moon.md @@ -1,6 +1,6 @@ --- id: 5900f4cd1000cf542c50ffe0 -title: 'Problem 353: Risky moon' +title: 'Problema 353: Lua perigosa' challengeType: 5 forumTopicId: 302013 dashedName: problem-353-risky-moon @@ -8,28 +8,30 @@ dashedName: problem-353-risky-moon # --description-- -A moon could be described by the sphere C(r) with centre (0,0,0) and radius r. +Uma lua poderia ser descrita pela esfera $C(r)$ com centro (0, 0, 0) e raio $r$. -There are stations on the moon at the points on the surface of C(r) with integer coordinates. The station at (0,0,r) is called North Pole station, the station at (0,0,-r) is called South Pole station. +Há estações na lua em pontos na superfície de $C(r)$ com coordenadas em números inteiros. A estação em (0, 0, $r$) é chamada de estação do Polo Norte, enquanto a estação em (0, 0, $-r$) é chamada de estação do Polo Sul. -All stations are connected with each other via the shortest road on the great arc through the stations. A journey between two stations is risky. If d is the length of the road between two stations, (d/(π r))2 is a measure for the risk of the journey (let us call it the risk of the road). If the journey includes more than two stations, the risk of the journey is the sum of risks of the used roads. +Todas as estações estão ligadas entre si através da estrada mais curta no grande arco que passa pelas estações. Uma jornada entre duas estações é arriscada. Se $d$ é o comprimento da estrada entre duas estações, $\{\left(\frac{d}{πr}\right)}^2$ é uma medida para o risco da jornada (vamos chamá-la de risco da estrada). Se a viagem inclui mais de duas estações, o risco da viagem é a soma dos riscos das estradas utilizadas. -A direct journey from the North Pole station to the South Pole station has the length πr and risk 1. The journey from the North Pole station to the South Pole station via (0,r,0) has the same length, but a smaller risk: (½πr/(πr))2+(½πr/(πr))2=0.5. +Uma jornada direta da estação do Polo Norte para a estação do Polo Sul tem o comprimento $πr$ e o risco 1. A viagem da estação do Polo Norte para a estação do Polo do Sul via (0, $r$, 0) tem o mesmo comprimento, mas um risco menor: -The minimal risk of a journey from the North Pole station to the South Pole station on C(r) is M(r). +$${\left(\frac{\frac{1}{2}πr}{πr}\right)}^2+{\left(\frac{\frac{1}{2}πr}{πr}\right)}^2 = 0.5$$ -You are given that M(7)=0.1784943998 rounded to 10 digits behind the decimal point. +O risco mínimo de uma jornada da estação do Polo Norte até a estação do Polo Sul em $C(r)$ é $M(r)$. -Find ∑M(2n-1) for 1≤n≤15. +Você é informado que $M(7) = 0.1784943998$ arredondado para 10 casas depois da vírgula. -Give your answer rounded to 10 digits behind the decimal point in the form a.bcdefghijk. +Encontre $\displaystyle\sum_{n = 1}^{15} M(2^n - 1)$. + +Arredonde sua resposta para até 10 casas depois da vírgula usando o formato a.bcdefghijk. # --hints-- -`euler353()` should return 1.2759860331. +`riskyMoon()` deve retornar `1.2759860331`. ```js -assert.strictEqual(euler353(), 1.2759860331); +assert.strictEqual(riskyMoon(), 1.2759860331); ``` # --seed-- @@ -37,12 +39,12 @@ assert.strictEqual(euler353(), 1.2759860331); ## --seed-contents-- ```js -function euler353() { +function riskyMoon() { return true; } -euler353(); +riskyMoon(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.md index 346a1af451..3850d1353a 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.md @@ -1,6 +1,6 @@ --- id: 5900f4cf1000cf542c50ffe1 -title: 'Problem 354: Distances in a bee''s honeycomb' +title: 'Problema 354: Distâncias em uma colmeia de abelhas' challengeType: 5 forumTopicId: 302014 dashedName: problem-354-distances-in-a-bees-honeycomb @@ -8,18 +8,22 @@ dashedName: problem-354-distances-in-a-bees-honeycomb # --description-- -Consider a honey bee's honeycomb where each cell is a perfect regular hexagon with side length 1. +Considere uma colmeia de abelhas onde cada célula é um hexágono regular perfeito com o comprimento de lado 1. -One particular cell is occupied by the queen bee. For a positive real number L, let B(L) count the cells with distance L from the queen bee cell (all distances are measured from centre to centre); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider. For example, B(√3) = 6, B(√21) = 12 and B(111 111 111) = 54. +colmeia de hexágonos com comprimento de lado 1 -Find the number of L ≤ 5·1011 such that B(L) = 450. +Uma célula específica é ocupada pela abelha rainha. Para um número positivo real $L$, considere $B(L)$ como a contagem das células com distância $L$ da célula da abelha rainha (todas as distâncias são medidas do centro ao centro); você pode presumir que a colmeia é suficientemente grande para acomodar qualquer distância que queiramos considerar. + +Por exemplo, $B(\sqrt{3}) = 6$, $B(\sqrt{21}) = 12$ e $B(111.111.111) = 54$. + +Encontre o número de $L ≤ 5 \times {10}^{11}$, tal que $B(L) = 450$. # --hints-- -`euler354()` should return 58065134. +`distancesInHoneycomb()` deve retornar `58065134`. ```js -assert.strictEqual(euler354(), 58065134); +assert.strictEqual(distancesInHoneycomb(), 58065134); ``` # --seed-- @@ -27,12 +31,12 @@ assert.strictEqual(euler354(), 58065134); ## --seed-contents-- ```js -function euler354() { +function distancesInHoneycomb() { return true; } -euler354(); +distancesInHoneycomb(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.md index a166a1057a..e806212c68 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.md @@ -1,6 +1,6 @@ --- id: 5900f4d01000cf542c50ffe2 -title: 'Problem 355: Maximal coprime subset' +title: 'Problema 355: Subconjunto máximo de coprimos' challengeType: 5 forumTopicId: 302015 dashedName: problem-355-maximal-coprime-subset @@ -8,18 +8,18 @@ dashedName: problem-355-maximal-coprime-subset # --description-- -Define Co(n) to be the maximal possible sum of a set of mutually co-prime elements from {1, 2, ..., n}. For example Co(10) is 30 and hits that maximum on the subset {1, 5, 7, 8, 9}. +Defina $Co(n)$ como a soma máxima possível de um conjunto de elementos mutuamente coprimos de $\\{1, 2, \ldots, n\\}$. Por exemplo $Co(10)$ é 30 e atinge esse máximo no subconjunto $\\{1, 5, 7, 8, 9\\}$. -You are given that Co(30) = 193 and Co(100) = 1356. +Você é informado de que $Co(30) = 193$ e $Co(100) = 1356$. -Find Co(200000). +Encontre $Co(200.000)$. # --hints-- -`euler355()` should return 1726545007. +`maximalCoprimeSubset()` deve retornar `1726545007`. ```js -assert.strictEqual(euler355(), 1726545007); +assert.strictEqual(maximalCoprimeSubset(), 1726545007); ``` # --seed-- @@ -27,12 +27,12 @@ assert.strictEqual(euler355(), 1726545007); ## --seed-contents-- ```js -function euler355() { +function maximalCoprimeSubset() { return true; } -euler355(); +maximalCoprimeSubset(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.md index 9027dcecf9..377c82d2fd 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.md @@ -1,6 +1,6 @@ --- id: 5900f4d01000cf542c50ffe3 -title: 'Problem 356: Largest roots of cubic polynomials' +title: 'Problema 356: Maiores raízes de polinômios cúbicos' challengeType: 5 forumTopicId: 302016 dashedName: problem-356-largest-roots-of-cubic-polynomials @@ -8,20 +8,20 @@ dashedName: problem-356-largest-roots-of-cubic-polynomials # --description-- -Let an be the largest real root of a polynomial g(x) = x3 - 2n·x2 + n. +Considere an como a maior raiz real de um polinômio $g(x) = x^3 - 2^n \times x^2 + n$. -For example, a2 = 3.86619826... +Por exemplo, $a_2 = 3.86619826\ldots$ -Find the last eight digits of. +Encontre os oito últimos algarismos de $\displaystyle\sum_{i = 1}^{30} \lfloor {a_i}^{987654321}\rfloor$. -Note: represents the floor function. +**Observação:** $\lfloor a\rfloor$ representa a função de base. # --hints-- -`euler356()` should return 28010159. +`rootsOfCubicPolynomials()` deve retornar `28010159`. ```js -assert.strictEqual(euler356(), 28010159); +assert.strictEqual(rootsOfCubicPolynomials(), 28010159); ``` # --seed-- @@ -29,12 +29,12 @@ assert.strictEqual(euler356(), 28010159); ## --seed-contents-- ```js -function euler356() { +function rootsOfCubicPolynomials() { return true; } -euler356(); +rootsOfCubicPolynomials(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-357-prime-generating-integers.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-357-prime-generating-integers.md index 1bb3f094a2..d65e857f9e 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-357-prime-generating-integers.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-357-prime-generating-integers.md @@ -1,6 +1,6 @@ --- id: 5900f4d11000cf542c50ffe4 -title: 'Problem 357: Prime generating integers' +title: 'Problema 357: Números inteiros geradores de primos' challengeType: 5 forumTopicId: 302017 dashedName: problem-357-prime-generating-integers @@ -8,18 +8,18 @@ dashedName: problem-357-prime-generating-integers # --description-- -Consider the divisors of 30: 1,2,3,5,6,10,15,30. +Considere os divisores de 30: 1, 2, 3, 5, 6, 10, 15, 30. -It can be seen that for every divisor d of 30, d+30/d is prime. +Pode-se ver que, para cada divisor $d$ de 30, $d + \frac{30}{d}$ é primo. -Find the sum of all positive integers n not exceeding 100 000 000such that for every divisor d of n, d+n/d is prime. +Encontre a soma de todos os números inteiros positivos $n$ não excedendo $100.000.000$, tal que, para cada divisor $d$ de $n$, $d + \frac{n}{d}$ é um número primo. # --hints-- -`euler357()` should return 1739023853137. +`primeGeneratingIntegers()` deve retornar `1739023853137`. ```js -assert.strictEqual(euler357(), 1739023853137); +assert.strictEqual(primeGeneratingIntegers(), 1739023853137); ``` # --seed-- @@ -27,12 +27,12 @@ assert.strictEqual(euler357(), 1739023853137); ## --seed-contents-- ```js -function euler357() { +function primeGeneratingIntegers() { return true; } -euler357(); +primeGeneratingIntegers(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-358-cyclic-numbers.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-358-cyclic-numbers.md index fb08a667a8..8f9378508b 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-358-cyclic-numbers.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-358-cyclic-numbers.md @@ -1,6 +1,6 @@ --- id: 5900f4d21000cf542c50ffe5 -title: 'Problem 358: Cyclic numbers' +title: 'Problema 358: Números cíclicos' challengeType: 5 forumTopicId: 302018 dashedName: problem-358-cyclic-numbers @@ -8,24 +8,28 @@ dashedName: problem-358-cyclic-numbers # --description-- -A cyclic number with n digits has a very interesting property: +Um número cíclico com $n$ algarismos possui uma propriedade muito interessante: -When it is multiplied by 1, 2, 3, 4, ... n, all the products have exactly the same digits, in the same order, but rotated in a circular fashion! +Quando é multiplicado por 1, 2, 3, 4, ... $n$, todos os produtos têm exatamente os mesmos algarismos, na mesma ordem, mas giraram de modo circular! -The smallest cyclic number is the 6-digit number 142857 : 142857 × 1 = 142857 142857 × 2 = 285714 142857 × 3 = 428571 142857 × 4 = 571428 142857 × 5 = 714285 142857 × 6 = 857142 +O menor número cíclico é o número de 6 algarismos 142857: -The next cyclic number is 0588235294117647 with 16 digits : 0588235294117647 × 1 = 0588235294117647 0588235294117647 × 2 = 1176470588235294 0588235294117647 × 3 = 1764705882352941 ... 0588235294117647 × 16 = 9411764705882352 +$$\begin{align} & 142857 × 1 = 142857 \\\\ & 142857 × 2 = 285714 \\\\ & 142857 × 3 = 428571 \\\\ & 142857 × 4 = 571428 \\\\ & 142857 × 5 = 714285 \\\\ & 142857 × 6 = 857142 \end{align}$$ -Note that for cyclic numbers, leading zeros are important. +O próximo número cíclico é 0588235294117647, com 16 dígitos: -There is only one cyclic number for which, the eleven leftmost digits are 00000000137 and the five rightmost digits are 56789 (i.e., it has the form 00000000137...56789 with an unknown number of digits in the middle). Find the sum of all its digits. +$$\begin{align} & 0588235294117647 × 1 = 0588235294117647 \\\\ & 0588235294117647 × 2 = 1176470588235294 \\\\ & 0588235294117647 × 3 = 1764705882352941 \\\\ & \ldots \\\\ & 0588235294117647 × 16 = 9411764705882352 \end{align}$$ + +Observe que, para números cíclicos, zeros à esquerda são importantes. + +Há apenas um número cíclico para o qual os onze algarismos mais à esquerda são 00000000137 e os cinco algarismos mais à direita são 56789 (ou seja, tem a forma $00000000137\ldots56789$ com um número desconhecido de algarismos no meio). Encontre a soma de todos os seus algarismos. # --hints-- -`euler358()` should return 3284144505. +`cyclicNumbers()` deve retornar `3284144505`. ```js -assert.strictEqual(euler358(), 3284144505); +assert.strictEqual(cyclicNumbers(), 3284144505); ``` # --seed-- @@ -33,12 +37,12 @@ assert.strictEqual(euler358(), 3284144505); ## --seed-contents-- ```js -function euler358() { +function cyclicNumbers() { return true; } -euler358(); +cyclicNumbers(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.md index 971ae0f401..09bd7a699f 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.md @@ -1,6 +1,6 @@ --- id: 5900f4d31000cf542c50ffe6 -title: 'Problem 359: Hilbert''s New Hotel' +title: 'Problema 359: O novo hotel Hilbert' challengeType: 5 forumTopicId: 302019 dashedName: problem-359-hilberts-new-hotel @@ -8,24 +8,35 @@ dashedName: problem-359-hilberts-new-hotel # --description-- -An infinite number of people (numbered 1, 2, 3, etc.) are lined up to get a room at Hilbert's newest infinite hotel. The hotel contains an infinite number of floors (numbered 1, 2, 3, etc.), and each floor contains an infinite number of rooms (numbered 1, 2, 3, etc.). +Um número infinito de pessoas (numeradas 1, 2, 3, etc.) está alinhado para conseguir um quarto no novíssimo hotel infinito Hilbert. O hotel contém um número infinito de andares (numerados 1, 2, 3, etc.). Cada andar contém um número infinito de quartos (numerados 1, 2, 3, etc.). -Initially the hotel is empty. Hilbert declares a rule on how the nth person is assigned a room: person n gets the first vacant room in the lowest numbered floor satisfying either of the following: the floor is empty the floor is not empty, and if the latest person taking a room in that floor is person m, then m + n is a perfect square +Inicialmente, o hotel está vazio. Hilbert declara uma regra sobre como a $n^{\text{a}}$ pessoa é atribuída a um quarto: a pessoa $n$ obtém o primeiro quarto vago no andar de numeração mais baixa satisfazendo qualquer um dos seguintes: -Person 1 gets room 1 in floor 1 since floor 1 is empty. Person 2 does not get room 2 in floor 1 since 1 + 2 = 3 is not a perfect square. Person 2 instead gets room 1 in floor 2 since floor 2 is empty. Person 3 gets room 2 in floor 1 since 1 + 3 = 4 is a perfect square. +- o andar está vazio +- o andar não está vazio, e se a última pessoa que está pegando um quarto nesse andar é a pessoa $m$, então $m + n$ é um quadrado perfeito -Eventually, every person in the line gets a room in the hotel. +A pessoa 1 pega o quarto 1 no andar 1, já que o andar 1 está vazio. -Define P(f, r) to be n if person n occupies room r in floor f, and 0 if no person occupies the room. Here are a few examples: P(1, 1) = 1 P(1, 2) = 3 P(2, 1) = 2 P(10, 20) = 440 P(25, 75) = 4863 P(99, 100) = 19454 +A pessoa 2 não consegue o quarto 2 no andar 1, já que 1 + 2 = 3 não é um quadrado perfeito. -Find the sum of all P(f, r) for all positive f and r such that f × r = 71328803586048 and give the last 8 digits as your answer. +A pessoa 2, em vez disso, pega o quarto 1 no andar 2, já que o andar 2 está vazio. + +A pessoa 3 consegue o quarto 2 no andar 1, já que 1 + 3 = 4 é um quadrado perfeito. + +No fim, cada pessoa na fila pegará um quarto no hotel. + +Defina $P(f, r)$ como $n$ se a pessoa $n$ ocupar o quarto $r$ no andar $f$, e 0 se ninguém ocupar o quarto. Aqui estão alguns exemplos: + +$$\begin{align} & P(1, 1) = 1 \\\\ & P(1, 2) = 3 \\\\ & P(2, 1) = 2 \\\\ & P(10, 20) = 440 \\\\ & P(25, 75) = 4863 \\\\ & P(99, 100) = 19454 \end{align}$$ + +Encontre a soma de todos os $P(f, r)$ para todos os números positivos $f$ e $r$, tal que $f × r = 71.328.803.586.048$ e dê os últimos 8 algarismos como resposta. # --hints-- -`euler359()` should return 40632119. +`hilbertsNewHotel()` deve retornar `40632119`. ```js -assert.strictEqual(euler359(), 40632119); +assert.strictEqual(hilbertsNewHotel(), 40632119); ``` # --seed-- @@ -33,12 +44,12 @@ assert.strictEqual(euler359(), 40632119); ## --seed-contents-- ```js -function euler359() { +function hilbertsNewHotel() { return true; } -euler359(); +hilbertsNewHotel(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md index f028a5d58b..a5cbbbae4f 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md @@ -1,6 +1,6 @@ --- id: 5900f4d41000cf542c50ffe7 -title: 'Problem 360: Scary Sphere' +title: 'Problema 360: Esfera assustadora' challengeType: 5 forumTopicId: 302021 dashedName: problem-360-scary-sphere @@ -8,20 +8,24 @@ dashedName: problem-360-scary-sphere # --description-- -Given two points (x1,y1,z1) and (x2,y2,z2) in three dimensional space, the Manhattan distance between those points is defined as |x1-x2|+|y1-y2|+|z1-z2|. +Dados dois pontos, ($x_1$, $y_1$, $z_1$) e ($x_2$, $y_2$, $z_2$), em um espaço tridimensional, a distância de Manhattan entre esses pontos está definida como $|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|$. -Let C(r) be a sphere with radius r and center in the origin O(0,0,0). Let I(r) be the set of all points with integer coordinates on the surface of C(r). Let S(r) be the sum of the Manhattan distances of all elements of I(r) to the origin O. +Considere $C(r)$ como uma esfera com o raio $r$ e o centro na origem $O(0, 0, 0)$. -E.g. S(45)=34518. +Considere $I(r)$ como o conjunto de todos os pontos com coordenadas em números inteiros na superfície de $C(r)$. -Find S(1010). +Considere $S(r)$ como a soma das distâncias de Manhattan de todos os elementos de $I(r)$ até a origem $O$. + +Ex: $S(45)=34518$. + +Encontre $S({10}^{10})$. # --hints-- -`euler360()` should return 878825614395267100. +`scarySphere()` deve retornar `878825614395267100`. ```js -assert.strictEqual(euler360(), 878825614395267100); +assert.strictEqual(scarySphere(), 878825614395267100); ``` # --seed-- @@ -29,12 +33,12 @@ assert.strictEqual(euler360(), 878825614395267100); ## --seed-contents-- ```js -function euler360() { +function scarySphere() { return true; } -euler360(); +scarySphere(); ``` # --solutions--