Project Euler 226 - A Scoop of Blancmange

Official link: https://projecteuler.net/problem=226

Thought Process

My idea was pretty simple, find the intersection point's, calculate area under blancmange curve and under the circle, the answer is area under blancmange - area under the circle

  1. Found the intersection points using trusty desmos, they are 0.0789 and 0.5

  2. Area under the blancmange curve can be calculated using a recursive formula, see here

3. Just for the fun of it I used scipy.integrate to find the area under the circle, which can be graphed using the below formula

Interactive Code

No interactive code for this problem, my code is given below