Programming contests

ECN programozó csapatverseny, 2023. november 25.

November 25, 2023 10:30 AM – November 25, 2023 3:30 PM

Golden Primes

A prime number is called a golden prime when it takes the following form:

p = Φ2Φ – 1,

where Φ = 2n, and n is a positive integer.

Your task is to find golden primes. Write a program that calculates all values for n for which p is a golden prime less than a given value b.

Input Specification

The input consists of a single positive integer b < 21000.

Output Specification

Your program must print to the standard output, on separate lines, all n values found.

Sample Input

  1. 1024
download as text file

Output for Sample Input

  1. 2
  2. 4
  3. 5
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019