Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
This commit is contained in:
committed by
GitHub
parent
a07f84c8ec
commit
0bd52f8bd1
@ -1,52 +1,41 @@
|
||||
---
|
||||
id: 5900f4f11000cf542c510003
|
||||
challengeType: 5
|
||||
title: 'Problem 387: Harshad Numbers'
|
||||
challengeType: 5
|
||||
forumTopicId: 302051
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
# --description--
|
||||
|
||||
A Harshad or Niven number is a number that is divisible by the sum of its digits.
|
||||
|
||||
201 is a Harshad number because it is divisible by 3 (the sum of its digits.)
|
||||
|
||||
When we truncate the last digit from 201, we get 20, which is a Harshad number.
|
||||
|
||||
When we truncate the last digit from 20, we get 2, which is also a Harshad number.
|
||||
|
||||
Let's call a Harshad number that, while recursively truncating the last digit, always results in a Harshad number a right truncatable Harshad number.
|
||||
|
||||
Also:
|
||||
201/3=67 which is prime.
|
||||
Let's call a Harshad number that, when divided by the sum of its digits, results in a prime a strong Harshad number.
|
||||
Also: 201/3=67 which is prime. Let's call a Harshad number that, when divided by the sum of its digits, results in a prime a strong Harshad number.
|
||||
|
||||
Now take the number 2011 which is prime.
|
||||
When we truncate the last digit from it we get 201, a strong Harshad number that is also right truncatable.
|
||||
Let's call such primes strong, right truncatable Harshad primes.
|
||||
Now take the number 2011 which is prime. When we truncate the last digit from it we get 201, a strong Harshad number that is also right truncatable. Let's call such primes strong, right truncatable Harshad primes.
|
||||
|
||||
You are given that the sum of the strong, right truncatable Harshad primes less than 10000 is 90619.
|
||||
|
||||
Find the sum of the strong, right truncatable Harshad primes less than 1014.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
# --hints--
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler387()</code> should return 696067597313468.
|
||||
testString: assert.strictEqual(euler387(), 696067597313468);
|
||||
`euler387()` should return 696067597313468.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler387(), 696067597313468);
|
||||
```
|
||||
|
||||
</section>
|
||||
# --seed--
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
<div id='js-seed'>
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler387() {
|
||||
@ -57,17 +46,8 @@ function euler387() {
|
||||
euler387();
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
// solution required
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user