HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2013-03-20. 50578 - Mersenne prime

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 2012-10-04. 50598 - Minimum Sum
• 2012-11-30. 50656 - Divisibility by 11
• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average Fuel P...
• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne p...
• 2013-03-30. 50360 - National Elections
• 2013-03-40. 50705 - Student Clubs
• 2014-04-10. 50547 - Close Pair
• 2014-04-30. 50560 - Max Distance
• 2014-04-50. 50569 - 12th Grade Ele...
• 2014-04-50. 50703 - The Shortest Path

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 4000/7000/4000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Arban Uka.

Mersenne Prime

Shqip

Mersenne Prime is a prime a number which can be expressed in the form Mn = 2n - 1 . They are named after the French scientist Marin Mersenne.

Write a program which is going to read n numbers then output the number of Mersenne primes in the given list.

Input specification
The first line contains a number (n) where 2 ≤ n ≤ 100. The following n lines has one number in each where each of the numbers is between 1 and 1013.

Output specification
Show just one number that shows the number of Mersenne Prime numbers in the given list.

Sample Input:
5
1
7
15
31
5

Sample Output:
2

Output Explanation:
There are 6 input numbers:

  • 1 is not a prime number
  • 7 is prime and in the form of Mn = 2n - 1 and thus is Mersenne Prime.
  • 15 is not a prime number
  • 31 is Mersenne Prime
  • 5 is prime but not a Mersenne Prime
There are only two Mersenne Primes in the given list.

Sample Input 2:
5
511
8191
321051687
1099511627775
2199023255552

Sample Output 2:
1
Only 8191 is Mersenne Prime number.

Для отправки решений необходимо выполнить вход.

www.contester.ru