Skip to main content

1996 AIME Problem 14

Problem 14 of 15HarderGeometryNumber TheoryCombinatorics

A 150×324×375150\times324\times375 rectangular solid is made by gluing together 1×1×11\times1\times1 cubes. An internal diagonal of this solid passes through the interiors of how many of the 1×1×11\times1\times1 cubes?

Your answer

Integer from 0 to 999
Show solution

Solution

For an a×b×ca\times b\times c array, the diagonal crosses a−1,a-1, b−1,b-1, and c−1c-1 internal grid planes of the three orientations. Crossings of two orientations coincide gcd⁡(a,b)−1,\gcd(a,b)-1, gcd⁡(a,c)−1,\gcd(a,c)-1, and gcd⁡(b,c)−1\gcd(b,c)-1 times, and triple crossings occur gcd⁡(a,b,c)−1\gcd(a,b,c)-1 times. Adding one for the initial cube and applying inclusion-exclusion gives a+b+c−gcd⁡(a,b)−gcd⁡(a,c)−gcd⁡(b,c)+gcd⁡(a,b,c).\begin{gathered}a+b+c-\gcd(a,b)\\-\gcd(a,c)-\gcd(b,c)\\+\gcd(a,b,c).\end{gathered} Here the pairwise gcds are 6,6, 75,75, and 3,3, and the triple gcd is 3.3. Thus the number of cube interiors met is 150+324+375−6−75−3+3=768.\begin{gathered}150+324+375\\-6-75-3+3=768.\end{gathered}
AoPS wiki

Tagged: rectangular prism · inclusion-exclusion · greatest common divisor

More practice