66 lines
1.6 KiB
Markdown
66 lines
1.6 KiB
Markdown
---
|
|
id: 5
|
|
localeTitle: 5900f3971000cf542c50feaa
|
|
challengeType: 5
|
|
title: 'Problem 43: Sub-string divisibility'
|
|
---
|
|
|
|
## Description
|
|
<section id='description'>
|
|
El número, 1406357289, es un número pandigital de 0 a 9 porque está formado por cada uno de los dígitos 0 a 9 en algún orden, pero también tiene una propiedad de divisibilidad de sub-cadena bastante interesante.
|
|
Sea d1 el primer dígito, d2 el segundo dígito, etc. De esta manera, notamos lo siguiente:
|
|
d2d3d4 = 406 es divisible por 2
|
|
d3d4d5 = 063 es divisible por 3
|
|
d4d5d6 = 635 es divisible por 5
|
|
d5d6d7 = 357 es divisible por 7
|
|
d6d7d8 = 572 es divisible por 11
|
|
d7d8d9 = 728 es divisible por 13
|
|
d8d9d10 = 289 es divisible por 17
|
|
Encuentra los números de todos los 0 a 9 números pandigitales con esta propiedad.
|
|
</section>
|
|
|
|
## Instructions
|
|
<section id='instructions'>
|
|
|
|
</section>
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: ' <code>substringDivisibility()</code> debe devolver [1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289].'
|
|
testString: 'assert.deepEqual(substringDivisibility(), [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ], "<code>substringDivisibility()</code> should return [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ].");'
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function substringDivisibility() {
|
|
// Good luck!
|
|
return [];
|
|
}
|
|
|
|
substringDivisibility();
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
</section>
|