Skip to content

The Monkey and the Coconuts

A named family of recreational Diophantine puzzles in which successive actors repeat the same division-and-remainder rule and a terminal division constrains the unknown initial pile.

Version
v3 · 2026-09-06 · History
Domain-specific #
2954
Origin domain
mathematics
Subdomain
recreational number theory
Aliases
Monkey and Coconut Problem, Monkey-and-Coconuts Problem, Coconut Problem

Core Idea

The Monkey and the Coconuts is a named family of recreational number-theory puzzles built around a hidden initial integer pile. Successive actors encounter the pile one at a time and apply the same operation: divide it into a fixed number of equal shares, remove a fixed remainder that prevents immediate divisibility, take one share, and leave the rest for the next actor. A final, usually different, division rule applies after all of the private divisions. The task is to reconstruct an initial pile for which every intermediate quantity is an integer and the terminal condition also holds. Published mathematical treatments explicitly generalize the puzzle and formulate it as a linear Diophantine problem, so its retained identity is a recurrent problem family rather than one magazine anecdote.

Scope of Application

The home domain is recreational number theory, especially the construction and solution of linear Diophantine puzzles. The family supports at least three recurring tasks. First, a solver may find the least positive initial pile for a fixed wording. Second, a mathematician may characterize all solutions to that wording as a parameterized integer family. Third, a generalized treatment may vary the number of actors, the private remainder, the terminal remainder, or the number of repeated stages and ask when solutions exist.

Clarity

A reliable way to read a version is to write a five-part specification before solving:

  1. the divisor or group size m;
  2. the number t of repeated private stages;
  3. the private-stage remainder r;
  4. the share taken and therefore the fraction left; and
  5. the terminal remainder or divisibility condition.

Manages Complexity

The narrative initially suggests a large unstructured search over possible piles. The abstraction compresses that search into repeated congruences. In the five-sailor case, shifting the state exposes the arithmetic especially cleanly. Set y_j = x_j + 4. The update becomes

y_(j+1) = 4y_j/5.

After five private divisions, y_5 = (4/5)^5 y_0. For all five stages to remain integral, the least positive shifted starting value is y_0 = 5^5 = 3125, which yields x_0 = 3121.

Abstract Reasoning

The puzzle licenses several reusable inferences. Because each actor leaves only (m - 1)/m of the post-remainder pile, forward states decrease; therefore a valid reconstruction cannot insert a larger later pile. Because the inverse update multiplies by m/(m - 1), backward search must continually test divisibility by m - 1. A failure at one intermediate stage invalidates the whole candidate even if its endpoints have the requested residues.

Knowledge Transfer

Transfer inside the family is exact when the role mapping survives: pile to integer state, sailor to repeated stage, monkey's coconut to fixed remainder, private share to the removed fraction, and morning division to terminal congruence. A three-person wording and a five-person wording can therefore be analyzed with the same state-transition template by changing parameters.

Transfer from the riddle to algebra is also exact. The story order determines the recurrence; the recurrence determines congruence tests; and the Diophantine solution set translates back into valid narratives.

Relationships to Other Abstractions

Local relationship map for The Monkey and the CoconutsParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.The Monkey andthe CoconutsDOMAINPrime abstraction: Iteration — is part ofIterationPRIME

Current abstraction The Monkey and the Coconuts Domain-specific

Parents (1) — more general patterns this builds on

  • The Monkey and the Coconuts is part of Iteration Prime

    Iteration is instantiated directly: each stage consumes the complete output of the previous stage and applies the same transition.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

The Monkey and the Coconuts sits in a sparse region of the domain-specific corpus (87th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (1565 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08