Files
freeCodeCamp/curriculum/challenges/ukrainian/10-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.md

47 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f4451000cf542c50ff57
title: 'Завдання 216: Визначення простих чисел, які мають вигляд 2n2-1'
challengeType: 5
forumTopicId: 301858
dashedName: problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1
---
# --description--
Розглянемо числа $t(n)$, які мають вигляд $t(n) = 2n^2 - 1$, з $n > 1$.
Перші такі числа це 7, 17, 31, 49, 71, 97, 127 і 161.
Виявляється, що лише $49 = 7 \times 7$ і $161 = 7 \times 23$ не прості числа.
Для $n ≤ 10000$ існує 2202 простих числа $t(n)$.
Скільки чисел $t(n)$ є простими для $n ≤ 50\\,000\\,000$?
# --hints--
`primalityOfNumbers()` має повернути `5437849`.
```js
assert.strictEqual(primalityOfNumbers(), 5437849);
```
# --seed--
## --seed-contents--
```js
function primalityOfNumbers() {
return true;
}
primalityOfNumbers();
```
# --solutions--
```js
// solution required
```