{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":52060,"title":"Identify Ruth-Aaron numbers","description":"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. \r\nHe 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.”*\r\nWrite 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’.\r\n*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!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 237px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 118.5px; transform-origin: 407px 118.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 16.7167px 7.91667px; transform-origin: 16.7167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAfter \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.youtube.com/watch?v=QjqYThEVoSQ\"\u003e\u003cspan style=\"perspective-origin: 70.8px 7.91667px; transform-origin: 70.8px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eHank Aaron hit his 715\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"perspective-origin: 5.83333px 7.91667px; transform-origin: 5.83333px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eth\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"perspective-origin: 31.5083px 7.91667px; transform-origin: 31.5083px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003e home run\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 259.142px 7.91667px; transform-origin: 259.142px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime factors of the numbers (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAAAkCAYAAAB2ff0HAAAD70lEQVR4nO2c0XnqMAyFzw7ZgAWyQCZgAjZgAzZgBWZgBHboCpmBFdqHoItJCZFtyXZ6z/99fmlpkOwjW5adAoQQQgghhBBCCCGEEELKcQBwUrZDxDN3GTb1j+/LeUZNegBHPPttqGsOgFebcscnBw+9eaHpJ3N/OgB3AN/KdlIYOD4+22sMWLEp9Rm12AG44X3ffaGOPz2eYxI7ntZY680LrY5d/Dk8PjxiEtNSk4cuzRoDfg98qgCvBs+oQThAX5j6bd4nI8r61D9sugHYYxqn48yuY0F7rPTmRayOXfwZAZxXPrPDU2jv2D9ah/yAOsImsGtwxRQAc5sHTH0nPl0L2jTifcrU4Sm+pXH1sidXb16k6NjcnwFTFK8hgaJZek9ID6g++J6tBaV0/JK98vtvTIHbFbBJ9jpLnAN7SuChNy80GnTzR7OcyiyvCZDUgOoe33PG5OzWgvKE9RmzdFre43Pwy1hphGWFtd680Oq4ij8yw4/Kz6cG5RmTODpsMyg1VbrWMgCZJPa1DQmI1ZsXVmPl4o8svWurgJDizB6vm+AtBqUG6ZtS6eInZKugHddSxOrNC6ugdPFHll7tOVusM1KxDIsRuUG5g/7c6FOzPluUlam24AZMfX5Fmb1tDLF688IqKM39SVl6Y5254Xc1Mjcow7/PadZHBXJcUuvQfgBwwauPd7STvraSugI2QdlE6grEOSPnZfPZupWV0jJ1lvOsWhXFAU+/3l1uqL0yAe2kroBNUDaRugJ6Z2RP8+7Zf21PKWeCUsiKRW7kWK5q85tHsWeCHjblpnqWNlkEZROpK6BzRo4/llaNvxaUF7zPCLSERymWqVB4geCOuLTa2iaLVM/SptygbCZ1BXTOnDGJYCltDPc95+DnW7ycfkC84OeEfWp9Gyi8QRUjPmubLFI9S5tyg9IldZUZNHbp1TizdGF7rWk7p5Xqq0VAhs86wL5aGmYlsXZa2pSqtzlWNuUGpZU//5D9XsrSq3Fm7VWXcKW8BD/XdnQL1VfLgPRE+qpmxTNHb15YXBc19UfuRKYsvRYb5K1XX+Uc8FNA7lD/XUGgjXumOXrzIkfHLv7I0ptSwWohKGsir0p96jspdHmfD8qVxaXJQQo9X6h7iSBHb17k6NjcH1l6U99kkFnifwxKCUh5f3Gp3VEmVQurkfP0XyaGEXVT7Fy9eZGqYxd/xJhL5N91eO6jwgpYyoBvMSglILX71RLpYjjbi1BkYhgxpa61AyFVb17k6tjFHynCxATD2h4utmASPq+2aLTE/J+Wkn7J/zqStkdbE12K3ryw0HFL/hBCCCGEEEIIIYQQQgghhBBCCCFkC/wA3XKASxKIoOMAAAAASUVORK5CYII=\" alt=\"714 = 2*3*7*17\" style=\"width: 114.5px; height: 18px;\" width=\"114.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.5583px 7.91667px; transform-origin: 15.5583px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM8AAAAkCAYAAAAuAm4eAAADrUlEQVR4nO2b3bXqIBCFdw/pwAbSQCqwAjuwAzuwBWuwhNODLaSGtHDvA5klRkkYGAR1f2vxZCDzw8AwQYAQQgghhBBCCCHkS+jm9k3sagtAbDgAOEW2g2JMzQRZk+GGzwueAWF9rgD29UQDoPePVd9SaGXqARxxn9NJ+nQAJgD/IttpY7wDgHF+to+UYbfxzku0Nu0gNnjVxopypfjHom8ptDL1CPtma26/fLk49G+lyQtCETq8ECrWwBe4AA69u7VVbguxaUifGrtOjn9y+pYiRaYe93m2n8c4LsY5aoQYAZw3npGd4Rb4fT+3Di4l0RhYxq6dxlgSY9N3kuOfnL6lSJVpxOtjR4d7AIXm+BMDXBRucUT8tnaCzsBnOME/7UwTYo/6k2sNrX+s+pYiViY5U4c4z2NMmpfHpEQ3xBtMY2A5b41zP1lNPhlJcbMOogX51eDpsT63ZJyYzSQaSatiD7kaA/vPLgsEQ4qwlRnwWp8/xFcpS/OrwbOFpH+mxwdJ2WJzeI0yfr5qUv2ozAnrlcsr6u+sDJ5neujmeDSSssXuBCnKdHARf4FNAO0Q/91qreXsfgOcM5bBZJoWJMDgeWSA85H5wqZN2YB8ZXZ4LI2njBNKn7RNVbYM0OF+GLUcNxUGj2PA82I9wTBt06ZsgJ2BfcW026nVzmM5QeTbj6ocWgAGz+Ptj+VCrcmyVtGmbICdgZNq740jZ7wJ+qskI2xWxhaCpxV9hGW2kz3fUlI2wHZ1Sqq9N4x8A9Laxi+s5F7taSF4WtHHx1+stYvbEykpG2AbPHJ2+ZbgAdJs49v0mvn+FoKnFX2WyJzPHkuiUJv/lQge7TbaQrUthNhGW9k5zC23ItRC8ABt6LPELzQl7zxS907ZUq0NnLL7tVRt89m6I/gOWgkeK0oET1YqKWeNlI9GlsrIIU47TovVNuBuG5aq7SiRtmV9nJeULaUSEquMlAtD11ZkFbgkyFADCdgjXqcico+v9h/7fjV4Org5FUrHpGCQ5R9J2abEQfwPgmvK+OnR3+JZ+ep7SZShBn6pc8TjwrODc8oN9S+KxvrHum8pYmXyK3wnPM6rDs43IzL9I8JoV/wObhfxr6NcV4TxVww/iESJVi5SxrLH81WcG5xOE54d9m60/rHqW4rc+eb/+XJEOGNQIf970KwsW2eMUI6/w/1/5JLCfeJtakEc6us9oP7umeqf3L6lSJWpXzy3Rzs7KCGEEEIIIYQQQgghhBBCCCGEtMV/m09p4GPXQvwAAAAASUVORK5CYII=\" alt=\"715 = 5*11*13\" style=\"width: 103.5px; height: 18px;\" width=\"103.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 144.3px 7.91667px; transform-origin: 144.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e) comprises all of the prime numbers up to 17. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.158px 7.91667px; transform-origin: 383.158px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHe 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.”*\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 365.35px 7.91667px; transform-origin: 365.35px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite 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’.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 78.9583px 7.91667px; transform-origin: 78.9583px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*The story continues in a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.youtube.com/watch?v=aCq04N9it8U\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eNumberphile video\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 232.967px 7.91667px; transform-origin: 232.967px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e on this topic, and I highly recommend that you watch it. Go for the number theory and stay for the life lessons!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = RuthAaron(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 5;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 25;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 51;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 78;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 101;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 153;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 222;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 493;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 713;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 714;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 715;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 716;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 24024;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 154843;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 977779;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 6905998;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 29817473;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 89460293;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 89460294;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 89460295;\r\nassert(isequal(RuthAaron(n),'RA'))\r\n\r\n%%\r\nn = 89460296;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%  \r\nn = 89460297;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 144426976;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 333333333;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 715159952;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 888681984;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 1925922590;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 1925922591;\r\nassert(isequal(RuthAaron(n),'A'))","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-11T02:03:10.000Z","updated_at":"2025-12-07T20:22:27.000Z","published_at":"2021-06-11T02:14:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAfter \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.youtube.com/watch?v=QjqYThEVoSQ\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHank Aaron hit his 715\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eth\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e home run\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime factors of the numbers (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"714 = 2*3*7*17\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e714 = 2\\\\cdot 3\\\\cdot 7 \\\\cdot 17\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"715 = 5*11*13\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e715 = 5\\\\cdot 11 \\\\cdot 13\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e) comprises all of the prime numbers up to 17. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHe 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.”*\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite 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’.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e*The story continues in a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.youtube.com/watch?v=aCq04N9it8U\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNumberphile video\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e on this topic, and I highly recommend that you watch it. Go for the number theory and stay for the life lessons!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":52060,"title":"Identify Ruth-Aaron numbers","description":"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. \r\nHe 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.”*\r\nWrite 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’.\r\n*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!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 237px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 118.5px; transform-origin: 407px 118.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 16.7167px 7.91667px; transform-origin: 16.7167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAfter \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.youtube.com/watch?v=QjqYThEVoSQ\"\u003e\u003cspan style=\"perspective-origin: 70.8px 7.91667px; transform-origin: 70.8px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eHank Aaron hit his 715\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"perspective-origin: 5.83333px 7.91667px; transform-origin: 5.83333px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eth\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"perspective-origin: 31.5083px 7.91667px; transform-origin: 31.5083px 7.91667px; \"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003e home run\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 259.142px 7.91667px; transform-origin: 259.142px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime factors of the numbers (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAAAkCAYAAAB2ff0HAAAD70lEQVR4nO2c0XnqMAyFzw7ZgAWyQCZgAjZgAzZgBWZgBHboCpmBFdqHoItJCZFtyXZ6z/99fmlpkOwjW5adAoQQQgghhBBCCCGEEELKcQBwUrZDxDN3GTb1j+/LeUZNegBHPPttqGsOgFebcscnBw+9eaHpJ3N/OgB3AN/KdlIYOD4+22sMWLEp9Rm12AG44X3ffaGOPz2eYxI7ntZY680LrY5d/Dk8PjxiEtNSk4cuzRoDfg98qgCvBs+oQThAX5j6bd4nI8r61D9sugHYYxqn48yuY0F7rPTmRayOXfwZAZxXPrPDU2jv2D9ah/yAOsImsGtwxRQAc5sHTH0nPl0L2jTifcrU4Sm+pXH1sidXb16k6NjcnwFTFK8hgaJZek9ID6g++J6tBaV0/JK98vtvTIHbFbBJ9jpLnAN7SuChNy80GnTzR7OcyiyvCZDUgOoe33PG5OzWgvKE9RmzdFre43Pwy1hphGWFtd680Oq4ij8yw4/Kz6cG5RmTODpsMyg1VbrWMgCZJPa1DQmI1ZsXVmPl4o8svWurgJDizB6vm+AtBqUG6ZtS6eInZKugHddSxOrNC6ugdPFHll7tOVusM1KxDIsRuUG5g/7c6FOzPluUlam24AZMfX5Fmb1tDLF688IqKM39SVl6Y5254Xc1Mjcow7/PadZHBXJcUuvQfgBwwauPd7STvraSugI2QdlE6grEOSPnZfPZupWV0jJ1lvOsWhXFAU+/3l1uqL0yAe2kroBNUDaRugJ6Z2RP8+7Zf21PKWeCUsiKRW7kWK5q85tHsWeCHjblpnqWNlkEZROpK6BzRo4/llaNvxaUF7zPCLSERymWqVB4geCOuLTa2iaLVM/SptygbCZ1BXTOnDGJYCltDPc95+DnW7ycfkC84OeEfWp9Gyi8QRUjPmubLFI9S5tyg9IldZUZNHbp1TizdGF7rWk7p5Xqq0VAhs86wL5aGmYlsXZa2pSqtzlWNuUGpZU//5D9XsrSq3Fm7VWXcKW8BD/XdnQL1VfLgPRE+qpmxTNHb15YXBc19UfuRKYsvRYb5K1XX+Uc8FNA7lD/XUGgjXumOXrzIkfHLv7I0ptSwWohKGsir0p96jspdHmfD8qVxaXJQQo9X6h7iSBHb17k6NjcH1l6U99kkFnifwxKCUh5f3Gp3VEmVQurkfP0XyaGEXVT7Fy9eZGqYxd/xJhL5N91eO6jwgpYyoBvMSglILX71RLpYjjbi1BkYhgxpa61AyFVb17k6tjFHynCxATD2h4utmASPq+2aLTE/J+Wkn7J/zqStkdbE12K3ryw0HFL/hBCCCGEEEIIIYQQQgghhBBCCCFkC/wA3XKASxKIoOMAAAAASUVORK5CYII=\" alt=\"714 = 2*3*7*17\" style=\"width: 114.5px; height: 18px;\" width=\"114.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.5583px 7.91667px; transform-origin: 15.5583px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM8AAAAkCAYAAAAuAm4eAAADrUlEQVR4nO2b3bXqIBCFdw/pwAbSQCqwAjuwAzuwBWuwhNODLaSGtHDvA5klRkkYGAR1f2vxZCDzw8AwQYAQQgghhBBCCCHkS+jm9k3sagtAbDgAOEW2g2JMzQRZk+GGzwueAWF9rgD29UQDoPePVd9SaGXqARxxn9NJ+nQAJgD/IttpY7wDgHF+to+UYbfxzku0Nu0gNnjVxopypfjHom8ptDL1CPtma26/fLk49G+lyQtCETq8ECrWwBe4AA69u7VVbguxaUifGrtOjn9y+pYiRaYe93m2n8c4LsY5aoQYAZw3npGd4Rb4fT+3Di4l0RhYxq6dxlgSY9N3kuOfnL6lSJVpxOtjR4d7AIXm+BMDXBRucUT8tnaCzsBnOME/7UwTYo/6k2sNrX+s+pYiViY5U4c4z2NMmpfHpEQ3xBtMY2A5b41zP1lNPhlJcbMOogX51eDpsT63ZJyYzSQaSatiD7kaA/vPLgsEQ4qwlRnwWp8/xFcpS/OrwbOFpH+mxwdJ2WJzeI0yfr5qUv2ozAnrlcsr6u+sDJ5neujmeDSSssXuBCnKdHARf4FNAO0Q/91qreXsfgOcM5bBZJoWJMDgeWSA85H5wqZN2YB8ZXZ4LI2njBNKn7RNVbYM0OF+GLUcNxUGj2PA82I9wTBt06ZsgJ2BfcW026nVzmM5QeTbj6ocWgAGz+Ptj+VCrcmyVtGmbICdgZNq740jZ7wJ+qskI2xWxhaCpxV9hGW2kz3fUlI2wHZ1Sqq9N4x8A9Laxi+s5F7taSF4WtHHx1+stYvbEykpG2AbPHJ2+ZbgAdJs49v0mvn+FoKnFX2WyJzPHkuiUJv/lQge7TbaQrUthNhGW9k5zC23ItRC8ABt6LPELzQl7zxS907ZUq0NnLL7tVRt89m6I/gOWgkeK0oET1YqKWeNlI9GlsrIIU47TovVNuBuG5aq7SiRtmV9nJeULaUSEquMlAtD11ZkFbgkyFADCdgjXqcico+v9h/7fjV4Org5FUrHpGCQ5R9J2abEQfwPgmvK+OnR3+JZ+ep7SZShBn6pc8TjwrODc8oN9S+KxvrHum8pYmXyK3wnPM6rDs43IzL9I8JoV/wObhfxr6NcV4TxVww/iESJVi5SxrLH81WcG5xOE54d9m60/rHqW4rc+eb/+XJEOGNQIf970KwsW2eMUI6/w/1/5JLCfeJtakEc6us9oP7umeqf3L6lSJWpXzy3Rzs7KCGEEEIIIYQQQgghhBBCCCGEtMV/m09p4GPXQvwAAAAASUVORK5CYII=\" alt=\"715 = 5*11*13\" style=\"width: 103.5px; height: 18px;\" width=\"103.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 144.3px 7.91667px; transform-origin: 144.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e) comprises all of the prime numbers up to 17. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.158px 7.91667px; transform-origin: 383.158px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHe 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.”*\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 365.35px 7.91667px; transform-origin: 365.35px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite 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’.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 78.9583px 7.91667px; transform-origin: 78.9583px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*The story continues in a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.youtube.com/watch?v=aCq04N9it8U\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eNumberphile video\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 232.967px 7.91667px; transform-origin: 232.967px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e on this topic, and I highly recommend that you watch it. Go for the number theory and stay for the life lessons!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = RuthAaron(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 5;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 25;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 51;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 78;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 101;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 153;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 222;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 493;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 713;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 714;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 715;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 716;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 24024;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 154843;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 977779;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 6905998;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 29817473;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 89460293;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 89460294;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 89460295;\r\nassert(isequal(RuthAaron(n),'RA'))\r\n\r\n%%\r\nn = 89460296;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%  \r\nn = 89460297;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 144426976;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 333333333;\r\nassert(isequal(RuthAaron(n),'X'))\r\n\r\n%%\r\nn = 715159952;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 888681984;\r\nassert(isequal(RuthAaron(n),'A'))\r\n\r\n%%\r\nn = 1925922590;\r\nassert(isequal(RuthAaron(n),'R'))\r\n\r\n%%\r\nn = 1925922591;\r\nassert(isequal(RuthAaron(n),'A'))","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-11T02:03:10.000Z","updated_at":"2025-12-07T20:22:27.000Z","published_at":"2021-06-11T02:14:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAfter \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.youtube.com/watch?v=QjqYThEVoSQ\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHank Aaron hit his 715\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eth\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e home run\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime factors of the numbers (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"714 = 2*3*7*17\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e714 = 2\\\\cdot 3\\\\cdot 7 \\\\cdot 17\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"715 = 5*11*13\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e715 = 5\\\\cdot 11 \\\\cdot 13\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e) comprises all of the prime numbers up to 17. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHe 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.”*\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite 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’.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e*The story continues in a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.youtube.com/watch?v=aCq04N9it8U\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNumberphile video\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e on this topic, and I highly recommend that you watch it. Go for the number theory and stay for the life lessons!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"have fun\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"have fun\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"have fun\"","","\"","have fun","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7725f64ed0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7725f64e30\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7725f64110\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7725f65150\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7725f650b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7725f65010\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7725f64f70\u003e":"tag:\"have fun\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7725f64f70\u003e":"tag:\"have fun\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"have fun\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"have fun\"","","\"","have fun","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7725f64ed0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7725f64e30\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7725f64110\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7725f65150\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7725f650b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7725f65010\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7725f64f70\u003e":"tag:\"have fun\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7725f64f70\u003e":"tag:\"have fun\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":52060,"difficulty_rating":"easy-medium"}]}}