# 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 ( and ) 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

62.79% Correct | 37.21% Incorrect
Last Solution submitted on Mar 22, 2024

### Community Treasure Hunt

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

Start Hunting!