English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Guests are standing in a queue each having a number beginning from 2 i.e. 1st guest has number 2, 2nd has number 3, 3rd has number 4 and so on. The first guest with number 2 is allowed to attend the party while every 2nd guest after him in the queue is asked to leave. In the remaining guests, first in the queue is allowed to attend the party(3 in this case) while every 3rd guest behind him in the remaining queue is asked to leave. In the now remaining guests, guest with number 5 is at the first place so he is allowed to attend the party while every 5th behind him in the remaining queue is asked to leave. The process continues. Assume infinite guests.
To conclude, among the guests attending the party, 1st will have number 2, 2nd will have number 3, 3rd will have number 5...
Tell the number of the 25th guest that will attend the party.

2007-02-27 21:39:56 · 6 answers · asked by rohan g 1 in Science & Mathematics Mathematics

prime numbers is not the correct answer...think more...

2007-02-27 22:32:26 · update #1

6 answers

The 25'th guest will have the number 97 since it's the 25'th prime number and the method you use is also known as the 'Seive of Eratosthenes'

HTH ☺


Doug

2007-02-27 21:49:34 · answer #1 · answered by doug_donaghue 7 · 1 1

This is silly. If you pick guests as you describe, then eventually ALL the guests will be asked to stay, because every pass admits the lowest-numbered remaining guest into the party!

Your question does not adequately define the ordering of guests. Your assertion that the first guest is 2, second is 3, and third is 5 begs the question: Wouldn't the first guest to enter be 2, the second 4, the third 6, and so on? Thus, while the first pass (which gets every second guest) is being processed, the 25th guest to be selected is 50!

Of course, if you instead order them by number after all attendees are decided, the 25th guest is (duh) 26.

2007-02-28 08:36:54 · answer #2 · answered by cdmillstx 3 · 0 2

well it is simple only the guests with prime number are allowed to attend in the party first with #2 the second with #3 the third with #5 and so on... the method is called seive of eratosthenes i dont know wheter the spelling is right or wrong?
so the 25th prime number is 97 so his or her number will be 97
but u can search for it,good luck

2007-02-28 06:08:41 · answer #3 · answered by vinchenzo_corleone 2 · 0 0

14

2007-02-28 05:46:41 · answer #4 · answered by booge 6 · 0 1

This is basically filtering out all nonprimes, so the 25th person let in will be the 25th prime i.e. 97

2007-02-28 06:00:12 · answer #5 · answered by Tom :: Athier than Thou 6 · 0 0

121

2007-02-28 08:01:30 · answer #6 · answered by romeo_1595 2 · 0 1

fedest.com, questions and answers