×

# ENIGMA01 - Editorial

Guess the Number

Author and Editorialist : Kamini Pandey

# PREREQUISITES:

Sieve of Eratosthenes

# PROBLEM:

To guess what is minimum number of questions that are needed to be asked to correctly guess any number in the given range.

# EXPLANATION:

The idea is to get the number of primes factor for all the numbers up to K. Firstly lets compute number of primes <= K (This part can be pre computed using Sieve of Eratosthenes ). Then for every prime ‘p’ we need to find highest ‘v’ such that pv <=K.

# SOLUTION:

This question is marked "community wiki".

464
accept rate: 10%

19.7k350498541

 0 why Can't he ask in the manner of binary search on v(prime power) ? answered 28 Feb '17, 02:47 1●1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×15,482
×3,705
×921
×301
×42

question asked: 16 Oct '15, 20:59

question was seen: 899 times

last updated: 20 Mar '17, 22:25