freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-216-investigating-t...

1.3 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f4451000cf542c50ff57 5 Problem 216: Investigating the primality of numbers of the form 2n2-1 Задача 216: Исследование примитивности чисел вида 2n2-1

Description

Рассмотрим числа t (n) вида t (n) = 2n2-1 с n> 1. Первые такие числа равны 7, 17, 31, 49, 71, 97, 127 и 161. Оказывается, что только 49 = 7 * 7 и 161 = 7 * 23 не являются первичными. При n ≤ 10000 имеется 2202 чисел t (n), которые являются первичными.

Сколько чисел t (n) является простым для n ≤ 50 000 000?

Instructions

Tests

tests:
  - text: <code>euler216()</code> должен вернуть 5437849.
    testString: 'assert.strictEqual(euler216(), 5437849, "<code>euler216()</code> should return 5437849.");'

Challenge Seed

function euler216() {
  // Good luck!
  return true;
}

euler216();

Solution

// solution required