2018-10-08 17:51:51 +00:00
---
2018-10-10 20:20:40 +00:00
id: 5900f3911000cf542c50fea4
2018-10-08 17:51:51 +00:00
challengeType: 5
title: 'Problem 37: Truncatable primes'
2018-10-10 20:20:40 +00:00
videoUrl: ''
localeTitle: 'Problema 37: primos truncables'
2018-10-08 17:51:51 +00:00
---
## Description
2018-10-10 20:20:40 +00:00
< section id = "description" > El número 3797 tiene una propiedad interesante. Al ser primo, es posible eliminar continuamente dígitos de izquierda a derecha y permanecer primo en cada etapa: 3797, 797, 97 y 7. Del mismo modo, podemos trabajar de derecha a izquierda: 3797, 379, 37 y 3. Encuentre la suma de los únicos n primarios n (8 < = n < = 11) que son truncables de izquierda a derecha y de derecha a izquierda. NOTA: 2, 3, 5 y 7 no se consideran primos que se pueden cortar. < / section >
2018-10-08 17:51:51 +00:00
## Instructions
2018-10-10 20:20:40 +00:00
< section id = "instructions" >
2018-10-08 17:51:51 +00:00
< / section >
## Tests
< section id = 'tests' >
```yml
tests:
- text: < code > truncatablePrimes(8)</ code > debe devolver 1986.
testString: 'assert(truncatablePrimes(8) == 1986, "< code > truncatablePrimes(8)< / code > should return 1986.");'
- text: < code > truncatablePrimes(9)</ code > debe devolver 5123.
testString: 'assert(truncatablePrimes(9) == 5123, "< code > truncatablePrimes(9)< / code > should return 5123.");'
- text: < code > truncatablePrimes(10)</ code > debe devolver 8920.
testString: 'assert(truncatablePrimes(10) == 8920, "< code > truncatablePrimes(10)< / code > should return 8920.");'
- text: < code > truncatablePrimes(11)</ code > debe devolver 748317.
testString: 'assert(truncatablePrimes(11) == 748317, "< code > truncatablePrimes(11)< / code > should return 748317.");'
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```js
function truncatablePrimes(n) {
// Good luck!
return n;
}
truncatablePrimes(11);
2018-10-10 20:20:40 +00:00
2018-10-08 17:51:51 +00:00
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
// solution required
```
< / section >