## Ages of Children

Source

I got this problem from Rustan Leino, who got it from the book In code: a mathematical journey by Sarah Flannery and David Flannery.

I solved it and wrote up my solution.

Problem

A (presumed smart) insurance agent knocks on a door and a (presumed smart) homeowner opens. The agent introduces themselves and asks the homeowner if they have any children. The homeowner answers that they have three. When the agent then asks their ages (which for this problem we abstract to integers), the homeowner hesitates. They decide to give the agent some information about their ages, saying "the product of their ages is 36". The agent asks for more information and the homeowner gives in, saying "the sum of their ages is equal to our neighbors' house number". The agent jumps over the fence, inspects the house number, and then returns. "You need to give me another hint", they beg. "Alright", they say, "my oldest child plays the piano". What are the ages of the children?

Solution