AMC 10 to AIME Number Theory: Group a GCD Sum by Its Possible Divisors

A sum involving many greatest common divisors often hides a small classification problem. Consider the original exercise S = gcd(1,12) + gcd(2,12) + ... + gcd(12,12). Instead of treating the twelve terms as unrelated computations, classify the integers by their exact greatest common divisor with 12. This is a method exercise, not a current AMC or AIME question.

Need help choosing a next step? Scan the contact QR code below or contact Hanlin on WeChat. Send AMC10-GCD-1124 and tell us your school year and question.

List the only possible class labels

Every gcd(k,12) must divide 12, so its possible values are 1,2,3,4,6 and 12. These values define disjoint classes: each k belongs to exactly one of them. Simply counting multiples of each divisor would create overlaps. For example, k = 12 is a multiple of 2,3,4 and 6, but its exact gcd with 12 is only 12.

Count the first two classes explicitly

The integers from 1 to 12 coprime to 12 are 1,5,7 and 11, contributing four terms of value 1. Exact gcd 2 occurs for 2 and 10, contributing two terms of value 2. The multiple 6 is excluded from that class because its gcd is 6; the multiple 4 is excluded because its gcd is 4. The word exact is doing real work.

Complete the divisor table

Exact gcd 3 occurs for 3 and 9, exact gcd 4 for 4 and 8, exact gcd 6 only for 6, and exact gcd 12 only for 12. The class sizes are therefore 4,2,2,2,1 and 1. They sum to 12, checking that every original index has been counted once. The weighted sum is 4 + 4 + 6 + 8 + 6 + 12 = 40.

Explain the general counting mechanism

If gcd(k,n) = d, write k = dj and n = dm. The condition becomes gcd(j,m) = 1, with j between 1 and m. Thus the number of indices in the class labelled d is the number of integers in that range coprime to n/d. Using the standard notation phi for that count gives the identity sum gcd(k,n) = sum d phi(n/d), where the second sum runs over positive divisors d of n.

Handle the endpoint convention

When d = n, the reduced range contains only j = 1, and gcd(1,1) = 1. Consequently the last class has one member, consistent with phi(1) = 1. Omitting k = n or treating that class as empty changes the answer. A written solution should state whether its original sum includes both endpoints before applying a remembered identity.

Build an AIME-style checking routine

For a larger n, factor n to list divisors, count each reduced coprime class, and verify that all class sizes sum to n. This checks the partition independently of the weighted total. The useful transition from AMC 10 practice to deeper problems is learning why a compression works; there is no need to assume an invitation threshold or contest date in order to practise that skill.

Continue reading: AMC 10 to AIME: Recovering Numbers from Their GCD and LCM.

Contact Hanlin

Planning a first attempt or reviewing a topic you find difficult? Scan the QR code and send AMC10-GCD-1124. Include your school year, country or competition region, experience and the question you want to discuss.

Scan to contact Hanlin on WeChat. Send AMC10-GCD-1124.

Contact Hanlin on WeChat

On your phone, use the button or save the QR image and scan it within WeChat.

Official information and further reading: Source 1

Online Customer Service
Contact Customer Service