freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-37-truncatable-prim...

61 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f3911000cf542c50fea4
challengeType: 5
title: 'Problem 37: Truncatable primes'
videoUrl: ''
localeTitle: 'Задача 37: Усекаемые простые числа'
---
## Description
<section id="description"> Число 3797 имеет интересное свойство. Будучи простым, можно непрерывно удалять цифры слева направо и оставаться первичными на каждом этапе: 3797, 797, 97 и 7. Аналогичным образом мы можем работать справа налево: 3797, 379, 37 и 3. Найдите сумму единственных n (8 &lt;= n &lt;= 11) простых чисел, которые обе усекаются слева направо и справа налево. ПРИМЕЧАНИЕ. 2, 3, 5 и 7 не считаются усеченными штрихами. </section>
## Instructions
undefined
## Tests
<section id='tests'>
```yml
tests:
- text: <code>truncatablePrimes(8)</code> должен вернуться в 1986 году.
testString: 'assert(truncatablePrimes(8) == 1986, "<code>truncatablePrimes(8)</code> should return 1986.");'
- text: <code>truncatablePrimes(9)</code> должен вернуть 5123.
testString: 'assert(truncatablePrimes(9) == 5123, "<code>truncatablePrimes(9)</code> should return 5123.");'
- text: <code>truncatablePrimes(10)</code> должен вернуть 8920.
testString: 'assert(truncatablePrimes(10) == 8920, "<code>truncatablePrimes(10)</code> should return 8920.");'
- text: ''
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);
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>