2018-09-30 23:01:58 +01:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4511000cf542c50ff62
|
|
|
|
|
challengeType: 5
|
|
|
|
|
title: 'Problem 226: A Scoop of Blancmange'
|
2019-08-05 09:17:33 -07:00
|
|
|
|
forumTopicId: 301869
|
2018-09-30 23:01:58 +01:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id='description'>
|
|
|
|
|
The blancmange curve is the set of points (x,y) such that 0 ≤ x ≤ 1 and ,where s(x) = the distance from x to the nearest integer.
|
|
|
|
|
|
|
|
|
|
The area under the blancmange curve is equal to ½, shown in pink in the diagram below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let C be the circle with centre (¼,½) and radius ¼, shown in black in the diagram.
|
|
|
|
|
|
|
|
|
|
What area under the blancmange curve is enclosed by C?Give your answer rounded to eight decimal places in the form 0.abcdefgh
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 14:37:37 +01:00
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler226()</code> should return 0.11316017.
|
2019-07-26 19:26:37 -07:00
|
|
|
|
testString: assert.strictEqual(euler226(), 0.11316017);
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler226() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler226();
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2019-07-18 08:24:12 -07:00
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
|
</section>
|