Bradley is eating an entire series of pies for lunch. However, since Bradley is an epic math geek, these pies are not just normal pies, they are PRIME PIES. Prime pies have a very special property. Their weights are always prime. Thus, there will be a prime pie of 2kg, 3kg, 5kg, but not 4kg. The prime pies are also always sorted in order. So the first prime pie will be one with 2kg, the second one will be 3kg, the third one will be 5kg, etc.
Bradley wants to eat N prime pies for lunch today. He will always start eating the prime pies from the smallest one first. So, in a case where N = 4, Bradley will eat the 2kg pie, then the 3kg pie, then the 5kg pie and then the 7kg pie. Thus, Bradley would have eaten a total of 2+3+5+7=17 kg of prime pies. Given N, help Bradley find out the total amount of prime pies he would have eaten in kg.
Your program should implement the following functions:
4
17
Subtask | Score |
---|---|
1 | 9 |
2 | 12 |
3 | 27 |
4 | 52 |
5 | 0 |