+ 13

The Greenfly Problem? Can you solve it?

After one week of life a long female can produce 8 offspring a day. Starting at the beginning of day 1 with single mature female, how many greenfly could there be by the end of day 28? *There are no deaths *All offspring are females Note that at the end of day 1 there will be 9 greenfly (original + 8 offspring). At the end of day 7 there will be 57 greenfly (original + 8*7 offspring). At the end of day 8 there will be 129 (original +8*8 + 64)offspring from the daughter produced on day 1.

22nd Sep 2017, 11:47 PM
Abhishek Pun
Abhishek Pun - avatar
9 Answers
+ 9
all offspring are females
23rd Sep 2017, 11:21 PM
Abhishek Pun
Abhishek Pun - avatar
+ 8
ok answer is 1,161,889 ...
2nd Oct 2017, 2:30 PM
Abhishek Pun
Abhishek Pun - avatar
+ 6
ok you can ask for answer
3rd Oct 2017, 7:52 AM
Abhishek Pun
Abhishek Pun - avatar
+ 3
Maybe this helps Day 1: 1 Day 7: 1+8 Day 8: 1+8 + 8 Day 9: 1+(Day-6)×8 ... Day 14: 1+(Day-6)×8 + 8×8 Day 15: 1+(Day-6)×8 + 8×(2*8) Day 16: 1+(Day-6)×8+(Day-13)×8^2 ... Day 21: 1+(Day-6)×8+(Day-13)×8^2+8^2×8 Day 22: 1+(Day-6)×8+(Day-13)×8^2+8^2×8×2 Day 23: 1+(Day-6)×8+(Day-13)×8^2+(Day-20)×8^3 ... Day 28: 1+(Day-6)×8+(Day-13)×8^2+(Day-20)×8^3+8^4 Inserting 28 in Day there are 9329 Greenflys
15th Jan 2018, 5:45 PM
I. Stark
I. Stark - avatar
+ 1
And three years later someone gave the answer https://code.sololearn.com/cV6Dq9rHl7T9/?ref=app
4th Dec 2020, 4:17 PM
Gabriele Gatti
Gabriele Gatti - avatar
0
After some calculations I made in my mind, I'll go with 435. Nevermind, I'm wrong because I only calculated down to the 2nd generation of greenflies.
1st Oct 2017, 11:37 AM
cffgv
0
@Abhishek Pun Is it 1,866,145? I will post the code if you tell me that it's correct.
1st Oct 2017, 1:20 PM
Vagelis1337
0
I only wanted to know if I was right or wrong... But still, I will try to fix my code and get it correctly
3rd Oct 2017, 1:44 AM
Vagelis1337
- 1
Only 9 because there are no males to mate with. Dont know if it was a trick question but ill stick with it lol
23rd Sep 2017, 8:18 PM
NulledNVoided
NulledNVoided - avatar