{"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":58379,"title":"Determine whether a number is prome","description":"In discussing the unique factorization of numbers in Elementary Number Theory, Underwood Dudley devised a new number system:\r\n“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form ,  We will call an element of this set prome if it has no divisors other than 1 and itself in the set. For example, 21 is prome, whereas  is not.\"\r\nWrite a function to determine whether a number is prome. Take 1 to be not prome.","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: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 61.5px; transform-origin: 407px 61.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: 161.042px 8px; transform-origin: 161.042px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn discussing the unique factorization of numbers in \u003c/span\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: 85.9667px 8px; transform-origin: 85.9667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eElementary Number Theory\u003c/span\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: 136.992px 8px; transform-origin: 136.992px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, Underwood Dudley devised a new number system:\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: 220.125px 8px; transform-origin: 220.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF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003e\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 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI8AAAAkCAYAAACwuGm+AAAEL0lEQVR4Xu1aO6sWMRC9t1cErbTQQgttroL4ANFCfIBcEC18gNgIPn6AomIhIgpaiJVXSwtRO1EELWxE8FXYaaGFFtr5QHs9RzIwhOxuNpu7e78vs3DY75FMksnJZGaSyQl7TAOJGphMrGfVTAMTRh4jQbIGjDzJqrOKRh7jQLIGjDzJqrOKRh7jQLIGSiPPQmjqNLDFaWyBe5/H+16yFpsrSruHUHRJc/HRKFESedZhSp4Bv4HdwBs3RcfxvgF8AFZlnjYhzQnInQf8AeZnbmMwcaWQh5P42U3ggYCVeYLfdgBPgZ2ZZmM/5OwFfgJHnUwjTybl9imGW9I+4FvFtkGr9Np1iOQhibo+yyHgkxPyEu8NZnm6qrT/+pzEj67Z+3jTIoQebmfcWl4BGzN308iTWaF9iTuDhi65xs7ifbmiYZlg/r0I+J6xg0aejMrsU5QmxXo0LI6y34cr+OGk+zHkF3XpczHkoZkntgGrgaXAQ+CU0x6VzJBzMcAIZVPmVdplkkJ1v7q+8r9Y8lxV483Rn2LIQ59gLSDhpSidzt8L4JcDoxM+bRTNOoxsuj51248v+6/6IZY8OaMuNl8MeUTXMmBal2ngEXAboM+gSdBmIockD8PkZUCVL8NFc9cN3sgTsbzr8jyyYmlZqHTmK445mZJY49cVgISkEU32XkTG0ZRj0cQ28kRMUxV5tCIZ3pI8u9SqvYnPTHyNgs9j21YEEVKKVJFHyEGZXLFrPOsiTugtZY1S2u+jzns0stI1FOvztPHjYsZQlM+jFe77NDrplisbGzMBqWXk6IH1Y8nDYGEmtcFAvWLIo8nBbKverqgX8XeaHNCQ7odwmHWSsI4UQjKOaytQlQ9K4VQx5NHOcCiS6nKIOAR59GKo22ZlK56N0/ViyKNXYCi0lTMgIRZXNp3quRxxtTkYDWWXSfofHaxRG/JIkvYt2mtzRMJ6vD3QZDGzlQs5zEKOULiqcyEM0bcDe4CDLQeaYvq71Gm6kiHkCo1ZH2+kHprGkse3zLE+pa5XZ12zlvPJo68mhPwDff5DazMFMIE4l62OkE4ug/G7jh5lmw75dyyrQ31+b3vupYnL+nWHrlq/LBu7hep6VddOKC9rOZ88Wngo+UeT9w7g1QWSh1vXKBBHCMT+84R9M/AF4DVUHrc8AJieCG0T/oTGZtS5yo8ADDioL3nokN8BeKvRv/rK/j0HeG7IpymxKTJJ0McAzyEvAFWRYtZypdwkVHPX6SOtUF2430m4V5mk5cF0rpuNOfv2X5aRJ16ltCTXgdz3nKt6QD/pWsA6xfd4lksaeeIUTH+Jh8KHgaZoJk5ifSluZ/osMYfM7DKMPM0qJXEuAud6Ig59L/phcn+quYcDlTDyDKT4cWjWyDMOszjQGIw8Ayl+HJo18ozDLA40BiPPQIofh2b/ASeq/iXeZSr4AAAAAElFTkSuQmCC\" alt=\"n = 0, 1,...\" style=\"width: 71.5px; height: 18px;\" width=\"71.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: 95.5583px 8px; transform-origin: 95.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e We will call an element of this set \u003c/span\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: 21.7833px 8px; transform-origin: 21.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eprome \u003c/span\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: 128.742px 8px; transform-origin: 128.742px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif it has no divisors other than 1 and itself \u003c/span\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: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ein the set\u003c/span\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: 115.517px 8px; transform-origin: 115.517px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example, 21 is prome, whereas \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAAkCAYAAACkATUaAAAEHUlEQVR4Xu1aTahOURR9b07CiIEBBkRSwoiBRJkYKCTpFfkZSBIhAxkgemM/pWQglIGSQhkQEVMxYMCAEQbMWavurtPt/N+ffT/fubV6vXvPvXudvc4+Z599vsmJco2dBybHrselwxNF9DEcBEX0IvoYemAMu1wivYjeqwcOwtpT4HOvVrszthqfXgjc7c5E8petnEKRTmGmgLWVuT/4+wo4A7yNoPANbeY52n3E/aUR3xhSEwq63UG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gaXle2WURXFkDDfBFdw+vKNovoygJomC+ia3hd2WYRXVkADfNFdA2vK9v8BzGZ7CW/X7t1AAAAAElFTkSuQmCC\" alt=\"25 = 5*5\" style=\"width: 62.5px; height: 18px;\" width=\"62.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: 23.0917px 8px; transform-origin: 23.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is not.\"\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: 253.858px 8px; transform-origin: 253.858px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to determine whether a number is prome. Take 1 to be not prome.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = isprome(n)\r\n   tf = regexprep(isprime(n),'i','o');\r\nend","test_suite":"%%\r\nassert(isprome(21))\r\n\r\n%%\r\nassert(~isprome(25))\r\n\r\n%%\r\nassert(all(~isprome(2.^(0:15))))\r\n\r\n%% Exercise 4 of Chapter 2 of Dudley's book\r\nx = 5:4:99;\r\nans_correct = [25 45 65 81 85];\r\nassert(isequal(x(~isprome(x)),ans_correct))\r\n\r\n%%\r\nx = 105:4:999;\r\nans_correct = [109 113 121 129 133 137 141 149 157 161 173 177 181 193 197 201 209 213 217 229 233 237 241 249 253 257 269 277 281 293 301 309 313 317 321 329 337 341 349 353 361 373 381 389 393 397 401 409 413 417 421 433 437 449 453 457 461 469 473 489 497 501 509 517 521 529 537 541 553 557 569 573 577 581 589 593 597 601 613 617 633 641 649 653 661 669 673 677 681 701 709 713 717 721 733 737 749 753 757 761 769 773 781 789 797 809 813 817 821 829 849 853 857 869 877 881 889 893 913 917 921 929 933 937 941 953 961 973 977 989 993 997];\r\nassert(isequal(x(isprome(x)),ans_correct))\r\n\r\n%%\r\nx = 3.^(0:18);\r\nassert(length(find(isprome(x)))==1)\r\n\r\n%%\r\nx = 100000:101000;\r\nans_correct = [100001 100013 100029 100033 100041 100049 100057 100069 100077 100097 100109 100121 100129 100133 100141 100153 100157 100169 100173 100189 100193 100209 100213 100237 100241 100261 100281 100289 100297 100301 100313 100333 100349 100357 100361 100393 100397 100417 100429 100433 100437 100461 100469 100493 100501 100509 100517 100537 100549 100561 100577 100609 100613 100621 100641 100649 100661 100669 100673 100689 100693 100709 100721 100729 100733 100741 100757 100761 100769 100777 100781 100797 100801 100829 100849 100853 100857 100869 100877 100897 100913 100921 100933 100937 100941 100957 100961 100981 100993];\r\nassert(isequal(x(isprome(x)),ans_correct))\r\n\r\n%%\r\np = primes(1e6);\r\np4n1 = p(mod(p,4)==1);\r\np4n3 = p(mod(p,4)==3);\r\nassert(all(isprome(p4n1(randi(length(p4n1),[1 50])))))\r\nassert(all(~isprome(p4n3(randi(length(p4n3),[1 50])))))\r\n\r\n%%\r\nd = [3 11 19 31 43 53 67 79];\r\nr = randi(length(d),[1 3]);\r\nx = prod(d(r));\r\nassert(~isprome(x))\r\n\r\n%%\r\nassert(~isprome(intmax-2))\r\n\r\n%%\r\nfiletext = fileread('isprome.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext, 'classdef'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":46909,"edited_by":46909,"edited_at":"2023-05-27T15:05:19.000Z","deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-05-27T15:04:50.000Z","updated_at":"2023-05-27T15:05:20.000Z","published_at":"2023-05-27T15:05:20.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eIn discussing the unique factorization of numbers in \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eElementary Number Theory\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Underwood Dudley devised a new number system:\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“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form \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=\\\"4n+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e4n+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\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=\\\"n = 0, 1,...\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 0, 1,\\\\dots \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e We will call an element of this set \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprome \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eif it has no divisors other than 1 and itself \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ein the set\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For example, 21 is prome, whereas \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=\\\"25 = 5*5\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e25 = 5\\\\cdot5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is not.\\\"\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 determine whether a number is prome. Take 1 to be not prome.\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":58379,"title":"Determine whether a number is prome","description":"In discussing the unique factorization of numbers in Elementary Number Theory, Underwood Dudley devised a new number system:\r\n“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form ,  We will call an element of this set prome if it has no divisors other than 1 and itself in the set. For example, 21 is prome, whereas  is not.\"\r\nWrite a function to determine whether a number is prome. Take 1 to be not prome.","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: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 61.5px; transform-origin: 407px 61.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: 161.042px 8px; transform-origin: 161.042px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn discussing the unique factorization of numbers in \u003c/span\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: 85.9667px 8px; transform-origin: 85.9667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eElementary Number Theory\u003c/span\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: 136.992px 8px; transform-origin: 136.992px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, Underwood Dudley devised a new number system:\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: 220.125px 8px; transform-origin: 220.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-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YII=\" alt=\"4n+1\" style=\"width: 42.5px; height: 18px;\" width=\"42.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: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI8AAAAkCAYAAACwuGm+AAAEL0lEQVR4Xu1aO6sWMRC9t1cErbTQQgttroL4ANFCfIBcEC18gNgIPn6AomIhIgpaiJVXSwtRO1EELWxE8FXYaaGFFtr5QHs9RzIwhOxuNpu7e78vs3DY75FMksnJZGaSyQl7TAOJGphMrGfVTAMTRh4jQbIGjDzJqrOKRh7jQLIGjDzJqrOKRh7jQLIGSiPPQmjqNLDFaWyBe5/H+16yFpsrSruHUHRJc/HRKFESedZhSp4Bv4HdwBs3RcfxvgF8AFZlnjYhzQnInQf8AeZnbmMwcaWQh5P42U3ggYCVeYLfdgBPgZ2ZZmM/5OwFfgJHnUwjTybl9imGW9I+4FvFtkGr9Np1iOQhibo+yyHgkxPyEu8NZnm6qrT/+pzEj67Z+3jTIoQebmfcWl4BGzN308iTWaF9iTuDhi65xs7ifbmiYZlg/r0I+J6xg0aejMrsU5QmxXo0LI6y34cr+OGk+zHkF3XpczHkoZkntgGrgaXAQ+CU0x6VzJBzMcAIZVPmVdplkkJ1v7q+8r9Y8lxV483Rn2LIQ59gLSDhpSidzt8L4JcDoxM+bRTNOoxsuj51248v+6/6IZY8OaMuNl8MeUTXMmBal2ngEXAboM+gSdBmIockD8PkZUCVL8NFc9cN3sgTsbzr8jyyYmlZqHTmK445mZJY49cVgISkEU32XkTG0ZRj0cQ28kRMUxV5tCIZ3pI8u9SqvYnPTHyNgs9j21YEEVKKVJFHyEGZXLFrPOsiTugtZY1S2u+jzns0stI1FOvztPHjYsZQlM+jFe77NDrplisbGzMBqWXk6IH1Y8nDYGEmtcFAvWLIo8nBbKverqgX8XeaHNCQ7odwmHWSsI4UQjKOaytQlQ9K4VQx5NHOcCiS6nKIOAR59GKo22ZlK56N0/ViyKNXYCi0lTMgIRZXNp3quRxxtTkYDWWXSfofHaxRG/JIkvYt2mtzRMJ6vD3QZDGzlQs5zEKOULiqcyEM0bcDe4CDLQeaYvq71Gm6kiHkCo1ZH2+kHprGkse3zLE+pa5XZ12zlvPJo68mhPwDff5DazMFMIE4l62OkE4ug/G7jh5lmw75dyyrQ31+b3vupYnL+nWHrlq/LBu7hep6VddOKC9rOZ88Wngo+UeT9w7g1QWSh1vXKBBHCMT+84R9M/AF4DVUHrc8AJieCG0T/oTGZtS5yo8ADDioL3nokN8BeKvRv/rK/j0HeG7IpymxKTJJ0McAzyEvAFWRYtZypdwkVHPX6SOtUF2430m4V5mk5cF0rpuNOfv2X5aRJ16ltCTXgdz3nKt6QD/pWsA6xfd4lksaeeIUTH+Jh8KHgaZoJk5ifSluZ/osMYfM7DKMPM0qJXEuAud6Ig59L/phcn+quYcDlTDyDKT4cWjWyDMOszjQGIw8Ayl+HJo18ozDLA40BiPPQIofh2b/ASeq/iXeZSr4AAAAAElFTkSuQmCC\" alt=\"n = 0, 1,...\" style=\"width: 71.5px; height: 18px;\" width=\"71.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: 95.5583px 8px; transform-origin: 95.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e We will call an element of this set \u003c/span\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: 21.7833px 8px; transform-origin: 21.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eprome \u003c/span\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: 128.742px 8px; transform-origin: 128.742px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif it has no divisors other than 1 and itself \u003c/span\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: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ein the set\u003c/span\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: 115.517px 8px; transform-origin: 115.517px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example, 21 is prome, whereas \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAAkCAYAAACkATUaAAAEHUlEQVR4Xu1aTahOURR9b07CiIEBBkRSwoiBRJkYKCTpFfkZSBIhAxkgemM/pWQglIGSQhkQEVMxYMCAEQbMWavurtPt/N+ffT/fubV6vXvPvXudvc4+Z599vsmJco2dBybHrselwxNF9DEcBEX0IvoYemAMu1wivYjeqwcOwtpT4HOvVrszthqfXgjc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KMLtpKeZO1CfnZF/v8HuDJIfOTvkuvjTmFErkuHFm+qeyBIrqyABrmi+gaXle2WURXFkDDfBFdw+vKNovoygJomC+ia3hd2WYRXVkADfNFdA2vK9v8BzGZ7CW/X7t1AAAAAElFTkSuQmCC\" alt=\"25 = 5*5\" style=\"width: 62.5px; height: 18px;\" width=\"62.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: 23.0917px 8px; transform-origin: 23.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is not.\"\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: 253.858px 8px; transform-origin: 253.858px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to determine whether a number is prome. Take 1 to be not prome.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = isprome(n)\r\n   tf = regexprep(isprime(n),'i','o');\r\nend","test_suite":"%%\r\nassert(isprome(21))\r\n\r\n%%\r\nassert(~isprome(25))\r\n\r\n%%\r\nassert(all(~isprome(2.^(0:15))))\r\n\r\n%% Exercise 4 of Chapter 2 of Dudley's book\r\nx = 5:4:99;\r\nans_correct = [25 45 65 81 85];\r\nassert(isequal(x(~isprome(x)),ans_correct))\r\n\r\n%%\r\nx = 105:4:999;\r\nans_correct = [109 113 121 129 133 137 141 149 157 161 173 177 181 193 197 201 209 213 217 229 233 237 241 249 253 257 269 277 281 293 301 309 313 317 321 329 337 341 349 353 361 373 381 389 393 397 401 409 413 417 421 433 437 449 453 457 461 469 473 489 497 501 509 517 521 529 537 541 553 557 569 573 577 581 589 593 597 601 613 617 633 641 649 653 661 669 673 677 681 701 709 713 717 721 733 737 749 753 757 761 769 773 781 789 797 809 813 817 821 829 849 853 857 869 877 881 889 893 913 917 921 929 933 937 941 953 961 973 977 989 993 997];\r\nassert(isequal(x(isprome(x)),ans_correct))\r\n\r\n%%\r\nx = 3.^(0:18);\r\nassert(length(find(isprome(x)))==1)\r\n\r\n%%\r\nx = 100000:101000;\r\nans_correct = [100001 100013 100029 100033 100041 100049 100057 100069 100077 100097 100109 100121 100129 100133 100141 100153 100157 100169 100173 100189 100193 100209 100213 100237 100241 100261 100281 100289 100297 100301 100313 100333 100349 100357 100361 100393 100397 100417 100429 100433 100437 100461 100469 100493 100501 100509 100517 100537 100549 100561 100577 100609 100613 100621 100641 100649 100661 100669 100673 100689 100693 100709 100721 100729 100733 100741 100757 100761 100769 100777 100781 100797 100801 100829 100849 100853 100857 100869 100877 100897 100913 100921 100933 100937 100941 100957 100961 100981 100993];\r\nassert(isequal(x(isprome(x)),ans_correct))\r\n\r\n%%\r\np = primes(1e6);\r\np4n1 = p(mod(p,4)==1);\r\np4n3 = p(mod(p,4)==3);\r\nassert(all(isprome(p4n1(randi(length(p4n1),[1 50])))))\r\nassert(all(~isprome(p4n3(randi(length(p4n3),[1 50])))))\r\n\r\n%%\r\nd = [3 11 19 31 43 53 67 79];\r\nr = randi(length(d),[1 3]);\r\nx = prod(d(r));\r\nassert(~isprome(x))\r\n\r\n%%\r\nassert(~isprome(intmax-2))\r\n\r\n%%\r\nfiletext = fileread('isprome.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext, 'classdef'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":46909,"edited_by":46909,"edited_at":"2023-05-27T15:05:19.000Z","deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-05-27T15:04:50.000Z","updated_at":"2023-05-27T15:05:20.000Z","published_at":"2023-05-27T15:05:20.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eIn discussing the unique factorization of numbers in \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eElementary Number Theory\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Underwood Dudley devised a new number system:\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“Consider the integers 1, 5, 9, 13, 17,…; that is, all integers of the form \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=\\\"4n+1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e4n+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\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=\\\"n = 0, 1,...\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 0, 1,\\\\dots \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e We will call an element of this set \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprome \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eif it has no divisors other than 1 and itself \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ein the set\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For example, 21 is prome, whereas \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=\\\"25 = 5*5\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e25 = 5\\\\cdot5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is not.\\\"\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 determine whether a number is prome. Take 1 to be not prome.\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:\"dudley\"","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:\"dudley\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"dudley\"","","\"","dudley","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f47742b6048\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f47742b5fa8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f47742b56e8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f47742b62c8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f47742b6228\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f47742b6188\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f47742b60e8\u003e":"tag:\"dudley\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f47742b60e8\u003e":"tag:\"dudley\""},"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:\"dudley\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"dudley\"","","\"","dudley","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f47742b6048\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f47742b5fa8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f47742b56e8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f47742b62c8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f47742b6228\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f47742b6188\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f47742b60e8\u003e":"tag:\"dudley\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f47742b60e8\u003e":"tag:\"dudley\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":58379,"difficulty_rating":"medium"}]}}