A Sequence That Always Hits a Perfect Square
Define a sequence as follows. Let , where is the greatest integer with . (So is the "remainder" when you subtract the largest perfect square .)
Set (a positive integer), and
For which positive integers does this sequence eventually become constant?
(The sequence is constant once it reaches some value and stays there forever.)
Answer: A Sequence That Always Hits a Perfect Square
Key Idea / Intuition
The sequence is constant exactly when it hits a perfect square โ because if , then , so . The question is: starting from , does the sequence always reach a perfect square, or can it wander forever?
The key insight is to track what happens modulo small numbers, or more cleverly, to notice that perfect squares are the only fixed points, and the sequence is non-decreasing. Once you see that is a perfect square, the question becomes: does every starting integer eventually land on a perfect square?
The answer is: the sequence eventually becomes constant if and only if is a perfect square, because for non-square , the sequence strictly increases and โ surprisingly โ skips over every perfect square it approaches.
Formal Proof / Solution
Step 1: Fixed points are exactly perfect squares.
If , then , so the sequence is constant. If is not a perfect square, , so the sequence strictly increases.
Step 2: What happens near a perfect square?
Suppose for some (i.e., lies just below ). The largest perfect square is , so:
Therefore:
Step 3: Does the sequence land on ?
For the sequence to land exactly on , we need , i.e., . But must be an integer, and is odd, so this is impossible!
This is the key surprise: the sequence always jumps over entirely โ landing either below or strictly above .
Step 4: Conclusion.
If is a perfect square, the sequence is immediately constant. If is not a perfect square, then the sequence is strictly increasing and never lands on any perfect square (since by Step 3, you always overshoot). Therefore, the sequence grows without bound and is never constant.
Hence the sequence eventually becomes constant if and only if is a perfect square.
Example verification: Start at .
- (since ), , so .
- (since ), , so .
- , , so .
- , , so .
- And so on โ it keeps jumping past every perfect square (skipping 16, 25, ...).
Compare with : , so it's immediately constant. โ
Source: Putnam 1991, Problem B-1