Back to Freecodecamp

Problem 226: A Scoop of Blancmange

curriculum/challenges/english/blocks/project-euler-problems-201-to-300/5900f4511000cf542c50ff62.md

latest1.1 KB
Original Source

--description--

The blancmange curve is the set of points ($x$,$y$) such that $0 ≤ x ≤ 1$ and $\displaystyle y = \sum_{n = 0}^{\infty} \frac{s(2^nx)}{2^n}$, where $s(x)$ is the distance from $x$ to the nearest integer.

The area under the blancmange curve is equal to $\frac{1}{2}$, shown in pink in the diagram below.

Let $C$ be the circle with center ($\frac{1}{4}$,$\frac{1}{2}$) and radius $\frac{1}{4}$, 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

--hints--

scoopOfBlancmange() should return 0.11316017.

js
assert.strictEqual(scoopOfBlancmange(), 0.11316017);

--seed--

--seed-contents--

js
function scoopOfBlancmange() {

  return true;
}

scoopOfBlancmange();

--solutions--

js
// solution required