🔁 Google Search Tricks · Word Jokes
Google Recursion
Trick
This is the oldest joke in computer science, and Google tells it in the search box. Search for “recursion” and you're asked, “Did you mean: recursion?” Click it, and you're asked again. It's a small Easter egg with a big idea behind it, and it earns a place in our Google search tricks list. Here's how to see it, and how the idea works.
Short answer: Search for recursion on Google. It asks, “Did you mean: recursion?” and clicking the suggestion takes you back to the same question. It's a joke about recursion, where something is defined in terms of itself.
Worth knowing
- The suggestion loops back to the same page.
- Recursion means solving a problem with a smaller version of itself.
- Every recursive process needs a base case, a point where it stops.
How to see it
- Open Google.
- Search for recursion.
- Look at the “Did you mean” line near the top.
- Click it, and watch the page ask the same thing.
What recursion is
Recursion means defining something in terms of itself. A classic example is factorial. The factorial of 5 is 5 times the factorial of 4, which is 4 times the factorial of 3, and so on, until you reach 1.
That chain works because it ends. The final step, the factorial of 1, equals 1, and everything unwinds from there. This stopping point is called the base case.
A tiny example
| Step | Calculation |
|---|---|
| factorial(1) | 1 |
| factorial(2) | 2 × factorial(1) = 2 |
| factorial(3) | 3 × factorial(2) = 6 |
| factorial(4) | 4 × factorial(3) = 24 |
| factorial(5) | 5 × factorial(4) = 120 |
In code, a function does the same thing by calling itself with a smaller input. The base case tells it when to stop. Without one, the calls would go on forever, which is why programmers sometimes joke that to understand recursion, you must first understand recursion.
The joke is a perfect fit for the nerdy corner of our complete list of Google Easter eggs.
Recursion in the real world
- Folders. A program that lists every file looks inside each folder, then inside the folders within those.
- Fractals. Shapes like the Koch snowflake repeat a pattern at smaller scales.
- Sorting. Some fast sorting methods split a list in half and sort each half the same way.
- Language. A sentence can contain another sentence, which contains another.
Why the Google joke works
The “Did you mean” feature normally corrects a typo. Here it corrects you to the same thing you typed, so the correction is the problem. The page has no base case, which is the whole joke.
Tips
- Try other word jokes. Google has several, such as anagram.
- Draw it. Sketch the factorial steps on paper and the idea becomes clearer.
- Find the base case first. It's the safest way to write a recursive function.
- Don't overuse it. Loops are sometimes simpler.
For more programmer humor from the early web, see our retro Google tricks guide.
A second example: Fibonacci
The Fibonacci sequence runs 1, 1, 2, 3, 5, 8, 13. Each number is the sum of the two before it. That is a recursive definition: the next number is built from the earlier ones, and the first two numbers are the base cases.
It's a classic teaching example, though a naive recursive version gets slow for large numbers because it repeats work. That's a useful lesson in itself: recursion is elegant, but it has costs.
Recursion and loops
| Recursion | Loop | |
|---|---|---|
| Idea | A function calls itself on a smaller problem | Repeat a block of steps |
| Best for | Trees, folders, nested data | Counting, simple repetition |
| Risk | Too many calls can run out of memory | An endless loop if the exit is wrong |
What is a stack overflow?
Each recursive call uses a little memory to remember where it came from. If a function never reaches its base case, those calls pile up until the memory set aside for them runs out. The error is called a stack overflow, and it's the reason the famous programmer Q&A site has that name.
The fix is almost always the same: check your base case.
How we checked this: We used Search Engine Land's list and the Google Easter egg wiki for the behavior, and standard computer science teaching for the factorial example. The factorial values are simple arithmetic. If something here is out of date for you, email ownerflexora.ai@gmail.com and we will fix it.
Your turn: Work out the factorial of 6 using the table above. Which row do you use first, and what is the base case?
The next time something asks you to understand recursion, you'll know what to say: first, understand the base case.
More tricks to try
Want a note-taking trick? The Google sticky notes trick is next.
Frequently Asked Questions
For more of Google's word jokes, see Search Engine Land's big list of Google Easter eggs.