# Buzz Buzz Busy Male Bees

A male bee is born from an unfertilized egg, a female bee from a fertilized egg. In other words, a male bee has only a mother, whereas a female bee has a mother and a father. How many total ancestors does a male bee have going back ten generations?

• Wait, my dad is actually my step-dad? – kscherrer Oct 17 '18 at 12:51

Counting the first male as Generation 0 (and his mother as Generation 1) the male will have

231 ancestors. I wrote out the first few generations as a binary tree and realized that it is a Fibonacci Sequence. I summed the first ten numbers of the Fibonacci Sequence to reach my answer.

Disclaimer: This is a proof of p_sutherland's answer. If you consider this correct, please accept their answer.

Let's assume the number of ancestors in each generation is a(n), where n=the generation, starting from 1 for the male in question, and going upwards (2,3,4) for each ancestry level

Spoiler-splitter

1) The male is the only in its generation: a(1)=1

Spoiler-splitter

2) The male has only a female direct ancestor: a(2)=1

Spoiler-splitter

3) All the ancestors of a generation equals to the sum of the males and females: a(n) = m(n) + f(n) [1]. Every child comes from a female, so the females of a generation is equal to all ancestors of the next generation: f(n)=a(n-1)[2]. The males of each generation (fathers) are there only because of female children: m(n)=f(n-1)=(due to [2]) a(n-2)[3]. From [1],[2],[3] we get a(n)=a(n-1)+a(n-2) which is indeed the Fibonacci sequence.

• @Geroge Menoutis, Yours should absolutely be the accepted answer. After all, what good is an answer without "showing work" or providing real understanding – p_sutherland Oct 18 '18 at 19:25
• Well, dunno. I'm having a great time here, hope you are too, so I don't really care :) – George Menoutis Oct 18 '18 at 19:42

I believe the answer is (if my math is correct):

768

This is because:

For every dad there is a mom, and for every mom there is a mom and dad.

I actually wrote an algorithm to solve this:

// By the second generation there are two moms and one dad for a total of three ancestors.
int ancestors = 3;
int moms = 2;