At the end of a soccer season, every player on a team scored a prime number of goals, and the average for the team as a whole was also a prime number. No playerís tally was equal to anotherís, and no playerís tally was the same as the average.
Given that nobody scored more than 45 goals, how many goals did each player score?
*** There are 11 players in a soccer team.
The largest prime not exceeding 45 is the 14th prime, 43, so to get the total of all the players' scores we just need the total of the first 14 primes and subtract out three of these primes.
10 for I=1 to 14:First14=First14+prm(I):next
20 for LeaveOut1=1 to 12
30 for LeaveOut2=LeaveOut1+1 to 13
40 for LeaveOut3=LeaveOut2+1 to 14
110 if Avg=int(Avg) then if prmdiv(Avg)=Avg then
120 :if Avg=prm(LeaveOut1) or Avg=prm(LeaveOut2) or Avg=prm(LeaveOut3) then
150 :for I=1 to 14
160 :if I<>LeaveOut1 and I<>LeaveOut2 and I<>LeaveOut3 then
170 :print prm(I);:endif
190 :print:print Avg
which finds these individual players' scores
5 7 11 13 17 19 29 31 37 41 43
Posted by Charlie
on 2013-04-17 12:37:57