MathDB
The number of stones in a heap is a square

Source: Czech-Polish-Slovak 2004 Q6

April 28, 2013
greatest common divisornumber theory proposednumber theory

Problem Statement

On the table there are k3k \ge 3 heaps of 1,2,,k1, 2, \dots , k stones. In the first step, we choose any three of the heaps, merge them into a single new heap, and remove 11 stone from this new heap. Thereafter, in the ii-th step (i2i \ge 2) we merge some three heaps containing more than ii stones in total and remove ii stones from the new heap. Assume that after a number of steps a single heap of pp stones remains on the table. Show that the number pp is a perfect square if and only if so are both 2k+22k + 2 and 3k+13k + 1. Find the least kk with this property.