Its not clear that just a primality test would close the deal...The sequence 1,3,7,13...does not have 5 which is prime. If you consider a number 'n' for it to be removed in round 2 (n%2)==0 For it to be removed in round 3 (n-floor(n/2))%3==0 (The floor of n/2 to accommodate all the numbers thrown out in round 2) For it to be removed in round 4 (n-floor(n/2)-floor(n/3))%4==0 (The floor of n/3 to accommodate all the numbers thrown out in round 3)
Which is what is being done in the previously posted solutions.. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---