{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-26T00:14:02.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":"2026-04-26T00: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":51798,"title":"Label primes with the Erdos-Selfridge classification","description":"","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: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72px; transform-origin: 407px 72px; 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: 225.233px 7.91667px; transform-origin: 225.233px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eErdos and Selfridge developed a scheme for classifying a prime number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 66.875px 7.91667px; transform-origin: 66.875px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e: If the only factors of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAABjUlEQVRoge2ZbRGDMAyGXw91gIEZQEEV4GAO5gALaEACHrAwDVjYfqS95XrA+EhhYXnucre7QkrfS9K0AwzDMAzDuBYVgOLsj/hVKgBPAC8At5O/5eco8REnmlqRymBO0KcP5gC0uIBIuRfwOGCO7JhIC1AlkgPVBh8cN8EA2jprAF2wB+RqiEqReKGrwyTP8LthYz1khFIlUqRkTjuQaJyOjXuB+VSKxJ2mAqXjtcB8KkXqg8MB4238WpGq8M6Upak9ZVsRF8lhPooAWsyadOPpudWGTashxEXyzGE18UzPnllyYFwaSc3MM/dNqyHERYq714DxnavA90hbi7qaFA+ES1JNalGqROJRMhbeBSjCXthXSFNUiVR9cRZrkVSaRVSJxDvttB7FWtWkLwmQWyTREhFTiW/tHhRBPagTz0EukRwoO/i6Wuy4wr0xRzU+2/YR98I5RCow33ZsainOvHPJcTOZhdgV7+lsL82So8jfw48ie9r/S+JAAvG/XVooqQ9HEW8ix8xEMgwjN2+nbdxCK/6HXQAAAABJRU5ErkJggg==\" alt=\"p+1\" style=\"width: 36.5px; height: 18px;\" width=\"36.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: 67.6083px 7.91667px; transform-origin: 67.6083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are 2 and 3, then put \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 136.125px 7.91667px; transform-origin: 136.125px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in class 1. Otherwise, find the largest class \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003er\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: 52.1px 7.91667px; transform-origin: 52.1px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of the factors of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAABjUlEQVRoge2ZbRGDMAyGXw91gIEZQEEV4GAO5gALaEACHrAwDVjYfqS95XrA+EhhYXnucre7QkrfS9K0AwzDMAzDuBYVgOLsj/hVKgBPAC8At5O/5eco8REnmlqRymBO0KcP5gC0uIBIuRfwOGCO7JhIC1AlkgPVBh8cN8EA2jprAF2wB+RqiEqReKGrwyTP8LthYz1khFIlUqRkTjuQaJyOjXuB+VSKxJ2mAqXjtcB8KkXqg8MB4238WpGq8M6Upak9ZVsRF8lhPooAWsyadOPpudWGTashxEXyzGE18UzPnllyYFwaSc3MM/dNqyHERYq714DxnavA90hbi7qaFA+ES1JNalGqROJRMhbeBSjCXthXSFNUiVR9cRZrkVSaRVSJxDvttB7FWtWkLwmQWyTREhFTiW/tHhRBPagTz0EukRwoO/i6Wuy4wr0xRzU+2/YR98I5RCow33ZsainOvHPJcTOZhdgV7+lsL82So8jfw48ie9r/S+JAAvG/XVooqQ9HEW8ix8xEMgwjN2+nbdxCK/6HXQAAAABJRU5ErkJggg==\" alt=\"p+1\" style=\"width: 36.5px; height: 18px;\" width=\"36.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: 27.225px 7.91667px; transform-origin: 27.225px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and put \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 27.225px 7.91667px; transform-origin: 27.225px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in class \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAAkCAYAAAAw55zoAAABPUlEQVRoge2YYc3CMBCGHw9zMAMYmAIUzMEczAEW0DAJeMDCNMzCx4+22UHCgPb6jQv3JJeQZbleX9p724HjOI7jOOX0QLt3Ed9AD8zAH3DYuZZd6ViFSGFCkC5Go5jzGKMBJowJUrvY8R/GUMUFecCUIC1hf4+sltUAQ3ymse9NCDIAF5FoIUz+EH+n56fCYsGIIIkkyiUmm4GzGGAsHQBjgiQfH4Er4ZADwdIGfmjLQOgZKdFEWBk59LGoZyG339Z7uagJ0otEM/n3ANmLcmPJnQSKgsgTXknzfHeFnDfeGQrGVxMkuclC3VuiiR7Scf/P1cSEICeNJG9iQpArazOtzdcLIu1W4+D1itqCFK92abedXl1PqSVIQ5iLvGpMZBjEkfLD0CfUEKRl2+pLbLw6Nb6YOY7jOI7jmOMG9q+tsmHOoW8AAAAASUVORK5CYII=\" alt=\"r+1\" style=\"width: 34px; height: 18px;\" width=\"34\" 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: 3.88333px 7.91667px; transform-origin: 3.88333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. \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: 379.108px 7.91667px; transform-origin: 379.108px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, 11 is in class 1 because 12 has prime factors 2, 2, and 3. The number 43 is in class 2 because 44 has prime factors 2, 2, and 11, and all of those are in class 1. All \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/525-mersenne-primes\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMersenne primes\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: 69.625px 7.91667px; transform-origin: 69.625px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are in class 1, and all \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45296\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eugly numbers\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: 50.7833px 7.91667px; transform-origin: 50.7833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are in classes 1 or 2. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; 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 10.5px; text-align: left; transform-origin: 384px 10.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: 189.683px 7.91667px; transform-origin: 189.683px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to classify prime numbers using this scheme.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = classifyES(p)\r\n  y = f(p);\r\nend","test_suite":"%%\r\nassert(isequal(classifyES(5),1))\r\n \r\n%%\r\nassert(isequal(classifyES(11),1))\r\n \r\n%%\r\nassert(isequal(classifyES(13),2))\r\n \r\n%%\r\nassert(isequal(classifyES(19),2))\r\n \r\n%%\r\nassert(isequal(classifyES(29),2))\r\n \r\n%%\r\nassert(isequal(classifyES(37),3))\r\n \r\n%%\r\nassert(isequal(classifyES(103),3))\r\n \r\n%%\r\nassert(isequal(classifyES(113),3))\r\n \r\n%%\r\nassert(isequal(classifyES(73),4))\r\n \r\n%%\r\nassert(isequal(classifyES(313),4))\r\n \r\n%%\r\nassert(isequal(classifyES(443),4))\r\n \r\n%%\r\nassert(isequal(classifyES(1021),5))\r\n \r\n%%\r\nassert(isequal(classifyES(1321),5))\r\n \r\n%%\r\nassert(isequal(classifyES(1381),5))\r\n \r\n%%\r\nassert(isequal(classifyES(2917),6))\r\n \r\n%%\r\nassert(isequal(classifyES(4933),6))\r\n \r\n%%\r\nassert(isequal(classifyES(5413),6))\r\n \r\n%%\r\nassert(isequal(classifyES(15013),7))\r\n \r\n%%\r\nassert(isequal(classifyES(16333),7))\r\n \r\n%%\r\nassert(isequal(classifyES(22093),7))\r\n \r\n%%\r\nassert(isequal(classifyES(49681),8))\r\n \r\n%%\r\nassert(isequal(classifyES(109441),8))\r\n \r\n%%\r\nassert(isequal(classifyES(120103),8))\r\n \r\n%%\r\nassert(isequal(classifyES(532801),9))\r\n \r\n%%\r\nassert(isequal(classifyES(710341),9))\r\n \r\n%%\r\nassert(isequal(classifyES(720617),9))\r\n \r\n%%\r\nassert(isequal(classifyES(995327),1))\r\n \r\n%%\r\nassert(isequal(classifyES(999809),2))\r\n \r\n%%\r\nassert(isequal(classifyES(999983),3))\r\n \r\n%%\r\nassert(isequal(classifyES(999917),4))\r\n \r\n%%\r\nassert(isequal(classifyES(999961),5))\r\n \r\n%%\r\nassert(isequal(classifyES(999521),6))\r\n \r\n%%\r\nassert(isequal(classifyES(999653),7))\r\n \r\n%%\r\nassert(isequal(classifyES(987463),8))\r\n\r\n%%\r\nOK = false;\r\nwhile ~OK\r\n    p = 2^randi(15)*3^randi(15)-1;\r\n    OK = isprime(p);\r\nend\r\nassert(isequal(classifyES(p),1))\r\n\r\n%%\r\nOK = false;\r\nwhile ~OK\r\n    p = 2^randi(5)*13^randi(5)*73^randi(4)-1;\r\n    OK = isprime(p);\r\nend\r\nassert(isequal(classifyES(p),5))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-18T22:59:07.000Z","updated_at":"2025-11-29T22:12:03.000Z","published_at":"2021-05-18T23:02:15.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\u003eErdos and Selfridge developed a scheme for classifying a prime number \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e: If the only factors of \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=\\\"p+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are 2 and 3, then put \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e in class 1. Otherwise, find the largest class \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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of the factors of \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=\\\"p+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and put \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e in class \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=\\\"r+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. \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\u003eFor example, 11 is in class 1 because 12 has prime factors 2, 2, and 3. The number 43 is in class 2 because 44 has prime factors 2, 2, and 11, and all of those are in class 1. All \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/525-mersenne-primes\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMersenne primes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are in class 1, and all \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45296\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eugly numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are in classes 1 or 2. \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 prime numbers using this scheme.\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":51798,"title":"Label primes with the Erdos-Selfridge classification","description":"","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: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72px; transform-origin: 407px 72px; 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: 225.233px 7.91667px; transform-origin: 225.233px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eErdos and Selfridge developed a scheme for classifying a prime number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 66.875px 7.91667px; transform-origin: 66.875px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e: If the only factors of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAABjUlEQVRoge2ZbRGDMAyGXw91gIEZQEEV4GAO5gALaEACHrAwDVjYfqS95XrA+EhhYXnucre7QkrfS9K0AwzDMAzDuBYVgOLsj/hVKgBPAC8At5O/5eco8REnmlqRymBO0KcP5gC0uIBIuRfwOGCO7JhIC1AlkgPVBh8cN8EA2jprAF2wB+RqiEqReKGrwyTP8LthYz1khFIlUqRkTjuQaJyOjXuB+VSKxJ2mAqXjtcB8KkXqg8MB4238WpGq8M6Upak9ZVsRF8lhPooAWsyadOPpudWGTashxEXyzGE18UzPnllyYFwaSc3MM/dNqyHERYq714DxnavA90hbi7qaFA+ES1JNalGqROJRMhbeBSjCXthXSFNUiVR9cRZrkVSaRVSJxDvttB7FWtWkLwmQWyTREhFTiW/tHhRBPagTz0EukRwoO/i6Wuy4wr0xRzU+2/YR98I5RCow33ZsainOvHPJcTOZhdgV7+lsL82So8jfw48ie9r/S+JAAvG/XVooqQ9HEW8ix8xEMgwjN2+nbdxCK/6HXQAAAABJRU5ErkJggg==\" alt=\"p+1\" style=\"width: 36.5px; height: 18px;\" width=\"36.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: 67.6083px 7.91667px; transform-origin: 67.6083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are 2 and 3, then put \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 136.125px 7.91667px; transform-origin: 136.125px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in class 1. Otherwise, find the largest class \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003er\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: 52.1px 7.91667px; transform-origin: 52.1px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of the factors of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAABjUlEQVRoge2ZbRGDMAyGXw91gIEZQEEV4GAO5gALaEACHrAwDVjYfqS95XrA+EhhYXnucre7QkrfS9K0AwzDMAzDuBYVgOLsj/hVKgBPAC8At5O/5eco8REnmlqRymBO0KcP5gC0uIBIuRfwOGCO7JhIC1AlkgPVBh8cN8EA2jprAF2wB+RqiEqReKGrwyTP8LthYz1khFIlUqRkTjuQaJyOjXuB+VSKxJ2mAqXjtcB8KkXqg8MB4238WpGq8M6Upak9ZVsRF8lhPooAWsyadOPpudWGTashxEXyzGE18UzPnllyYFwaSc3MM/dNqyHERYq714DxnavA90hbi7qaFA+ES1JNalGqROJRMhbeBSjCXthXSFNUiVR9cRZrkVSaRVSJxDvttB7FWtWkLwmQWyTREhFTiW/tHhRBPagTz0EukRwoO/i6Wuy4wr0xRzU+2/YR98I5RCow33ZsainOvHPJcTOZhdgV7+lsL82So8jfw48ie9r/S+JAAvG/XVooqQ9HEW8ix8xEMgwjN2+nbdxCK/6HXQAAAABJRU5ErkJggg==\" alt=\"p+1\" style=\"width: 36.5px; height: 18px;\" width=\"36.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: 27.225px 7.91667px; transform-origin: 27.225px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and put \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 27.225px 7.91667px; transform-origin: 27.225px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in class \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAAkCAYAAAAw55zoAAABPUlEQVRoge2YYc3CMBCGHw9zMAMYmAIUzMEczAEW0DAJeMDCNMzCx4+22UHCgPb6jQv3JJeQZbleX9p724HjOI7jOOX0QLt3Ed9AD8zAH3DYuZZd6ViFSGFCkC5Go5jzGKMBJowJUrvY8R/GUMUFecCUIC1hf4+sltUAQ3ymse9NCDIAF5FoIUz+EH+n56fCYsGIIIkkyiUmm4GzGGAsHQBjgiQfH4Er4ZADwdIGfmjLQOgZKdFEWBk59LGoZyG339Z7uagJ0otEM/n3ANmLcmPJnQSKgsgTXknzfHeFnDfeGQrGVxMkuclC3VuiiR7Scf/P1cSEICeNJG9iQpArazOtzdcLIu1W4+D1itqCFK92abedXl1PqSVIQ5iLvGpMZBjEkfLD0CfUEKRl2+pLbLw6Nb6YOY7jOI7jmOMG9q+tsmHOoW8AAAAASUVORK5CYII=\" alt=\"r+1\" style=\"width: 34px; height: 18px;\" width=\"34\" 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: 3.88333px 7.91667px; transform-origin: 3.88333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. \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: 379.108px 7.91667px; transform-origin: 379.108px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, 11 is in class 1 because 12 has prime factors 2, 2, and 3. The number 43 is in class 2 because 44 has prime factors 2, 2, and 11, and all of those are in class 1. All \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/525-mersenne-primes\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMersenne primes\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: 69.625px 7.91667px; transform-origin: 69.625px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are in class 1, and all \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45296\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eugly numbers\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: 50.7833px 7.91667px; transform-origin: 50.7833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are in classes 1 or 2. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; 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 10.5px; text-align: left; transform-origin: 384px 10.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: 189.683px 7.91667px; transform-origin: 189.683px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to classify prime numbers using this scheme.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = classifyES(p)\r\n  y = f(p);\r\nend","test_suite":"%%\r\nassert(isequal(classifyES(5),1))\r\n \r\n%%\r\nassert(isequal(classifyES(11),1))\r\n \r\n%%\r\nassert(isequal(classifyES(13),2))\r\n \r\n%%\r\nassert(isequal(classifyES(19),2))\r\n \r\n%%\r\nassert(isequal(classifyES(29),2))\r\n \r\n%%\r\nassert(isequal(classifyES(37),3))\r\n \r\n%%\r\nassert(isequal(classifyES(103),3))\r\n \r\n%%\r\nassert(isequal(classifyES(113),3))\r\n \r\n%%\r\nassert(isequal(classifyES(73),4))\r\n \r\n%%\r\nassert(isequal(classifyES(313),4))\r\n \r\n%%\r\nassert(isequal(classifyES(443),4))\r\n \r\n%%\r\nassert(isequal(classifyES(1021),5))\r\n \r\n%%\r\nassert(isequal(classifyES(1321),5))\r\n \r\n%%\r\nassert(isequal(classifyES(1381),5))\r\n \r\n%%\r\nassert(isequal(classifyES(2917),6))\r\n \r\n%%\r\nassert(isequal(classifyES(4933),6))\r\n \r\n%%\r\nassert(isequal(classifyES(5413),6))\r\n \r\n%%\r\nassert(isequal(classifyES(15013),7))\r\n \r\n%%\r\nassert(isequal(classifyES(16333),7))\r\n \r\n%%\r\nassert(isequal(classifyES(22093),7))\r\n \r\n%%\r\nassert(isequal(classifyES(49681),8))\r\n \r\n%%\r\nassert(isequal(classifyES(109441),8))\r\n \r\n%%\r\nassert(isequal(classifyES(120103),8))\r\n \r\n%%\r\nassert(isequal(classifyES(532801),9))\r\n \r\n%%\r\nassert(isequal(classifyES(710341),9))\r\n \r\n%%\r\nassert(isequal(classifyES(720617),9))\r\n \r\n%%\r\nassert(isequal(classifyES(995327),1))\r\n \r\n%%\r\nassert(isequal(classifyES(999809),2))\r\n \r\n%%\r\nassert(isequal(classifyES(999983),3))\r\n \r\n%%\r\nassert(isequal(classifyES(999917),4))\r\n \r\n%%\r\nassert(isequal(classifyES(999961),5))\r\n \r\n%%\r\nassert(isequal(classifyES(999521),6))\r\n \r\n%%\r\nassert(isequal(classifyES(999653),7))\r\n \r\n%%\r\nassert(isequal(classifyES(987463),8))\r\n\r\n%%\r\nOK = false;\r\nwhile ~OK\r\n    p = 2^randi(15)*3^randi(15)-1;\r\n    OK = isprime(p);\r\nend\r\nassert(isequal(classifyES(p),1))\r\n\r\n%%\r\nOK = false;\r\nwhile ~OK\r\n    p = 2^randi(5)*13^randi(5)*73^randi(4)-1;\r\n    OK = isprime(p);\r\nend\r\nassert(isequal(classifyES(p),5))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-18T22:59:07.000Z","updated_at":"2025-11-29T22:12:03.000Z","published_at":"2021-05-18T23:02:15.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\u003eErdos and Selfridge developed a scheme for classifying a prime number \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e: If the only factors of \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=\\\"p+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are 2 and 3, then put \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e in class 1. Otherwise, find the largest class \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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of the factors of \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=\\\"p+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and put \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e in class \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=\\\"r+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er+1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. \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\u003eFor example, 11 is in class 1 because 12 has prime factors 2, 2, and 3. The number 43 is in class 2 because 44 has prime factors 2, 2, and 11, and all of those are in class 1. All \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/525-mersenne-primes\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMersenne primes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are in class 1, and all \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45296\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eugly numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are in classes 1 or 2. \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 prime numbers using this scheme.\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:\"guy a18\"","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:\"guy a18\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"guy a18\"","","\"","guy a18","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f41e655be08\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f41e655bd68\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f41e655b4a8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f41e655c088\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f41e655bfe8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f41e655bf48\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f41e655bea8\u003e":"tag:\"guy a18\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f41e655bea8\u003e":"tag:\"guy a18\""},"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":"cody-search","password":"78X075ddcV44","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:\"guy a18\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"guy a18\"","","\"","guy a18","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f41e655be08\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f41e655bd68\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f41e655b4a8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f41e655c088\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f41e655bfe8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f41e655bf48\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f41e655bea8\u003e":"tag:\"guy a18\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f41e655bea8\u003e":"tag:\"guy a18\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":51798,"difficulty_rating":"easy-medium"}]}}