71 lines
1.3 KiB
Markdown
71 lines
1.3 KiB
Markdown
---
|
|
id: 5900f4641000cf542c50ff76
|
|
challengeType: 5
|
|
title: 'Problem 247: Squares under a hyperbola'
|
|
---
|
|
|
|
## Description
|
|
<section id='description'>
|
|
Consider the region constrained by 1 ≤ x and 0 ≤ y ≤ 1/x.
|
|
|
|
Let S1 be the largest square that can fit under the curve.
|
|
Let S2 be the largest square that fits in the remaining area, and so on.
|
|
Let the index of Sn be the pair (left, below) indicating the number of squares to the left of Sn and the number of squares below Sn.
|
|
|
|
|
|
|
|
|
|
The diagram shows some such squares labelled by number.
|
|
S2 has one square to its left and none below, so the index of S2 is (1,0).
|
|
It can be seen that the index of S32 is (1,1) as is the index of S50.
|
|
50 is the largest n for which the index of Sn is (1,1).
|
|
|
|
|
|
What is the largest n for which the index of Sn is (3,3)?
|
|
</section>
|
|
|
|
## Instructions
|
|
<section id='instructions'>
|
|
|
|
</section>
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: <code>euler247()</code> should return 782252.
|
|
testString: 'assert.strictEqual(euler247(), 782252, "<code>euler247()</code> should return 782252.");'
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function euler247() {
|
|
// Good luck!
|
|
return true;
|
|
}
|
|
|
|
euler247();
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
</section>
|