56 lines
1.7 KiB
Markdown
56 lines
1.7 KiB
Markdown
---
|
||
id: 5900f42c1000cf542c50ff3f
|
||
challengeType: 5
|
||
title: 'Problem 192: Best Approximations'
|
||
videoUrl: ''
|
||
localeTitle: 'Проблема 192: Лучшие приближения'
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> Пусть х - действительное число. Наилучшее приближение x для знаменателя d - рациональное число r / s в приведенном виде с s ≤ d, такое, что любое рациональное число, которое ближе к x, чем r / s, имеет знаменатель, больший d: <p> | П / QX | <| r / sx | ⇒ q> d </p><p> Например, наилучшее приближение к √13 для значения знаменателя 20 составляет 18/5, а наилучшее приближение к √13 для знаменателя 30 - 101/28. </p><p> Найдите сумму всех знаменателей наилучших приближений к √n для знаменателя, связанного 1012, где n не является идеальным квадратом и 1 <n ≤ 100000. </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler192()</code> должен вернуть 57060635927998344.
|
||
testString: 'assert.strictEqual(euler192(), 57060635927998344, "<code>euler192()</code> should return 57060635927998344.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler192() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler192();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|