Small refactor to consolidate which numbers count as perfect_numbers or major_minor_numbers