2018-09-30 22:01:58 +00:00
---
id: 5900f4e11000cf542c50fff3
title: 'Problem 372: Pencils of rays'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 302034
2021-01-13 02:31:00 +00:00
dashedName: problem-372-pencils-of-rays
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
2021-07-29 19:48:17 +00:00
Let $R(M, N)$ be the number of lattice points ($x$, $y$) which satisfy $M \lt x \le N$, $M \lt y \le N$ and $\left\lfloor\frac{y^2}{x^2}\right\rfloor$ is odd.
2018-09-30 22:01:58 +00:00
2021-07-29 19:48:17 +00:00
We can verify that $R(0, 100) = 3\\,019$ and $R(100, 10\\,000) = 29\\,750\\,422$.
Find $R(2 \times {10}^6, {10}^9)$.
**Note:** $\lfloor x\rfloor$ represents the floor function.
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-29 19:48:17 +00:00
`pencilsOfRays()` should return `301450082318807040` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-07-29 19:48:17 +00:00
assert.strictEqual(pencilsOfRays(), 301450082318807040);
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-29 19:48:17 +00:00
function pencilsOfRays() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-07-29 19:48:17 +00:00
pencilsOfRays();
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
```