Problem Description
Mr. MacGregor always planted his cabbage
patch in a square
configuration. This summer he decided to plant extra for his rabbit friends and ended up planting an extra
47 cabbages.
How big was his patch last year and this year?
Background & Techniques
A computer is not really required to solve this puzzle, but it only
takes a few lines of code to do so.
Try it with pencil and paper before clicking on the
"Solve" button. A little knowledge of factoring and prime numbers
will
be helpful in solving the equation represented by the problem:
Thisyear2 - Lastyear2 =
47
I added a hint as a comment
over in the Browse source extract
link if you get stuck.
The problem, by the way, is adapted from
the book Recreations in the Theory of Numbers, by Albert Beiler,
Dover Publications. Equations in number theory, such as
this one, where solutions are restricted to integers are known
as Diophantine equations (after Diophantus of Alexandria,
apparently the guy considered to be the father of algebra).
Running/Exploring the Program