2018-09-30 22:01:58 +00:00
---
id: 5900f4931000cf542c50ffa6
title: 'Problem 295: Lenticular holes'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301947
2021-01-13 02:31:00 +00:00
dashedName: problem-295-lenticular-holes
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2018-09-30 22:01:58 +00:00
We call the convex area enclosed by two circles a lenticular hole if:
2020-11-27 18:02:05 +00:00
2021-07-22 03:38:46 +00:00
- The centres of both circles are on lattice points.
- The two circles intersect at two distinct lattice points.
- The interior of the convex area enclosed by both circles does not contain any lattice points.
2020-11-27 18:02:05 +00:00
2021-07-22 03:38:46 +00:00
Consider the circles:
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
$$\begin{align}
& C_0: x^2 + y^2 = 25 \\\\
& C_1: {(x + 4)}^2 + {(y - 4)}^2 = 1 \\\\
& C_2: {(x - 12)}^2 + {(y - 4)}^2 = 65
\end{align}$$
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
The circles $C_0$, $C_1$ and $C_2$ are drawn in the picture below.
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
< img class = "img-responsive center-block" alt = "C_0, C_1 and C_2 circles" src = "https://cdn.freecodecamp.org/curriculum/project-euler/lenticular-holes.gif" style = "background-color: white; padding: 10px;" >
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
$C_0$ and $C_1$ form a lenticular hole, as well as $C_0$ and $C_2$.
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
We call an ordered pair of positive real numbers ($r_1$, $r_2$) a lenticular pair if there exist two circles with radii $r_1$ and $r_2$ that form a lenticular hole. We can verify that ($1$, $5$) and ($5$, $\sqrt{65}$) are the lenticular pairs of the example above.
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
Let $L(N)$ be the number of distinct lenticular pairs ($r_1$, $r_2$) for which $0 < r_1 ≤ r_2 ≤ N$. We can verify that $L(10) = 30$ and $L(100) = 3442$.
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
Find $L(100\\,000)$.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-07-22 03:38:46 +00:00
`lenticularHoles()` should return `4884650818` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-07-22 03:38:46 +00:00
assert.strictEqual(lenticularHoles(), 4884650818);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-07-22 03:38:46 +00:00
function lenticularHoles() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-07-22 03:38:46 +00:00
lenticularHoles();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```