Grandma’s basket of bananas: bunch them by twos — one left over. By threes — one left over. By fours, by fives — always one lonely banana. But split them into seven baskets and they go in perfectly even. How few bananas is that? Slide how high you bunch and the smallest honest answer falls out.
This is the Chinese Remainder Theorem wearing a fruit basket (Brahmagupta posed the shape c.628 CE). We want the least N>1 with N≡1 (mod m) for every m from 2 up to the slider, AND N≡0 (mod 7). Because those moduli are consistent, a solution exists and is unique mod their combined period; the instrument brute-forces the least one live. A fail-loud self-check throws unless the found N satisfies every congruence exactly and reproduces the classic answers: bunch-to-6 → 301, to-5 → 301, to-4 → 49, to-3 → 7.
The specific numbers depend on the chosen residue (leave 1 over) and the divisor (7); the mechanism — simultaneous congruences with a unique solution mod the lcm — is exact CRT. ‘Smallest pile’ is the least positive solution, not the only one (they recur every lcm(2..g,7)).