๐Ÿงฎ Brain Teaser

The Expression That Only Skips Perfect Cubes

Determine all possible values of the expression

A3+B3+C3โˆ’3ABCA^3 + B^3 + C^3 - 3ABC

where AA, BB, and CC are nonnegative integers.

(Putnam 2019, A1)

algebraic identitynumber theorymodular arithmeticfactoringnonneg integers

Answer: The Expression That Only Skips Perfect Cubes

Key Idea / Intuition

The algebraic identity A3+B3+C3โˆ’3ABC=(A+B+C)(A2+B2+C2โˆ’ABโˆ’BCโˆ’CA)A^3 + B^3 + C^3 - 3ABC = (A+B+C)(A^2+B^2+C^2-AB-BC-CA) is the key. The second factor can be rewritten as 12[(Aโˆ’B)2+(Bโˆ’C)2+(Cโˆ’A)2]\frac{1}{2}[(A-B)^2+(B-C)^2+(C-A)^2], which is always a nonnegative integer. So the expression factors into a product of two nonneg integers and you need to figure out exactly which nonneg integers arise โ€” it turns out almost all do, except one family is skipped.


Formal Proof / Solution

Step 1: Factor the expression.

Use the classical identity: A3+B3+C3โˆ’3ABC=(A+B+C)โ‹…(Aโˆ’B)2+(Bโˆ’C)2+(Cโˆ’A)22.A^3 + B^3 + C^3 - 3ABC = (A+B+C)\cdot\frac{(A-B)^2+(B-C)^2+(C-A)^2}{2}.

Let s=A+B+Cโ‰ฅ0s = A+B+C \geq 0 and q=(Aโˆ’B)2+(Bโˆ’C)2+(Cโˆ’A)22โ‰ฅ0q = \frac{(A-B)^2+(B-C)^2+(C-A)^2}{2} \geq 0. Both ss and qq are nonneg integers (note that the three squared differences have the same parity when A,B,CA,B,C are integers, so their sum is always even).

So the expression equals sqsq where s,qโ‰ฅ0s,q \geq 0 are nonneg integers.

Step 2: Which values sqsq can be achieved?

We claim the answer is: all nonneg integers except those of the form 9m+39m+3 or 9m+69m+6, i.e., all nonneg integers not congruent to 33 or 6(mod9)6 \pmod{9}.

Step 3: Show values โ‰ก3\equiv 3 or 6(mod9)6 \pmod 9 are impossible.

Consider everything mod 9. Cubes mod 9 can only be 0,1,8โ‰กโˆ’10, 1, 8 \equiv -1. So:

| nโ€Šmodโ€Š3n \bmod 3 | n3โ€Šmodโ€Š9n^3 \bmod 9 | |---|---| | 0 | 0 | | 1 | 1 | | 2 | 8 โ‰ก โˆ’1 |

The expression A3+B3+C3โˆ’3ABC(mod9)A^3+B^3+C^3-3ABC \pmod 9: since 3ABCโ‰ก0,3,6(mod9)3ABC \equiv 0,3,6 \pmod 9, one checks (by exhaustive case analysis on (A,B,C)โ€Šmodโ€Š3(A,B,C)\bmod 3) that the expression can never be โ‰ก3\equiv 3 or โ‰ก6(mod9)\equiv 6 \pmod 9.

For instance if Aโ‰กBโ‰กCโ‰ก1(mod3)A\equiv B\equiv C\equiv 1\pmod{3}, then A3+B3+C3โ‰ก3A^3+B^3+C^3\equiv 3 and 3ABCโ‰ก3โ‹…1โ‹…1โ‹…1=33ABC\equiv 3\cdot 1\cdot 1\cdot 1 = 3, giving 00. Running all 2727 cases (or noting the factored form: sโ‰ก0,3,6(mod9)s\equiv 0,3,6\pmod 9 and qq is always โ‰ก0,1,2(mod3)\equiv 0,1,2\pmod 3 but qโ‰ก0(mod3)q\equiv 0\pmod 3 when sโ‰ก0(mod3)s\equiv 0\pmod 3, etc.) confirms sqโ‰กฬธ3,6(mod9)sq \not\equiv 3,6 \pmod 9.

Step 4: Every other nonneg integer is achieved.

  • n=0n = 0: take A=B=C=0A=B=C=0.
  • n=1n = 1: take (A,B,C)=(1,0,0)(A,B,C)=(1,0,0).
  • n=2n = 2: take (A,B,C)=(1,1,0)(A,B,C)=(1,1,0).
  • For nโ‰ก0(mod9)n \equiv 0 \pmod 9 (say n=9kn = 9k): take (A,B,C)=(k+1,kโˆ’1,kโˆ’1)(A,B,C) = (k+1,k-1,k-1) so s=3kโˆ’1s=3k-1...

More cleanly: given target nโ‰กฬธ3,6(mod9)n \not\equiv 3,6\pmod 9, we can use:

  • (A,B,C)=(n,0,0)(A,B,C)=(n,0,0) gives n3n^3, so all perfect cubes arise.
  • (A,B,C)=(k,k,0)(A,B,C)=(k,k,0) gives 2k32k^3, (k+1,k,0)(k+1,k,0) gives (2k+1)(k2+1โˆ’k(k+1))=...(2k+1)(k^2+1-k(k+1)) = ...

In fact, the simplest constructive argument: any nโ‰ฅ0n \geq 0 with nโ‰กฬธ3,6(mod9)n\not\equiv 3,6\pmod 9 can be written as sqsq with the pair achievable. Key examples:

  • n=1n=1: (1,0,0)(1,0,0) gives 1โ‹…1=11\cdot 1 = 1. โœ“
  • n=2n=2: (1,1,0)(1,1,0) gives s=2,q=1s=2, q=1, expression =2= 2. โœ“
  • n=4n=4: (2,1,0):s=3,q=(1+4+1)/2=3(2,1,0): s=3, q = (1+4+1)/2 = 3... wait, (Aโˆ’B)2+(Bโˆ’C)2+(Cโˆ’A)2=1+1+4=6(A-B)^2+(B-C)^2+(C-A)^2 = 1+1+4=6, q=3q=3, s=3s=3, product =9= 9. Let's try (2,2,0):s=4,q=(0+4+4)/2=4(2,2,0): s=4, q=(0+4+4)/2=4, product =16=16. Try (1,1,0):(1,1,0): product =2= 2. For n=4n=4: (2,1,1):s=4,q=(1+0+1)/2=1(2,1,1): s=4, q=(1+0+1)/2=1, product =4=4. โœ“

Conclusion.

The set of all possible values is: {nโˆˆZโ‰ฅ0:nโ‰กฬธ3ย andย nโ‰กฬธ6(mod9)}.\boxed{\{n \in \mathbb{Z}_{\geq 0} : n \not\equiv 3 \text{ and } n\not\equiv 6 \pmod{9}\}}.

That is, the expression takes all nonneg integer values except those congruent to 33 or 66 modulo 99.

Source: Putnam 2019, Problem A1

Type: PutnamSource: Putnam 2019, Problem A1Edit on GitHub โ†—