Problem 52060. Identify Ruth-Aaron numbers

After Hank Aaron hit his 715th home run and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime factors of the numbers (714 = 2*3*7*17 and 715 = 5*11*13) comprises all of the prime numbers up to 17.
He told a colleague that he found an interesting property of the two numbers, and when the colleague posed the problem to a class, a student observed that the sums of the prime factors of these two consecutive numbers were equal—in this case, 29. Prof. Pomerance and colleagues named numbers with this property “Ruth-Aaron numbers.”*
Write a function to classify numbers in this way. In computing sums, include only the unique factors. If a number is the lesser of a Ruth-Aaron pair, return ‘R’. If it is the greater number, return ‘A’. If multiple pairs overlap, return ‘RA’ for numbers that can serve as either the lesser or greater. If the number is not part of a Ruth-Aaron pair, return ‘X’.
*The story continues in a Numberphile video on this topic, and I highly recommend that you watch it. Go for the number theory and stay for the life lessons!

Solution Stats

63.64% Correct | 36.36% Incorrect
Last Solution submitted on Nov 10, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers23

Suggested Problems

More from this Author281

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!