Conversations with a six-year-old on functional programming
When my son was around five or six, I did a similar exercise to explain the difference between prime and composite numbers.<p>I told him that a number X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket.<p>I drew 6 apples and asked whether they could be divided into buckets with an equal number of apples in each.  It was immediately obvious that they could.  My son circled one group of three apples, then another group of three apples.<p>Then I drew 7 apples.  He realized that you couldn&#x27;t divide 7 apples into baskets and have each basket contain the same number of apples.<p>Voila!  A prime number.<p>Then we started talking about the frequency with which prime numbers occur on the number line, how important they are to fields such as cryptography, and the existence of dense Bragg peaks among primes in judiciously chosen intervals.  By the end of the conversation, he had discovered a new recursive prime generator and submitted a paper on it to arXiv.  Who knew?!?