{"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":42754,"title":"Odd elimination","description":"Inspired by Project Euler problem #539\r\n\r\nYou'll be given a vector from 1 to n; \r\n\r\nGoing from left to right, remove the first number and every other number afterward until the end of the list. \r\n\r\nRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\r\n\r\nExample with n=9 \r\n\r\n1 2 3 4 5 6 7 8 9\r\n\r\n2 4 6 8\r\n\r\n2 6\r\n\r\n6\r\n\r\n\r\n","description_html":"\u003cp\u003eInspired by Project Euler problem #539\u003c/p\u003e\u003cp\u003eYou'll be given a vector from 1 to n;\u003c/p\u003e\u003cp\u003eGoing from left to right, remove the first number and every other number afterward until the end of the list.\u003c/p\u003e\u003cp\u003eRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\u003c/p\u003e\u003cp\u003eExample with n=9\u003c/p\u003e\u003cp\u003e1 2 3 4 5 6 7 8 9\u003c/p\u003e\u003cp\u003e2 4 6 8\u003c/p\u003e\u003cp\u003e2 6\u003c/p\u003e\u003cp\u003e6\u003c/p\u003e","function_template":"function y = odd_elimination(n)\r\n  y=;\r\nend","test_suite":"%%\r\nn = 9;\r\ny_correct = 6;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 1000;\r\ny_correct = 510;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 99;\r\ny_correct = 56;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 5000;\r\ny_correct = 2014;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 100000;\r\ny_correct = 55286;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n\r\n%%\r\nn = 666;\r\ny_correct = 480;\r\nassert(isequal(odd_elimination(n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":17228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-02-25T09:19:38.000Z","updated_at":"2025-12-07T20:45:00.000Z","published_at":"2016-02-25T09:20:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Project Euler problem #539\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\u003eYou'll be given a vector from 1 to n;\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\u003eGoing from left to right, remove the first number and every other number afterward until the end of the list.\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\u003eRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\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\u003eExample with n=9\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\u003e1 2 3 4 5 6 7 8 9\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\u003e2 4 6 8\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\u003e2 6\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\u003e6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60849,"title":"Permuted Multiples: Project Euler Problem 52","description":"Return the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\r\n\r\n\r\n\r\nYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(255, 255, 255); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(255, 255, 255); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 140.92px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 70.4514px; transform-origin: 407.5px 70.4601px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = SmallestPermMult()\r\n\r\ny = a + b;\r\n\r\nend","test_suite":"%\u0026%\r\ny = SmallestPermMult()\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(((sum(num2str(y)-'0')^2)/9)^3, 1000) == 441)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(sum(factor(y).^2) == 1686)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(y, 0.5*(2*3^3*11 + 10)-5) == 0) \r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(sum(y - double('JQAKLY').^2) == 821558)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(y, 999) == 0) \r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2601620,"edited_by":2601620,"edited_at":"2025-04-15T20:13:38.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2025-04-15T20:13:38.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-04-15T20:10:36.000Z","updated_at":"2025-04-18T12:11:31.000Z","published_at":"2025-04-15T20:10:36.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\u003eReturn the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\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\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\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\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\u003eYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)\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\"}]}"},{"id":2721,"title":"Pandigital Factors (Based on Euler 491)","description":"A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero.  Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\r\n\r\nWrite a MATLAB script that takes as input the number X, and another integer Y.  Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y.  For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\r\n\r\n       43120\r\n       42301\r\n       41230\r\n       32410\r\n       31402\r\n       31024\r\n       30142\r\n       23401\r\n       24031\r\n       20314\r\n       14203\r\n       10234\r\n       10423\r\n\r\nThe number 03421 does not count.  Even though it contains all of the digits 0-4, it has a leading zero.  Therefore, the output of pandigit_factors(4,7) would be 13.  You do not need to output all of the numbers themselves, just how many of them there are.  Good luck!","description_html":"\u003cp\u003eA Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero.  Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\u003c/p\u003e\u003cp\u003eWrite a MATLAB script that takes as input the number X, and another integer Y.  Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y.  For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\u003c/p\u003e\u003cpre\u003e       43120\r\n       42301\r\n       41230\r\n       32410\r\n       31402\r\n       31024\r\n       30142\r\n       23401\r\n       24031\r\n       20314\r\n       14203\r\n       10234\r\n       10423\u003c/pre\u003e\u003cp\u003eThe number 03421 does not count.  Even though it contains all of the digits 0-4, it has a leading zero.  Therefore, the output of pandigit_factors(4,7) would be 13.  You do not need to output all of the numbers themselves, just how many of them there are.  Good luck!\u003c/p\u003e","function_template":"function pf = pandigit_factors(x,y)\r\n  pf=x*y;\r\nend","test_suite":"%%\r\nx = 4;y=7;\r\ny_correct = 13;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nx = 3;y=3;\r\ny_correct = 18;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nx = 8;y=8;\r\ny_correct = 45360;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nj=[600 312 600 144 216 312 75 74 0 120 0 144 55];\r\nx=5;y=ceil(13*rand)\r\nassert(isequal(pandigit_factors(x,y),j(y)));\r\n%%\r\nx=1;y=10;\r\nassert(isequal(pandigit_factors(x,y),x));","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-05T17:20:24.000Z","updated_at":"2025-11-30T01:34:22.000Z","published_at":"2014-12-05T17:20:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero. Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a MATLAB script that takes as input the number X, and another integer Y. Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y. For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[       43120\\n       42301\\n       41230\\n       32410\\n       31402\\n       31024\\n       30142\\n       23401\\n       24031\\n       20314\\n       14203\\n       10234\\n       10423]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 03421 does not count. Even though it contains all of the digits 0-4, it has a leading zero. Therefore, the output of pandigit_factors(4,7) would be 13. You do not need to output all of the numbers themselves, just how many of them there are. Good luck!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60837,"title":"Project Euler Problem 48: Self Powers","description":"The series,.\r\nReturn a string of the last ten digits of the series:.\r\n\r\nHint: Use modular arithmetic! \r\nSpoiler: The solution is in the test suite\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(255, 255, 255); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(255, 255, 255); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 171px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 85.5px; transform-origin: 408px 85.5px; vertical-align: baseline; \"\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe series,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAesAAAAmCAYAAADk8rN/AAAAAXNSR0IArs4c6QAAE3hJREFUeF7tnQewNEURx7vNEQMqZS6zZSxUKMWEYE5gQgQVEAwIiJKDoohk0DKRo4iAKEhQEIRSUQyUiFgiiiKmMpY5i7b7e/Ycc/s2zN7u3bv33mwV9fF9t7uz3TPT/86jkq/MgcyBzIHMgcyBzIG55oDO9dflj8scyBzIHMgcyBzIHJAM1nkRZA5kDmQOZA5kDsw5BzJYz/kE5c/LHMgcyBzIHMgcyGCd10DmQOZA5kDmQObAnHMgg/WcT1D+vMyBzIHMgcyBzIGpgLWZ3VFE9hWR14jIOaq6zUpktZkdKiKbi8jdC3rh5a9F5FRV3XUl0evz+SEReZGI3FlE/lvM7Q9FZD9V/ehKojXT0s6BlP1tZq8WkXf4evmLiKwhIh9V1be1j5DvyBzIHChzYHCwNrPdReSNInJfEblF8efxKxGszex4EdlMRK4RkR+LyFNF5G4i8o9CML1XVfdeKcvNzE4Tk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9w4f5GCaSfg2L8+YGc1cUGS5Ko8Vjb/VQ2rsI0IN7ww1034kL81QftuxtW9tnXXfcaMksfAq6r5PdBmBXCDbnAM9tm040ANjpxe9kQucEw4rD5hpWg+pc2RmdIejbWroKcGZD4D2j4o1v2FhTePp4P9pId3axCt13Io9G1zgyfQ2nWfNyyAK5A9CjzHp7IJliYV2dPls5GlusCGFXmRBhO48bZ8+aDlT22BTADDaiu5cxCnX8lpqBAnaNBo+yUkHTdrHvI2Wtt+nQCtaKwKWlojEBfdW1RPCd7iStn9hca9RdNq70LtFLbSMdSCrfbaNlqrfh1y3JeHca4+aGeuB5hO0yKTrHvyg2xi8Iuu38rSlSXiw3J5xDwv1tXhpSDQKspJ9A6BRV//J8hnL0RrDWuX5tZ2nCGX+u7jtqMQKwZ4E1r5+O41rZutjXXoXL0r6oBOrEoXicpfxIy9c3TyaWadxK2gMSXIcG5p05O4kc+QK6fu8+QlHdXJhZdOZ8SrvtIlnrfaaZNwh6G21rOdpk7mFyMHhbB7aly5pxvY0eWNmJPgAsLhxd1JVtL8Vea10WlfTul2RCzQTlTkwBxxYVmA9B/zKn5A5kDmQOZA5kDkwcw5ksJ45y/OAmQOZA5kDmQOZA904kMG6G7/y3ZkDmQOZA5kDmQMz50AG65mzPA+YOZA5kDmQOZA50I0DGay78SvfnTmQOZA5kDmQOTBzDmSwnjnL84CZA5kDmQOZA5kD3TiQwbobv/LdmQOZA5kDmQOZAzPnwP8A/9we6l9jjkgAAAAASUVORK5CYII=\" width=\"245.5\" height=\"19\" style=\"width: 245.5px; height: 19px;\"\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a string of the last ten digits of the series:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVMAAAAmCAYAAAB503iyAAAAAXNSR0IArs4c6QAADGBJREFUeF7tXWfMNUUVfo6d2MUS6w8r0ahRo9HYexcUBQQVUUQEIipNwIIoUjWxIsonRRAEI1IUBTEqYo8ajRUL9pZYYjfocZ7rmde5++3d3bs7d+7e+579A997d3bnnDnzzOkr8Ms54BxwDjgHBnNABj/BH+AccA44B5wDcDB1IXAOOAecAxk44GCagYn+COeAc8A54GDqMuAccA44BzJwwME0AxP9Ec4B54BzYCFgqqo3BPA6AM8FcL6I7LmOrFbV4wHsBuAWgV7y8rcAzhSRg9aJXlvPtwN4KoCbAPhPWNsfAni9iJyxTrQ6LePlQBdcUdXnAHi1yelfANwIwBki8vKUstz38dnZwVRVDwHwYgC3B3Ct8N8t6wimqroFwK4Avg3gJwAeCuDmAP4RFvDNInL4eMVyvpmp6lkAHkWhBPBzAHsBuFug//sAniYi/K9fzoGFcaALrqjq3gCOBkAQpYx+FsCHADwCwOki8kJOMPd9kehFgClB5esAvgDg7usIpqr6RADvCQB6mYjsbgtEWs8Bc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3j1qhyfl4Ql2mEzaMtpzmAZIbZU17Kzdn2rcs6yxffheekxTP1NqYjSF6HCOQsn5saEsv0ZJDYefMJnqjblIAnIKZcVk6TLtrOlCbS9cAMCwbPSA4Ce7leWS0mdGM47J2NRqjunbR6CNlrbfF0Arc3dZ9cIG3wygHB6/CWRgy3JCZm3wM8DsKM9uX5OSYAOLmWPbaKn7Pafcps+37x713qOqSnlgcOnW1uSG/OCXPfn9JKYFzvwg5LLG9uF/qTGtmmmpiXR5z6Ka7HZ5d+l71r1hcgUUsjbCLr1Wbe/bTHLbxot1/n2lwHSdF8Jpcw44B1abAw6mq71+PnvngHNgJBxwMB3JQvg0nAPOgdXmgIPpaq+fz9454BwYCQccTEeyED4N54BzYLU54GC62uvns3cOOAdGwgEH05EshE/DOeAcWG0O/Bce2AOuvYIzogAAAABJRU5ErkJggg==\" width=\"169.5\" height=\"19\" style=\"width: 169.5px; height: 19px;\"\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHint: Use modular arithmetic! \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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSpoiler: The solution is in the test suite\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function digits_string = selfPowerSeries()\r\n  digits_string = '0123456789';\r\nend","test_suite":"%% \r\nm = 10^10\r\nsum = 0;\r\nfor i = 1:1000\r\n    \r\n    modulo = mod(i, m);\r\n\r\n    for j = 1:i-1\r\n        modulo = mod(modulo * i, m);\r\n    end\r\n    \r\n    sum = sum + modulo;\r\nend\r\n\r\ny_correct = num2str(sum)\r\ny_correct = y_correct(end-9:end)\r\n\r\nassert(isequal(selfPowerSeries(),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2601620,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-04-02T00:34:14.000Z","updated_at":"2025-07-18T08:50:42.000Z","published_at":"2025-04-02T00:34:14.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\u003eThe series,\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\u003e1^1+2^2+3^3+...+10^{10}=10405071317\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\u003eReturn a string of the last ten digits of the series:\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\u003e1^1+2^2+3^3+...+1000^{1000}\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\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\u003eHint: Use modular arithmetic! \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\u003eSpoiler: The solution is in the test suite\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\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\"}]}"},{"id":42913,"title":"Pseudo Square Root (Inspired by Project Euler 266)","description":"Shamelessly copied from the Project Euler page for Problem 266:\r\n-------------\r\n\r\nThe divisors of 12 are: 1,2,3,4,6 and 12.\r\n\r\nThe largest divisor of 12 that does not exceed the square root of 12 is 3.\r\n\r\nWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\r\n\r\nIt can be seen that PSR(3102)=47.\r\n\r\n-------------\r\n\r\nWrite a MATLAB script that will determine what the pseudo square root of a number is.  Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.","description_html":"\u003cp\u003eShamelessly copied from the Project Euler page for Problem 266:\r\n-------------\u003c/p\u003e\u003cp\u003eThe divisors of 12 are: 1,2,3,4,6 and 12.\u003c/p\u003e\u003cp\u003eThe largest divisor of 12 that does not exceed the square root of 12 is 3.\u003c/p\u003e\u003cp\u003eWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\u003c/p\u003e\u003cp\u003eIt can be seen that PSR(3102)=47.\u003c/p\u003e\u003cp\u003e-------------\u003c/p\u003e\u003cp\u003eWrite a MATLAB script that will determine what the pseudo square root of a number is.  Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.\u003c/p\u003e","function_template":"function y = PSR(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12;y_correct = 3;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx = 3102;y_correct = 47;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=10000;y_correct = 100;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=1308276133167003;y_correct = 36105377;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=6469693230;y_correct = 79534;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\np=cumprod(1:10);\r\ny=arrayfun(@(p) PSR(p),p);\r\ny_correct=[1 1 2 4 10 24 70 192 576 1890];\r\nassert(isequal(y,y_correct))\r\n%%\r\nx=1000000000000002;\r\nassert(isequal(PSR(PSR(x)),2))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-07-19T13:50:36.000Z","updated_at":"2026-03-16T15:35:55.000Z","published_at":"2016-07-19T13:50:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eShamelessly copied from the Project Euler page for Problem 266: -------------\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\u003eThe divisors of 12 are: 1,2,3,4,6 and 12.\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\u003eThe largest divisor of 12 that does not exceed the square root of 12 is 3.\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\u003eWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\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\u003eIt can be seen that PSR(3102)=47.\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-------------\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 MATLAB script that will determine what the pseudo square root of a number is. Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":250,"title":"Project Euler: Problem 10, Sum of Primes","description":"The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\r\n\r\nFind the sum of all the primes below the input, N.\r\n\r\nThank you \u003chttp://projecteuler.net/problem=10 Project Euler Problem 10\u003e","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe sum of the primes less than or equal to 10 is 2 + 3 + 5 + 7 = 17.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the sum of all the primes less than or equal to the input, N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThank you\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://projecteuler.net/problem=10\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 10\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler010(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2000000;\r\ny_correct = 142913828922;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 17;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct =4227;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 11;\r\ny_correct = 28;\r\nassert(isequal(euler010(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":7,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2093,"test_suite_updated_at":"2012-06-08T13:08:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-03T18:17:24.000Z","updated_at":"2026-03-15T19:05:27.000Z","published_at":"2012-02-03T18:17:24.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\u003eThe sum of the primes less than or equal to 10 is 2 + 3 + 5 + 7 = 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\u003eFind the sum of all the primes less than or equal to the input, N.\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\u003eThank you\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=10\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 10\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":240,"title":"Project Euler: Problem 6, Natural numbers, squares and sums.","description":"The sum of the squares of the first ten natural numbers is,\r\n\r\n1^2 + 2^2 + ... + 10^2 = 385\r\nThe square of the sum of the first ten natural numbers is,\r\n\r\n(1 + 2 + ... + 10)^2 = 55^2 = 3025\r\nHence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\r\n\r\nFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=6 Project Euler Problem 6\u003e","description_html":"\u003cp\u003eThe sum of the squares of the first ten natural numbers is,\u003c/p\u003e\u003cp\u003e1^2 + 2^2 + ... + 10^2 = 385\r\nThe square of the sum of the first ten natural numbers is,\u003c/p\u003e\u003cp\u003e(1 + 2 + ... + 10)^2 = 55^2 = 3025\r\nHence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\u003c/p\u003e\u003cp\u003eFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=6\"\u003eProject Euler Problem 6\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler006(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 2640;\r\nassert(isequal(euler006(x),y_correct))\r\n\r\n%%\r\nx = 20;\r\ny_correct = 41230;\r\nassert(isequal(euler006(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct = 401323300;\r\nassert(isequal(euler006(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":3,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2540,"test_suite_updated_at":"2012-02-02T20:31:39.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-02-02T20:31:39.000Z","updated_at":"2026-03-26T08:44:39.000Z","published_at":"2012-02-02T20:32:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe sum of the squares of the first ten natural numbers is,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=6\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1084,"title":"Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)","description":"Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\r\n\r\nProject Euler Problem 92: \u003chttp://projecteuler.net/problem=92 Link\u003e","description_html":"\u003cp\u003eGiven a number \u003ci\u003en\u003c/i\u003e, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\u003c/p\u003e\u003cp\u003eProject Euler Problem 92: \u003ca href=\"http://projecteuler.net/problem=92\"\u003eLink\u003c/a\u003e\u003c/p\u003e","function_template":"function y = digits_squared_chain(x)\r\n  y = 1;\r\nend","test_suite":"%%\r\nassert(digits_squared_chain(649) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(79) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(608) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(487) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(739) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(565) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(68) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(383) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(379) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(203) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(632) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(391) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(863) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(13) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(100) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(236) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(293) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(230) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(31) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(806) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(623) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(7) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(13) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(836) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(954) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(567) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(388) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(789) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(246) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(787) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(311) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(856) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(143) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(873) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(215) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(995) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(455) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(948) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(875) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(788) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(722) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(250) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(227) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(640) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(835) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(965) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(726) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(689) == 89)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":256,"test_suite_updated_at":"2012-12-05T06:42:14.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-12-03T06:49:33.000Z","updated_at":"2026-03-26T09:05:10.000Z","published_at":"2012-12-05T06:42:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 92:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=92\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLink\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1106,"title":"I've got the power! (Inspired by Project Euler problem 29)","description":"Consider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\r\n\r\n    2^2=4,  2^3=8,   2^4=16,  2^5=32\r\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\r\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\r\n    5^2=25, 5^3=125, 5^4=625\r\n\r\nIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\r\n\r\n4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\r\n\r\nGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.","description_html":"\u003cp\u003eConsider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\u003c/p\u003e\u003cpre\u003e    2^2=4,  2^3=8,   2^4=16,  2^5=32\r\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\r\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\r\n    5^2=25, 5^3=125, 5^4=625\u003c/pre\u003e\u003cp\u003eIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\u003c/p\u003e\u003cp\u003e4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\u003c/p\u003e\u003cp\u003eGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.\u003c/p\u003e","function_template":"function z = euler029(x,y)\r\n  z = x+y;\r\nend","test_suite":"%%\r\nassert(isequal(euler029(5,5),[4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125]));\r\n%%\r\nassert(isequal(euler029(4,15),[4\t8\t9\t16\t25\t27\t32\t36\t49\t64\t81\t100\t121\t125\t128\t144\t169\t196\t216\t225\t243\t256\t343\t512\t625\t729\t1000\t1024\t1296\t1331\t1728\t2048\t2187\t2197\t2401\t2744\t3375\t4096\t6561\t8192\t10000\t14641\t16384\t19683\t20736\t28561\t32768\t38416\t50625\t59049\t65536\t177147\t262144\t531441\t1048576\t1594323\t4194304\t4782969\t14348907\t16777216\t67108864\t268435456\t1073741824]));\r\n%%\r\nassert(isequal(euler029(10,10),[4,8,9,16,25,27,32,36,49,64,81,100,125,128,216,243,256,343,512,625,729,1000,1024,1296,2187,2401,3125,4096,6561,7776,10000,15625,16384,16807,19683,32768,46656,59049,65536,78125,100000,117649,262144,279936,390625,531441,823543,1000000,1048576,1679616,1953125,2097152,4782969,5764801,9765625,10000000,10077696,16777216,40353607,43046721,60466176,100000000,134217728,282475249,387420489,1000000000,1073741824,3486784401,10000000000]));\r\n%%\r\na=ceil(rand*80)+2\r\nb=ceil(rand*80)+2\r\nassert(isequal(euler029(a,b),euler029(b,a)))\r\n%%\r\nassert(isequal(euler029(30,2),[4,8,9,16,25,32,36,49,64,81,100,121,128,144,169,196,225,256,289,324,361,400,441,484,512,529,576,625,676,729,784,841,900,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824]))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":143,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-07T17:27:47.000Z","updated_at":"2026-03-09T19:34:22.000Z","published_at":"2012-12-07T17:27:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[    2^2=4,  2^3=8,   2^4=16,  2^5=32\\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\\n    5^2=25, 5^3=125, 5^4=625]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":230,"title":"Project Euler: Problem 1, Multiples of 3 and 5","description":"If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\r\n\r\nFind the sum of all the multiples of 3 or 5 below the input value.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=1 Project Euler Problem 1\u003e","description_html":"\u003cp\u003eIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\u003c/p\u003e\u003cp\u003eFind the sum of all the multiples of 3 or 5 below the input value.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=1\"\u003eProject Euler Problem 1\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler001(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 1000;\r\ny_correct = 233168;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 4000;\r\ny_correct = 3732668;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 2340;\r\ny_correct = 1276470;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 2341;\r\ny_correct = 1278810;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":49,"comments_count":5,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3677,"test_suite_updated_at":"2012-02-02T21:27:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T14:46:43.000Z","updated_at":"2026-03-31T15:10:58.000Z","published_at":"2012-02-02T21:43:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sum of all the multiples of 3 or 5 below the input value.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42394,"title":"It's going down.  We're finding simbers!","description":"This problem is inspired by Project Euler 520: Simbers.\r\n\r\n\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\r\n\r\nFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\r\n\r\nGiven a number, determine if it a simber or not.  Please note that the number will be in *string* format as some of the entries may be quite long.  You can assume there will be no leading zeroes in any of the numbers.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 87px; vertical-align: baseline; perspective-origin: 332px 87px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis problem is inspired by Project Euler 520: Simbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; perspective-origin: 309px 31.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003estring\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = simber(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(simber('141221242'),true))\r\n%%\r\nassert(isequal(simber('1223334444'),true))\r\n%%\r\nassert(isequal(simber('122333444'),false))\r\n%%\r\nassert(isequal(simber('567886'),true))\r\n%%\r\nassert(isequal(simber('999999999888888888'),false))\r\n%%\r\nassert(isequal(simber('6677788'),true))\r\n%%\r\nv=arrayfun(@(x) simber(num2str(x)),1:100);\r\ny_correct=[1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1];\r\nassert(isequal(v,y_correct))\r\n%%\r\nk=arrayfun(@(x) simber(sprintf('%.0f',2^x+1)),1:39);\r\ny_correct=[1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];\r\nassert(isequal(k,y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2020-09-29T03:05:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-06-18T19:55:17.000Z","updated_at":"2026-03-16T15:14:55.000Z","published_at":"2015-06-18T19:55:17.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\u003eThis problem is inspired by Project Euler 520: Simbers.\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\\\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\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, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\\\"\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\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estring\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\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\"}]}"},{"id":1082,"title":"Lychrel Number Test (Inspired by Project Euler Problem 55)","description":"The task for this problem is to create a function that takes a number _n_ and tests if it might be a Lychrel number. This is, return |true| if the number satisfies the criteria stated below.\r\n\r\n*From Project Euler:* \u003chttp://projecteuler.net/problem=55 Link\u003e\r\n\r\nIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\r\n\r\nNot all numbers produce palindromes so quickly. For example,\r\n\r\n349 + 943 = 1292,\r\n1292 + 2921 = 4213\r\n4213 + 3124 = 7337\r\n\r\nThat is, 349 took three iterations to arrive at a palindrome.\r\n\r\nAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\r\n\r\nSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.","description_html":"\u003cp\u003eThe task for this problem is to create a function that takes a number \u003ci\u003en\u003c/i\u003e and tests if it might be a Lychrel number. This is, return \u003ctt\u003etrue\u003c/tt\u003e if the number satisfies the criteria stated below.\u003c/p\u003e\u003cp\u003e\u003cb\u003eFrom Project Euler:\u003c/b\u003e \u003ca href=\"http://projecteuler.net/problem=55\"\u003eLink\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\u003c/p\u003e\u003cp\u003eNot all numbers produce palindromes so quickly. For example,\u003c/p\u003e\u003cp\u003e349 + 943 = 1292,\r\n1292 + 2921 = 4213\r\n4213 + 3124 = 7337\u003c/p\u003e\u003cp\u003eThat is, 349 took three iterations to arrive at a palindrome.\u003c/p\u003e\u003cp\u003eAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\u003c/p\u003e\u003cp\u003eSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.\u003c/p\u003e","function_template":"function tf = islychrel(n)\r\n  tf = false;\r\nend","test_suite":"%%\r\nassert(islychrel(3763));\r\n\r\n%%\r\nassert(islychrel(5943));\r\n\r\n%%\r\nassert(islychrel(4709));\r\n\r\n%%\r\nassert(~islychrel(3664));\r\n\r\n%%\r\nassert(~islychrel(3692));\r\n\r\n%%\r\nassert(islychrel(196));\r\n\r\n%%\r\nassert(islychrel(8619));\r\n\r\n%%\r\nassert(islychrel(9898));\r\n\r\n%%\r\nassert(islychrel(9344));\r\n\r\n%%\r\nassert(islychrel(9884));\r\n\r\n%%\r\nassert(islychrel(4852));\r\n\r\n%%\r\nassert(islychrel(7491));\r\n\r\n%%\r\nassert(~islychrel(5832));\r\n\r\n%%\r\nassert(~islychrel(7400));\r\n\r\n%%\r\nassert(~islychrel(2349));\r\n\r\n%%\r\nassert(~islychrel(7349));\r\n\r\n%%\r\nassert(~islychrel(9706));\r\n\r\n%%\r\nassert(~islychrel(8669));\r\n\r\n%%\r\nassert(~islychrel(863));\r\n\r\n%%\r\nassert(~islychrel(5979));\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":"2012-12-06T06:32:48.000Z","rescore_all_solutions":false,"group_id":44,"created_at":"2012-12-02T06:02:08.000Z","updated_at":"2026-02-07T16:07:23.000Z","published_at":"2012-12-04T20:00:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe task for this problem is to create a function that takes a number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and tests if it might be a Lychrel number. This is, return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etrue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e if the number satisfies the criteria stated below.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFrom Project Euler:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=55\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLink\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNot all numbers produce palindromes so quickly. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e349 + 943 = 1292, 1292 + 2921 = 4213 4213 + 3124 = 7337\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThat is, 349 took three iterations to arrive at a palindrome.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42937,"title":"Project Euler: Problem 14, Longest Collatz sequence","description":"The following iterative sequence is defined for the set of positive integers:\r\n\r\nn → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\r\n\r\nUsing the rule above and starting with 13, we generate the following sequence:\r\n\r\n13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\r\n\r\nWhich starting number, under _N_, produces the longest chain?\r\n\r\nNOTE: Once the chain starts the terms are allowed to go above _N_.\r\n","description_html":"\u003cp\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/p\u003e\u003cp\u003en → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\u003c/p\u003e\u003cp\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/p\u003e\u003cp\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/p\u003e\u003cp\u003eWhich starting number, under \u003ci\u003eN\u003c/i\u003e, produces the longest chain?\u003c/p\u003e\u003cp\u003eNOTE: Once the chain starts the terms are allowed to go above \u003ci\u003eN\u003c/i\u003e.\u003c/p\u003e","function_template":"function y = LongestCollatz(N)\r\n  y = 123456; \r\nend","test_suite":"%%\r\nassert(isequal(LongestCollatz(1e5),77031))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e6),837799))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e7),8400511))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e8),63728127))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":85274,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-29T15:37:52.000Z","updated_at":"2026-01-17T12:10:52.000Z","published_at":"2016-08-29T15:38:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en → n/2 (n is even) n → 3n + 1 (n is odd)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhich starting number, under\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, produces the longest chain?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNOTE: Once the chain starts the terms are allowed to go above\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42935,"title":"Sums of cubes and squares of sums","description":"Given the positive integers 1:n, can you:\r\n\r\n  1. Compute twice the sum of the cubes of those numbers.\r\n  2. Subtract the square of the sum of those numbers.\r\n  3. Divide that result by n/2. \r\n\r\nSo, for n = 3, we might compute a result like this:\r\n\r\n  ((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\r\n  ans =\r\n      24\r\n\r\nYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\r\n\r\nI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.","description_html":"\u003cp\u003eGiven the positive integers 1:n, can you:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1. Compute twice the sum of the cubes of those numbers.\r\n2. Subtract the square of the sum of those numbers.\r\n3. Divide that result by n/2. \r\n\u003c/pre\u003e\u003cp\u003eSo, for n = 3, we might compute a result like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\r\nans =\r\n    24\r\n\u003c/pre\u003e\u003cp\u003eYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\u003c/p\u003e\u003cp\u003eI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.\u003c/p\u003e","function_template":"function y = cubesLessSquare(n)\r\n  y = n; % your work goes here. be careful!\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 2;\r\ny_correct = 9;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 24;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 5;\r\ny_correct = 90;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 10;\r\ny_correct = 605;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 123;\r\ny_correct = 945624;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 31;\r\ny_correct = 15872;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 314;\r\ny_correct = 15578325;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 3141;\r\ny_correct = 15504233562;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 31415;\r\ny_correct = 15502753617120;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 314159;\r\ny_correct = uint64(15503197751395200);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 1e5;\r\ny_correct = uint64(500010000050000);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 123456;\r\ny_correct = uint64(940835389047072);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":371,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-28T20:26:16.000Z","updated_at":"2026-03-29T22:01:01.000Z","published_at":"2016-08-28T21:45:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the positive integers 1:n, can you:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Compute twice the sum of the cubes of those numbers.\\n2. Subtract the square of the sum of those numbers.\\n3. Divide that result by n/2.]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, for n = 3, we might compute a result like this:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\\nans =\\n    24]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2664,"title":"Divisors for big integer","description":"Inspired by Problem 1025 and Project Euler 12.\r\n\r\nGiven n, return the number y of integers that divide N. \r\n\r\nFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\r\n\r\nIt's easy with normal integer but how to proceed with big number?\r\n\r\n","description_html":"\u003cp\u003eInspired by Problem 1025 and Project Euler 12.\u003c/p\u003e\u003cp\u003eGiven n, return the number y of integers that divide N.\u003c/p\u003e\u003cp\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/p\u003e\u003cp\u003eIt's easy with normal integer but how to proceed with big number?\u003c/p\u003e","function_template":"function y = divisors_Big(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 784;\r\ny_correct = 15;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 1452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 5452637;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 16452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 116452637;\r\ny_correct = 8;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 416452638;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 12250000;\r\ny_correct = 105;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 2031120;\r\ny_correct = 240;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 76576500;\r\ny_correct = 576;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 816452637;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 103672800;\r\ny_correct = 648;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 842161320;\r\ny_correct = 1024;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":240,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-11-12T02:00:29.000Z","updated_at":"2026-01-05T00:22:49.000Z","published_at":"2014-11-12T02:28:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 1025 and Project Euler 12.\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\u003eGiven n, return the number y of integers that divide N.\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, with n = 10, the divisors are [1 2 5 10], so y = 4.\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\u003eIt's easy with normal integer but how to proceed with big number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":241,"title":"Project Euler: Problem 7, Nth prime","description":"By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\r\nWhat is the Nth prime number?\r\nThank you to Project Euler Problem 7","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\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: 298px 8px; transform-origin: 298px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBy listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\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: 97.5px 8px; transform-origin: 97.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhat is the Nth prime number?\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: 41.5px 8px; transform-origin: 41.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 7\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler007(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler007.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || ...\r\n          contains(filetext, 'if') || contains(filetext, 'switch'); \r\nassert(~illegal)\r\n\r\n%%\r\nx = 6;\r\ny_correct = 13;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 69;\r\ny_correct = 347;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 420;\r\ny_correct = 2903;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 1729;\r\ny_correct = 14759;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 10001;\r\ny_correct = 104743;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 123456;\r\ny_correct = 1632899;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":21,"comments_count":11,"created_by":240,"edited_by":223089,"edited_at":"2022-12-27T06:14:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1753,"test_suite_updated_at":"2022-12-27T06:14:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T21:11:56.000Z","updated_at":"2026-03-15T19:01:28.000Z","published_at":"2012-02-03T14:47:05.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\u003eBy listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\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\u003eWhat is the Nth prime number?\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":239,"title":"Project Euler: Problem 5, Smallest multiple","description":"2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\r\n\r\nWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=5 Project Euler Problem 5\u003e","description_html":"\u003cp\u003e2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\u003c/p\u003e\u003cp\u003eWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=5\"\u003eProject Euler Problem 5\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler005(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = 232792560;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 2520;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct = 27720;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 14;\r\ny_correct = 360360;\r\nassert(isequal(euler005(x),y_correct))","published":true,"deleted":false,"likes_count":11,"comments_count":4,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1651,"test_suite_updated_at":"2012-02-02T20:39:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T19:45:07.000Z","updated_at":"2026-03-15T18:59:49.000Z","published_at":"2012-02-02T20:39:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=5\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1190,"title":"Golomb's self-describing sequence (based on Euler 341)","description":"The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\r\n\r\n* |n =\u0026nbsp;    1    2    3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t…|\r\n* |G(n) 1    2\t2\t3\t3\t4\t4\t4\t5\t5\t\u0026nbsp;5\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;…|\r\n\r\nWrite a MATLAB script that will give you G(n) when given n.\r\n\r\nEfficiency is key here, since some of the values in the test suite will take a while to calculate.","description_html":"\u003cp\u003eThe Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ctt\u003en =\u0026nbsp;    1    2    3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t…\u003c/tt\u003e\u003c/li\u003e\u003cli\u003e\u003ctt\u003eG(n) 1    2\t2\t3\t3\t4\t4\t4\t5\t5\t\u0026nbsp;5\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;…\u003c/tt\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eWrite a MATLAB script that will give you G(n) when given n.\u003c/p\u003e\u003cp\u003eEfficiency is key here, since some of the values in the test suite will take a while to calculate.\u003c/p\u003e","function_template":"function y = euler341(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(euler341(1),1))\r\n%%\r\nassert(isequal(euler341(10),5))\r\n%%\r\nassert(isequal(euler341(310),42))\r\n%%\r\nassert(isequal(euler341(4242),210))\r\n%%\r\nassert(isequal(euler341(328509),3084))\r\n%%\r\nassert(isequal(euler341(551368),4247))\r\n%%\r\nassert(isequal(euler341(614125),4540))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":183,"test_suite_updated_at":"2013-10-01T17:43:23.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2013-01-09T15:55:47.000Z","updated_at":"2026-03-25T04:50:04.000Z","published_at":"2013-01-09T15:55:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eG(n) 1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 …\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a MATLAB script that will give you G(n) when given n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEfficiency is key here, since some of the values in the test suite will take a while to calculate.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44732,"title":"Highly divisible triangular number (inspired by Project Euler 12)","description":"Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\r\n\r\n 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...\r\n\r\nAll divisors for each of these numbers are listed below\r\n\r\n 1: 1\r\n 3: 1,3\r\n 6: 1,2,3,6\r\n 10: 1,2,5,10\r\n 15: 1,3,5,15\r\n 21: 1,3,7,21\r\n 28: 1,2,4,7,14,28\r\n 36: 1,2,3,4,6,9,12,18,36\r\n 45: 1,3,5,9,15,45\r\n 55: 1,5,11,55\r\n\r\nYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).","description_html":"\u003cp\u003eTriangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\u003c/p\u003e\u003cpre\u003e 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...\u003c/pre\u003e\u003cp\u003eAll divisors for each of these numbers are listed below\u003c/p\u003e\u003cpre\u003e 1: 1\r\n 3: 1,3\r\n 6: 1,2,3,6\r\n 10: 1,2,5,10\r\n 15: 1,3,5,15\r\n 21: 1,3,7,21\r\n 28: 1,2,4,7,14,28\r\n 36: 1,2,3,4,6,9,12,18,36\r\n 45: 1,3,5,9,15,45\r\n 55: 1,5,11,55\u003c/pre\u003e\u003cp\u003eYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).\u003c/p\u003e","function_template":"function y = div_tri_n(d)\r\n y = d;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp', 'regexpi', 'str2num'},'FileName','div_tri_n.m')\r\n\r\n%%\r\nassert(isequal(div_tri_n(2),6))\r\n\r\n%%\r\nassert(isequal(div_tri_n(4),28))\r\n\r\n%%\r\nassert(isequal(div_tri_n(8),36))\r\n\r\n%%\r\nassert(isequal(div_tri_n(10),120))\r\n\r\n%%\r\nassert(isequal(div_tri_n(20),630))\r\n\r\n%%\r\nassert(isequal(div_tri_n(25),2016))\r\n\r\n%%\r\nassert(isequal(div_tri_n(39),3240))\r\n\r\n%%\r\nassert(isequal(div_tri_n(40),5460))\r\n\r\n%%\r\nassert(isequal(div_tri_n(50),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(70),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(80),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(100),73920))\r\n\r\n%%\r\nassert(isequal(div_tri_n(115),157080))\r\n\r\n%%\r\nassert(isequal(div_tri_n(120),157080))\r\n\r\n%%\r\nassert(isequal(div_tri_n(130),437580))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2018-08-20T16:04:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-08-20T15:15:06.000Z","updated_at":"2026-01-05T00:21:49.000Z","published_at":"2018-08-20T16:04:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTriangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAll divisors for each of these numbers are listed below\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1: 1\\n 3: 1,3\\n 6: 1,2,3,6\\n 10: 1,2,5,10\\n 15: 1,3,5,15\\n 21: 1,3,7,21\\n 28: 1,2,4,7,14,28\\n 36: 1,2,3,4,6,9,12,18,36\\n 45: 1,3,5,9,15,45\\n 55: 1,5,11,55]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":232,"title":"Project Euler: Problem 2, Sum of even Fibonacci","description":"Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\r\n1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\r\nBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.","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: 406.5px 61.5px; transform-origin: 406.5px 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: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; 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.5px 7.81667px; transform-origin: 383.5px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\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: 383.5px 10.5px; text-align: left; transform-origin: 383.5px 10.5px; white-space-collapse: preserve; 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: 109.992px 7.81667px; transform-origin: 109.992px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\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: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; 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: 376.317px 7.81667px; transform-origin: 376.317px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler002(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler002.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || ...\r\n    contains(filetext, '144');\r\nassert(~illegal)\r\n\r\n%%\r\nx =2;\r\nassert(isequal(euler002(x),2))\r\n\r\n%%\r\nx =4000000;\r\ny_correct = 4613732;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =97455000;\r\ny_correct = 82790070;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =597455000;\r\ny_correct = 350704366;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =666576;\r\ny_correct = 257114;\r\nassert(isequal(euler002(x),y_correct))","published":true,"deleted":false,"likes_count":31,"comments_count":8,"created_by":1,"edited_by":223089,"edited_at":"2024-07-04T14:55:54.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2837,"test_suite_updated_at":"2024-07-04T14:55:54.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-02-02T15:26:01.000Z","updated_at":"2026-03-31T16:32:01.000Z","published_at":"2012-02-07T15:29:53.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\u003eEach new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\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\u003e1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\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\u003eBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.\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\"}]}"},{"id":249,"title":"Project Euler: Problem 9, Pythagorean numbers","description":"A Pythagorean triplet is a set of three natural numbers, a b c, for which,\r\n a^2 + b^2 = c^2\r\nFor example,\r\n 3^2 + 4^2 = 9 + 16 = 5^2 = 25.\r\nThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\r\nFind the product abc.\r\nThank you to Project Euler Problem 9.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 199px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 408px 99.5px; transform-origin: 408px 99.5px; vertical-align: baseline; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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.525px 8px; transform-origin: 220.525px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA Pythagorean triplet is a set of three natural numbers, a b c, for which,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 18px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 404px 9px; transform-origin: 404px 9px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18px; 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; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 61.6px 8.5px; tab-size: 4; transform-origin: 61.6px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e a^2 + b^2 = c^2\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\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: 40.8417px 8px; transform-origin: 40.8417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 18px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 404px 9px; transform-origin: 404px 9px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18px; 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; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 119.35px 8.5px; tab-size: 4; transform-origin: 119.35px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e 3^2 + 4^2 = 9 + 16 = 5^2 = 25.\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\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: 243.692px 8px; transform-origin: 243.692px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 65.7333px 8px; transform-origin: 65.7333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the product abc.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 40.45px 8px; transform-origin: 40.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"about:blank\u0026lt;\u0026gt;\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 9\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler009(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler009.m');\r\nassert(isempty(strfind(filetext, 'elseif')))\r\nassert(isempty(strfind(filetext, 'str2num')))\r\n\r\n%%\r\nx = 1000;\r\ny_correct =  31875000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct =  60;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 2000;\r\ny_correct =  255000000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 320;\r\ny_correct =  1044480;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 5000;\r\ny_correct = 3984375000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 240;\r\ny_correct = 48e4;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 90;\r\ny_correct = 21060;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 598;\r\ny_correct = 4825860;\r\nassert(isequal(euler009(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":8,"created_by":240,"edited_by":223089,"edited_at":"2026-01-18T07:05:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1385,"test_suite_updated_at":"2026-01-18T07:05:22.000Z","rescore_all_solutions":false,"group_id":44,"created_at":"2012-02-03T18:08:00.000Z","updated_at":"2026-04-03T04:11:38.000Z","published_at":"2012-03-13T15:41:02.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\u003eA Pythagorean triplet is a set of three natural numbers, a b c, for which,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ a^2 + b^2 = c^2]]\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,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 3^2 + 4^2 = 9 + 16 = 5^2 = 25.]]\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\u003eThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\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\u003eFind the product abc.\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"about:blank\u0026lt;\u0026gt;\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 9\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\"}]}"},{"id":246,"title":"Project Euler: Problem 8, Find largest product in a large string of numbers","description":"Find the greatest product of five consecutive digits in an n-digit number.\r\n\r\n7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843\r\n8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557\r\n6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749\r\n3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776\r\n6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397\r\n5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474\r\n8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586\r\n1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408\r\n0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606\r\n0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\r\n\r\nThe large number will be given as a string, 1xn characters.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=8 Project Euler Problem 8\u003e","description_html":"\u003cp\u003eFind the greatest product of five consecutive digits in an n-digit number.\u003c/p\u003e\u003cp\u003e7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843\r\n8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557\r\n6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749\r\n3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776\r\n6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397\r\n5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474\r\n8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586\r\n1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408\r\n0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606\r\n0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\u003c/p\u003e\u003cp\u003eThe large number will be given as a string, 1xn characters.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=8\"\u003eProject Euler Problem 8\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler008(x)\r\n  y = x;\r\nend","test_suite":"%%\r\na = ['73167176531330624919225119674426574742355349194934'...\r\n     '96983520312774506326239578318016984801869478851843'...\r\n     '85861560789112949495459501737958331952853208805511'...\r\n     '12540698747158523863050715693290963295227443043557'...\r\n     '66896648950445244523161731856403098711121722383113'...\r\n     '62229893423380308135336276614282806444486645238749'...\r\n     '30358907296290491560440772390713810515859307960866'...\r\n     '70172427121883998797908792274921901699720888093776'...\r\n     '65727333001053367881220235421809751254540594752243'...\r\n     '52584907711670556013604839586446706324415722155397'...\r\n     '53697817977846174064955149290862569321978468622482'...\r\n     '83972241375657056057440261407972968652414535100474'...\r\n     '82166370484403199890058895243450658541227588666881'...\r\n     '16427171479924442928260863465674813919123162824586'...\r\n     '17866458359124566529486545682848912883142607690042'...\r\n     '24219022671055626321191109370544217506941658960408'...\r\n     '07198403850962455444362981230987879927244284909188'...\r\n     '84580156166097919133855499200524066689912560717606'...\r\n     '05886116467109405077541002256983155200055935729725'...\r\n     '71636269561882670428232483600823267530420752963450']\r\n \r\n\r\ny_correct = 40824;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n%%\r\n\r\na = ['73467176531330624919225119674426574742355349194934'...\r\n     '96953520312774506326239578318016984801869478851843'...\r\n     '85866560789112949495459501737958331952853208805511'...\r\n     '12540898747158523863050715693290963295227443043557'...\r\n     '66896698950445244523161731856403098711121722383113'...\r\n     '62229890423380308135336276614282806444486645238749'...\r\n     '30358907896290491560440772390713810515859307960866'...\r\n     '70172427621883998797908792274921901699720888093776'...\r\n     '65727333501053367881220235421809751254540594752243'...\r\n     '52584907511670556013604839586446706324415722155397'...\r\n     '53697817477846174064955149290862569321978468622482'...\r\n     '83972241775657056057490261407972968652414535100474'...\r\n     '82166370984403199890008895243450658541227588666881'...\r\n     '16427171079924442928230863465674813919123162824586'...\r\n     '17866458359124566529476545682848912883142607690042'...\r\n     '24219022671055626321111109370544217506941658960408'...\r\n     '07198403850962455444362981230987879927244284909188'...\r\n     '84580156166097919133875499200524063689912560717606'...\r\n     '05886116467109405077541002256983155200055935729725'...\r\n     '71636269561882670428252483600823257530420752963450']\r\n \r\na = reshape(a,10,100);\r\na = a';\r\na = a(:)';\r\n\r\ny_correct = 35721;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n%%\r\na = ['05886116460109405000541002256983155200055935029025'...\r\n     '96952652026120060506262622695082618016986080186960'...\r\n     '85866560089112960960956059501026095826295208805511'...\r\n     '12560089806001585226862605002629522060602606026550'...\r\n     '66896698950526161026185660026098011121022268261126'...\r\n     '62229890608026620661602828066060606086660522680609'...\r\n     '26026589009156060600002269001268105158592600960866'...\r\n     '00102602062699809090809220609219016990208880926006'...\r\n     '65020262626501052626608812202265602180905125226026'...\r\n     '52586090051160055601266060826958660606006261552690'...\r\n     '52669081060008606106006609551609290862569266226082'...\r\n     '82690226060506090261600090296865260160526510060060'...\r\n     '82166260061998900088952602660506585601220588666881'...\r\n     '16602010129282260862660656060812691912261628260586'...\r\n     '10866605826591260566529600658912882616026006900602'...\r\n     '26021902262626211111092600566021050696016589606008'...\r\n     '00198600268509626055606060260809920260602860909188'...\r\n     '86058015616609091912626805605640626689912560010606'...\r\n     '05886116606010960050005601002251552000559265029025'...\r\n     '01626626956188260060282526082668260602005296266050']\r\n \r\na = reshape(a,10,100);\r\na = a';\r\na = a(:)';\r\n\r\ny_correct = 31104;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1307,"test_suite_updated_at":"2012-02-03T14:44:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-03T14:44:44.000Z","updated_at":"2026-03-24T14:47:50.000Z","published_at":"2012-02-03T14:48:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the greatest product of five consecutive digits in an n-digit number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843 8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557 6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749 3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776 6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397 5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474 8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586 1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408 0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606 0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe large number will be given as a string, 1xn characters.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=8\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":234,"title":"Project Euler: Problem 3, Largest prime factor","description":"The prime factors of 13195 are 5, 7, 13 and 29.\r\n\r\nWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=3 Project Euler Problem 3\u003e","description_html":"\u003cp\u003eThe prime factors of 13195 are 5, 7, 13 and 29.\u003c/p\u003e\u003cp\u003eWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=3\"\u003eProject Euler Problem 3\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler003(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 600851475143;\r\ny_correct = 6857;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 3916767508299776;\r\ny_correct = 457;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 32167675;\r\ny_correct = 1286707;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n\r\n%%\r\nx = uint64(321676750829977632);\r\ny_correct = 206830397;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 321676755;\r\ny_correct = 5639;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 361125;\r\ny_correct = 107;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n\r\n%% \r\nx = 13916767508299776;\r\ny_correct = 98779;\r\nassert(isequal(euler003(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":2,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1790,"test_suite_updated_at":"2012-02-07T15:27:25.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T15:37:18.000Z","updated_at":"2026-03-15T18:58:02.000Z","published_at":"2012-02-07T16:32:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe prime factors of 13195 are 5, 7, 13 and 29.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2606,"title":"Decrypt the  cypher using XOR encryption (for beginners)","description":"Inspired by Project Euler n°59\r\n\r\nEach character on a computer is assigned a unique code and the preferred standard is ASCII \r\n(American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, \r\nand lowercase k = 107.\r\nA basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given \r\nvalue, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the \r\ncipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\r\n    \r\nYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). \r\nYou must know that the original text contains common FRENCH words about MATLAB.\r\n\r\nDecrypt the message and find the sum of the ASCII values in the original text.","description_html":"\u003cp\u003eInspired by Project Euler n°59\u003c/p\u003e\u003cp\u003eEach character on a computer is assigned a unique code and the preferred standard is ASCII \r\n(American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, \r\nand lowercase k = 107.\r\nA basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given \r\nvalue, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the \r\ncipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\u003c/p\u003e\u003cp\u003eYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). \r\nYou must know that the original text contains common FRENCH words about MATLAB.\u003c/p\u003e\u003cp\u003eDecrypt the message and find the sum of the ASCII values in the original text.\u003c/p\u003e","function_template":"function y = XOR_cypher(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=[15 3 22 14 3 0 236 98 39 49 54 98 55 44 98 46 35 44 37 35 37 39 98 38 39 98 42 35 55 54 98 44 43 52 39 35 55];\r\ny_correct=3360;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[29 40 184 57 63 122 186 122 23 27 14 22 27 24 118 122 44 53 47 41 122 42 53 47 44 63 32 122 59 52 59 54 35 41 63 40 122 62 63 41 122 62 53 52 52 179 63 41 116];\r\ny_correct=4783;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[28 33 41 53 54 43 60 35 117 121 47 48 42 44 56 53 48 42 60 35 121 60 45 121 52 54 61 176 53 48 42 60 35 121 47 54 42 121 61 54 55 55 176 60 42 121 56 47 60 58 121 20 24 13 21 24 27 119];\r\ny_correct=5667;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[11 39 50 42 39 36 124 102 42 35 102 42 39 40 33 39 33 35 102 34 51 102 37 39 42 37 51 42 102 53 37 47 35 40 50 47 55 51 35];\r\ny_correct=3666;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[27 36 62 57 58 62 36 34 107 40 35 36 56 34 57 107 6 42 63 39 42 41 107 46 63 107 59 42 56 107 27 50 63 35 36 37 107 116];\r\ny_correct=3547;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":32,"created_at":"2014-09-27T10:32:11.000Z","updated_at":"2026-03-19T21:22:18.000Z","published_at":"2014-09-27T10:33:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Project Euler n°59\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\u003eEach character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107. A basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given value, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the cipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\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\u003eYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). You must know that the original text contains common FRENCH words about MATLAB.\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\u003eDecrypt the message and find the sum of the ASCII values in the original text.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42938,"title":"Project Euler: Problem 18, Maximum path sum I","description":"By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\r\n\r\n       3*\r\n     7*  4\r\n   2   4*  6\r\n 8   5   9*  3\r\n \r\n3 + 7 + 4 + 9 = 23\r\n\r\nFind the maximum total from top to bottom of a given triangle.\r\n","description_html":"\u003cp\u003eBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\u003c/p\u003e\u003cpre\u003e       3*\r\n     7*  4\r\n   2   4*  6\r\n 8   5   9*  3\u003c/pre\u003e\u003cp\u003e3 + 7 + 4 + 9 = 23\u003c/p\u003e\u003cp\u003eFind the maximum total from top to bottom of a given triangle.\u003c/p\u003e","function_template":"function s = maxPathSum(tr)\r\n    % tr: lower triangular matrix\r\n  s = inf;\r\nend","test_suite":"%%\r\nx = [3 0 0 0\r\n  7 4 0 0\r\n  2 4 6 0\r\n  8 5 9 3];\r\nassert(isequal(maxPathSum(x),23))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(magic(10))),891))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(magic(100)^2)),251716502500))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(mod(magic(1000),997))),741570))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(gallery('integerdata',1e4,5e3,4))),37455089))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":85274,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":144,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-30T10:52:35.000Z","updated_at":"2026-01-05T00:26:41.000Z","published_at":"2016-08-30T10:53:42.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[       3*\\n     7*  4\\n   2   4*  6\\n 8   5   9*  3]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3 + 7 + 4 + 9 = 23\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the maximum total from top to bottom of a given triangle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":235,"title":"Project Euler: Problem 4, Palindromic numbers","description":"A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\r\nFind the largest palindrome made from the product of numbers less than or equal to the input number.\r\nThank you to Project Euler Problem 4","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: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 51px; transform-origin: 407px 51px; 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: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\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: 321px 8px; transform-origin: 321px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the largest palindrome made from the product of numbers less than or equal to the input number.\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: 41.5px 8px; transform-origin: 41.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 4\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler004(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 12;\r\ny_correct = 121;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 25;\r\ny_correct = 575;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 999;\r\ny_correct = 906609;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 9999;\r\ny_correct = 99000099;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 100;\r\ny_correct = 9009;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 2500;\r\ny_correct = 6167616;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct = 36863;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 1234;\r\ny_correct = 1503051;\r\nassert(isequal(euler004(x),y_correct))","published":true,"deleted":false,"likes_count":14,"comments_count":7,"created_by":240,"edited_by":223089,"edited_at":"2023-01-29T06:25:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1268,"test_suite_updated_at":"2023-01-29T06:25:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T15:46:47.000Z","updated_at":"2026-03-24T14:13:17.000Z","published_at":"2012-02-02T20:33:24.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\u003eA palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\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\u003eFind the largest palindrome made from the product of numbers less than or equal to the input number.\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":1095,"title":"Circular Primes (based on Project Euler, problem 35)","description":"The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\r\n\r\nThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\r\n\r\nGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.","description_html":"\u003cp\u003eThe number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\u003c/p\u003e\u003cp\u003eThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\u003c/p\u003e\u003cp\u003eGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.\u003c/p\u003e","function_template":"function [how_many what_numbers]=circular_prime(x)\r\n    how_many=3;\r\n    what_numbers=[2 3 5];\r\nend","test_suite":"%%\r\n[y numbers]=circular_prime(197)\r\nassert(isequal(y,16)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197]))\r\n%%\r\n[y numbers]=circular_prime(100)\r\nassert(isequal(y,13)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97]))\r\n%%\r\n[y numbers]=circular_prime(250)\r\nassert(isequal(y,17)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199]))\r\n%%\r\n[y numbers]=circular_prime(2000)\r\nassert(isequal(y,27)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931]))\r\n%%\r\n[y numbers]=circular_prime(10000)\r\nassert(isequal(y,33)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377]))\r\n%%\r\n[y numbers]=circular_prime(54321)\r\nassert(isequal(y,38)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377 11939 19391 19937 37199 39119]))\r\n","published":true,"deleted":false,"likes_count":10,"comments_count":6,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":651,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-05T18:02:09.000Z","updated_at":"2026-02-15T10:48:53.000Z","published_at":"2012-12-05T18:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\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\u003eThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\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\u003eGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44316,"title":"Pandigital Multiples of 11 (based on Project Euler 491)","description":"A \"Pandigital number of order X\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u003e9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \"01\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\r\n\r\nGiven a number X, determine how many pandigital numbers of that order are divisible by 11.  You do not need to return the numbers themselves, just how many of them there are.","description_html":"\u003cp\u003eA \"Pandigital number of order X\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u0026gt;9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \"01\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\u003c/p\u003e\u003cp\u003eGiven a number X, determine how many pandigital numbers of that order are divisible by 11.  You do not need to return the numbers themselves, just how many of them there are.\u003c/p\u003e","function_template":"function y = pandigitalby11(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;y_correct = 0;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 3;y_correct = 6;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 7;y_correct = 4032;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\np6=pandigitalby11(6);\r\np8=pandigitalby11(8);\r\np9=pandigitalby11(9);\r\n\r\nassert(p8\u003ep6);\r\nassert(p9\u003ep8);\r\n\r\nf6=factor(p6);\r\nf8=factor(p8);\r\nf9=factor(p9);\r\nf9e1=f9(end-1);\r\n\r\nassert(p6\u003e256);\r\nassert(max(f9)\u003cmax(f8));\r\nassert(f9e1\u003emax(f6));\r\nassert(numel(f9)\u003enumel(f8));\r\n%%\r\nx = 11;y_correct = 9072000;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 14;y_correct = 3216477600;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nassert(isequal(pandigitalby11(16),222911740800))","published":true,"deleted":false,"likes_count":5,"comments_count":15,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2017-10-23T01:32:05.000Z","rescore_all_solutions":false,"group_id":35,"created_at":"2017-09-12T15:26:05.000Z","updated_at":"2026-02-03T09:29:47.000Z","published_at":"2017-10-16T01:50:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA \\\"Pandigital number of order X\\\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u0026gt;9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \\\"01\\\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\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\u003eGiven a number X, determine how many pandigital numbers of that order are divisible by 11. You do not need to return the numbers themselves, just how many of them there are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42936,"title":"Project Euler: Problem 11, Largest product in a grid","description":"What is the greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in a n×n grid ?\r\nProject Euler Problem 11","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440001px; 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: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 36px; transform-origin: 332px 36px; 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: 309px 21px; text-align: left; transform-origin: 309px 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWhat is the greatest product of\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ek\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e adjacent numbers in the same direction (up, down, left, right, or diagonally) in a\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en×n\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e grid ?\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: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://projecteuler.net/problem=11\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 11\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = PE11(A,k)\r\n    % A: nxn grid, Aij \u003e 0\r\n    % k: k adjacent numbers\r\n    % y: greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in A\r\n  y = x;\r\nend","test_suite":"%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nrng default\r\nmd5.update(typecast(uint64(PE11(magic(10),4)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  '9260342934CE67F6A3E74F7EF9001460'))\r\n\r\n%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nmd5.update(typecast(uint64(PE11(randi(20,100),10)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  '20F511AE2F0B0670E5B587DA93EC29D3'))\r\n\r\n%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nmd5.update(typecast(uint64(PE11(randi(30,1000),10)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  'C0C7E4AEAD3242DBAB38472C6349F233'))","published":true,"deleted":false,"likes_count":5,"comments_count":12,"created_by":85274,"edited_by":26769,"edited_at":"2024-01-26T14:55:28.000Z","deleted_by":null,"deleted_at":null,"solvers_count":136,"test_suite_updated_at":"2024-01-26T14:55:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-29T15:18:57.000Z","updated_at":"2026-01-05T00:21:00.000Z","published_at":"2016-08-29T15:20:19.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\u003eWhat is the greatest product of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e adjacent numbers in the same direction (up, down, left, right, or diagonally) in a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en×n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e grid ?\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:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=11\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 11\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":44793,"title":"Project Euler 249: Prime Subset Sums","description":"Inspired by Problem 249 of Project Euler.\r\n\u003chttps://projecteuler.net/problem=249\u003e\r\n\r\nLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\r\n\r\nFind the number of subsets of S, the sum of whose elements is a prime number.\r\nEnter the rightmost 16 digits as your answer.\r\nThe answer must be a uint64 integer.","description_html":"\u003cp\u003eInspired by Problem 249 of Project Euler. \u003ca href = \"https://projecteuler.net/problem=249\"\u003ehttps://projecteuler.net/problem=249\u003c/a\u003e\u003c/p\u003e\u003cp\u003eLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\u003c/p\u003e\u003cp\u003eFind the number of subsets of S, the sum of whose elements is a prime number.\r\nEnter the rightmost 16 digits as your answer.\r\nThe answer must be a uint64 integer.\u003c/p\u003e","function_template":"function num = euler249(N)\r\n  num = uint64(7) % answer for N = 10\r\nend","test_suite":"%%\r\ntic;\r\nSUM = euler249(10)\r\ntoc;\r\nassert(isequal(SUM, uint64(7)))\r\n\r\n%%\r\ntic;\r\nSUM = euler249(100)\r\ntoc;\r\nassert(isequal(SUM, uint64(5253640)))\r\n\r\n%%\r\ntic;\r\nSUM = euler249(1000)\r\ntoc;\r\nassert(isequal(SUM, uint64(5725053962252706)))\r\n%%\r\ntic;\r\nSUM = euler249(2000)\r\ntoc;\r\nassert(isequal(SUM, uint64(9536598422264105)))\r\n%%\r\ntic;\r\nSUM = euler249(4900)\r\ntoc;\r\nassert(isequal(SUM, uint64(2455225028344813)))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":8269,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-11-22T00:50:24.000Z","updated_at":"2025-12-15T21:24:15.000Z","published_at":"2018-11-22T00:50:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 249 of Project Euler.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=249\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://projecteuler.net/problem=249\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the number of subsets of S, the sum of whose elements is a prime number. Enter the rightmost 16 digits as your answer. The answer must be a uint64 integer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1103,"title":"Right Triangle Side Lengths (Inspired by Project Euler Problem 39)","description":"If p is the perimeter of a right angle triangle with integral length sides, { a, b, c }, there are exactly three solutions for p = 120.\r\n{[20,48,52], [24,45,51], [30,40,50]}\r\nGiven any value of p, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is p. Furthermore, the elements of the output should be sorted by their shortest side length.","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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 212px 8px; transform-origin: 212px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the perimeter of a right angle triangle with integral length sides, {\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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: 120px 8px; transform-origin: 120px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e }, there are exactly three solutions for\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 8px 8px; transform-origin: 8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e = 120.\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: 109px 8px; transform-origin: 109px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e{[20,48,52], [24,45,51], [30,40,50]}\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: 59px 8px; transform-origin: 59px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven any value of\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 306.5px 8px; transform-origin: 306.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Furthermore, the elements of the output should be sorted by their shortest side length.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function c = right_triangle_sides(p)\r\n  c = {[p p p]};\r\nend","test_suite":"%%\r\nassert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(12),{ [3 4 5] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(418),{ [57 176 185] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(490),{ [140 147 203] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(112),{ [14 48 50] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(60),{ [10 24 26] [15 20 25] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(650),{ [25 312 313] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(732),{ [183 244 305] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(648),{ [162 216 270] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(930),{ [155 372 403] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(876),{ [219 292 365] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(588),{ [84 245 259] [147 196 245] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(208),{ [39 80 89] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(228),{ [57 76 95] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(312),{ [24 143 145] [78 104 130] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(924),{ [42 440 442] [77 420 427] [132 385 407] [198 336 390] [231 308 385] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(980),{ [280 294 406] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(112),{ [14 48 50] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(30),{ [5 12 13] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(680),{ [102 280 298] [136 255 289] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(396),{ [33 180 183] [72 154 170] [99 132 165] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(988),{ [266 312 410] }))\r\n\r\n","published":true,"deleted":false,"likes_count":37,"comments_count":9,"created_by":134,"edited_by":223089,"edited_at":"2023-02-02T09:19:18.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2043,"test_suite_updated_at":"2023-02-02T09:19:18.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-12-07T06:24:10.000Z","updated_at":"2026-03-24T15:20:06.000Z","published_at":"2012-12-07T06:24:10.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\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the perimeter of a right angle triangle with integral length sides, {\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e }, there are exactly three solutions for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 120.\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{[20,48,52], [24,45,51], [30,40,50]}\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\u003eGiven any value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Furthermore, the elements of the output should be sorted by their shortest side length.\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\"}]}"},{"id":1891,"title":"High Precision Square Root (Inspired by Project Euler 80)","description":"Given a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point.  Your output should be a string.  For example, the output of string_sqrt(1000,10) should be '31.6227766016'  Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\r\n\r\nSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive.  Good luck.","description_html":"\u003cp\u003eGiven a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point.  Your output should be a string.  For example, the output of string_sqrt(1000,10) should be '31.6227766016'  Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\u003c/p\u003e\u003cp\u003eSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive.  Good luck.\u003c/p\u003e","function_template":"function y = string_sqrt(n,k)\r\n  y = sqrt(n);\r\nend","test_suite":"%%\r\nassert(strcmp(string_sqrt(1000,10),'31.6227766016'))\r\n%%\r\nassert(strcmp(string_sqrt(10,11),'3.16227766016'))\r\n%%\r\nassert(strcmp(string_sqrt(3,100),'1.7320508075688772935274463415058723669428052538103806280558069794519330169088000370811461867572485756'))\r\n%%\r\nassert(strcmp(string_sqrt(314159,314),'560.49888492306565872479934293941633491101288779142813321911971670725840486880541273457870660258696202335374555140881778649205224589390756076993240996126057385009263605818384161945745399159720436585888004381611637660905033452884843995010613320008027334007622507916692664539613518278405454926834945753785814159773889523'))\r\n%%\r\na=2:50;\r\na(sqrt(a)==floor(sqrt(a)))=[];\r\nna=numel(a);\r\nb=zeros(na,100);\r\nfor flag=1:na\r\n    temp=string_sqrt(a(flag),101);\r\n    t2=regexprep(temp,'\\.','')-'0';\r\n    b(flag,:)=t2(1:100);\r\nend\r\ny_correct=sum(sum(b))\r\nassert(isequal(19543,y_correct))\r\n%%\r\nassert(strcmp(string_sqrt(12345,1),'111.1'))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":32,"test_suite_updated_at":"2018-06-07T19:02:44.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2013-09-25T17:51:53.000Z","updated_at":"2026-01-11T21:55:54.000Z","published_at":"2013-09-25T17:51:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point. Your output should be a string. For example, the output of string_sqrt(1000,10) should be '31.6227766016' Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\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\u003eSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive. Good luck.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":52532,"title":"Easy Sequences 5: Project Euler Problem 1 - Again!","description":"We are all familiar with Project Euler Problem 1. This time let's try it on bigger multiples and larger range.\r\nFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 72.5px 8px; transform-origin: 72.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWe are all familiar with \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/230\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 1\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: 181px 8px; transform-origin: 181px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. This time let's try it on bigger multiples and larger range.\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: 354px 8px; transform-origin: 354px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function sumMults = euler(mult1,mult2,limit)\r\n    sumMults = mult1 * mult2 / limit;\r\nend","test_suite":"%%\r\nx = '3';\r\ny = '5';\r\nz = '1000';\r\ns = '233168';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '333';\r\ny = '555';\r\nz = '1000000000000000000';\r\ns = '2102102102102102397897897897898053';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '1234567';\r\ny = '67891011';\r\nz = '10000000000000000000000000000';\r\ns = '41236503492327959372976875681892749947271207402890';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '123456789101112';\r\ny = '1234567891011121314151617181920';\r\nz = '10000000000000000000000000000000000000000000';\r\ns = '405000003353802152272811475598036987756535154447670107236880553924296912';\r\nassert(isequal(euler(x,y,z),s))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":255988,"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-08-14T04:00:48.000Z","updated_at":"2025-11-30T19:42:11.000Z","published_at":"2021-08-14T18:07:20.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\u003eWe are all familiar with \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/230\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This time let's try it on bigger multiples and larger range.\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\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\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\"}]}"},{"id":1215,"title":"Diophantine Equations (Inspired by Project Euler, problem 66)","description":"Consider the quadratic Diophantine equation of the form:\r\n\r\nx^2 – Dy^2 = 1\r\n\r\nWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1.  It can be assumed that there are no solutions in positive integers when D is square.\r\n\r\nGiven a value of D, find the minimum value of X that gives a solution to the equation.","description_html":"\u003cp\u003eConsider the quadratic Diophantine equation of the form:\u003c/p\u003e\u003cp\u003ex^2 – Dy^2 = 1\u003c/p\u003e\u003cp\u003eWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1.  It can be assumed that there are no solutions in positive integers when D is square.\u003c/p\u003e\u003cp\u003eGiven a value of D, find the minimum value of X that gives a solution to the equation.\u003c/p\u003e","function_template":"function y = Diophantine(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2; y_correct = 3; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 151; y_correct = 1728148040; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 61; y_correct = 1766319049; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 66; y_correct = 65; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 12000; y_correct = 13007560326001; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 2345; y_correct = 15129001; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nj=[10:10:90 110:10:200]; v=arrayfun(@(x) Diophantine(j(x)),1:length(j));\r\ny_correct=[19 9 11 19 99 31 251 9 19 21 11 6499 71 49 721 339 161 52021 99];\r\nassert(all(isequal(v,y_correct)))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":8,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":70,"test_suite_updated_at":"2013-10-17T19:30:05.000Z","rescore_all_solutions":false,"group_id":25,"created_at":"2013-01-18T19:13:15.000Z","updated_at":"2026-02-15T03:32:35.000Z","published_at":"2013-01-18T19:13:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider the quadratic Diophantine equation of the form:\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\u003ex^2 – Dy^2 = 1\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\u003eWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1. It can be assumed that there are no solutions in positive integers when D is square.\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\u003eGiven a value of D, find the minimum value of X that gives a solution to the equation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45429,"title":"Prime Sum","description":"What is the minimum value that can be written as sum of primes in n different ways?\r\n\r\nFor example,\r\n 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\r\n\r\n \r\n 2 + 2 + 2 + 2 + 2\r\n 2 + 2 + 3 + 3\r\n 2 + 3 + 5\r\n 5 + 5\r\n 3 +7\r\n\r\n\r\n8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\r\n \r\n\r\n\u003chttps://projecteuler.net/problem=77\u003e","description_html":"\u003cp\u003eWhat is the minimum value that can be written as sum of primes in n different ways?\u003c/p\u003e\u003cp\u003eFor example,\r\n 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\u003c/p\u003e\u003cpre\u003e 2 + 2 + 2 + 2 + 2\r\n 2 + 2 + 3 + 3\r\n 2 + 3 + 5\r\n 5 + 5\r\n 3 +7\u003c/pre\u003e\u003cp\u003e8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://projecteuler.net/problem=77\"\u003ehttps://projecteuler.net/problem=77\u003c/a\u003e\u003c/p\u003e","function_template":"function i = prime_sum(n)","test_suite":"%%\r\nassert(isequal(prime_sum(3),7))\r\n%%\r\nassert(isequal(prime_sum(6),11))\r\n\r\n%%\r\nassert(isequal(prime_sum(500),45))\r\n\r\n%%\r\nassert(isequal(prime_sum(2678),64))\r\n\r\n%%\r\nassert(isequal(prime_sum(4290),70))\r\n\r\n%%\r\nassert(isequal(prime_sum(6500),75))\r\n\r\n%%\r\nassert(isequal(prime_sum(116500),117))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":5,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-09T04:25:11.000Z","updated_at":"2020-04-09T04:25:11.000Z","published_at":"2020-04-09T04:25:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the minimum value that can be written as sum of primes in n different ways?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 2 + 2 + 2 + 2 + 2\\n 2 + 2 + 3 + 3\\n 2 + 3 + 5\\n 5 + 5\\n 3 +7]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=77\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://projecteuler.net/problem=77\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44448,"title":"Project Euler: Problem 14 Longest Collatz sequence","description":"This problem is a hard version of \"Problem 42673. Longest Collatz Sequence\", because of time limits.\r\n\u003chttps://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003e\r\n\r\nThe following iterative sequence is defined for the set of positive integers:\r\n\r\nn → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\r\n\r\nUsing the rule above and starting with 13, we generate the following sequence:\r\n\r\n13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\r\n\r\nWhich starting number, no more than N, produces the longest chain, and how long?\r\nDon't cheat!","description_html":"\u003cp\u003eThis problem is a hard version of \"Problem 42673. Longest Collatz Sequence\", because of time limits. \u003ca href = \"https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\"\u003ehttps://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/p\u003e\u003cp\u003en → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\u003c/p\u003e\u003cp\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/p\u003e\u003cp\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/p\u003e\u003cp\u003eWhich starting number, no more than N, produces the longest chain, and how long?\r\nDon't cheat!\u003c/p\u003e","function_template":"function [num, len] = euler014(N)\r\n  \r\nend","test_suite":"%%\r\nfiletext = fileread('euler014.m');\r\nassert(isempty(strfind(filetext, 'tic')),'tic forbidden');\r\nassert(isempty(strfind(filetext, 'toc')),'toc forbidden');\r\nassert(isempty(strfind(filetext, 'pause')),'pause forbidden');\r\n\r\n%%\r\nN = 1234321;\r\nnum_correct = 1117065;\r\nlen_correct = 528;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 10;\r\nnum_correct = 9;\r\nlen_correct = 20;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 100;\r\nnum_correct = 97;\r\nlen_correct = 119;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1000;\r\nnum_correct = 871;\r\nlen_correct = 179;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e4;\r\nnum_correct = 6171;\r\nlen_correct = 262;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e5;\r\nnum_correct = 77031;\r\nlen_correct = 351;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e6;\r\nnum_correct = 837799;\r\nlen_correct = 525;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e7;\r\nnum_correct = 8400511;\r\nlen_correct = 686;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 1.5);\r\nassert(t \u003e 0.001);\r\n\r\n%%\r\nN = 1e8;\r\nnum_correct = 63728127;\r\nlen_correct = 950;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 15);\r\nassert(t \u003e 1);\r\n\r\n%%\r\nN = randi([7e7, 1e8]);\r\nnum_correct = 63728127;\r\nlen_correct = 950;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 15);\r\nassert(t \u003e 1);\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":9,"created_by":8269,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2018-10-10T02:15:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-12T01:06:38.000Z","updated_at":"2018-10-26T04:19:54.000Z","published_at":"2017-12-12T01:44:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is a hard version of \\\"Problem 42673. Longest Collatz Sequence\\\", because of time limits.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en → n/2 (n is even) n → 3n + 1 (n is odd)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhich starting number, no more than N, produces the longest chain, and how long? Don't cheat!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":53965,"title":"Easy Sequences 67: Project Euler Problem 1 - Not Again!!!","description":"You know the drill...\r\nGiven two integers  and , with , find the sum of all positive integers below , that are multiples of any of the integers from  up to .\r\nFor example, for  and , the sum of the multiples of , ,  or  is:\r\n            .","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 132px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eYou know the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://projecteuler.net/problem=1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003edrill\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; \"\u003e\u003cspan style=\"\"\u003e...\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eGiven two integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003ex\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; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003en\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; \"\u003e\u003cspan style=\"\"\u003e, with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAY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IXH/4qeMx/D39CVwiaQ8GkD8BTzs2uC5SrXgT6ZXpKmecSOJEGqIV+IKnjtJZIfiFpX8fVl72kRFyb6kHceQqECTS1aX39b8qNpN2Tx/g8mkGwuc+BhreHWsncd8DxPi8xyPak/QnXZSViMqsHUtsMpd6u+8VkSH9h3JalMUT5wPVlRdc+yOcYDZ6qUdGB6EB0IDoQHYgORAeiAzkdeAkD/LY5+rbkeAAAAABJRU5ErkJggg==\" width=\"36.5\" height=\"18\" style=\"width: 36.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e, find the sum of all positive integers below \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003ex\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; \"\u003e\u003cspan style=\"\"\u003e, that are multiples of any of the integers from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e2\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; \"\u003e\u003cspan style=\"\"\u003e up to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003en\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; \"\u003e\u003cspan style=\"\"\u003e.\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFor example, for \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAkCAYAAAANdf2OAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAWKADAAQAAAABAAAAJAAAAADbokXeAAAD7ElEQVRoBe2YbWhOYRjHH+yFYZLyks2mef3gg5dI3rZiKKShFPJZyUqRsvjAYogPS/mgiKEUkSihpCnJO5EMG5GFhlDD8Puv566zZ+c855xnT+15tvuq3859rvu67uc+17nOda6zSMSKjYCNgI2AjYCNgI2AjYCNQLAIDMJsBhRCD0iG5LBIaTIWSuc11rL5N/DPwVfGOyAb/GQdBnUe/EA/x2+Brjx/nIszgW12jI3uLrqsOAHIZC725hhfHR95+WZ4TXQh/RquZSlsgBpogjwoA2VvLkyCbVABbrISpW6A7GPlD4pTscruct6LC20EBdhNVIv/grLwg5tBVKcM3RxnvttOzebKz/hc/TnmzeM+1MV2IbovoEwPLT1De6SXwyi2u9Nny/cd870dYzPcxEBdwiXYB0sgXr1mOpyolSmAYS5uegTHg14C6SqqzcrgX6DrccoUTkx2O4+f0VdBH6dx2PFEHKpBrYkW/wnTwMgYBo9Bc1eMMg2Pe6LXcNZl78rWG/ApauMMssbPIR88JV6jPQQv1R49DrdhHByE9aBsVm27CaVwHcrBT5ZhUOJnFGBeb3vtLRlSyyJ62c2Dq3EWVDymwnaY7LB7wlj+3xy60EO1J7pjD0F1+wKMhbByAIfYLEjkPC/sD3vYF0X3c9pj3k2tpFTr9xHM3j3rfLwMdi4+lxOVgRaohJdwDMLKdBwmhHVysT+BTl9PHRWtUwzqgxshjBRjrIxX3dbTpA6kGRKS/ngpuLpj1xJaIfWcVBK+g4KbqKhUmSwenegixk/lQYttNIo0Phay93ewuIPXoPeSCbB67g6JPge12MkOrdL5zgPYgrqf1UnYit5HegoUl0JoJxntNO4KtWwLolMz3U0CaTu7i1Dfeh4OQU2gHcc30me2Wjj10PWQkGhTatPmg3kcChJaKRLpzC4ikz1fhK0+e8/zmXdO692kIHu+l4Jk8F4WqIbL8BbyYRY0gETF/UXryP+P2qFn/ma+Fk2+Fm0N9CgrY59CZdupNmclnOljancbrfdJGVPqxHTjEpIVeB1xeGqTyuKjUZ1arl3RcaoeFIDDcA9U5vQkxqJAKZF04/QRJRkMFaCXuup2rOSiUMLp6Q6SqK3+w6NOSvkquAV9wcgqBgqwCrt+WFmdA6ks+9mc9hwE1WcjWxgYn/eMl5sJjgXwAGphIASWkVi2gBauAy3klGxO9GOafwWyT2UpZ3Paa1AWOS7GlD6nr0rMHVAXomTTR0Zc0eMTKyNQqM4q9X/HTnLeD1SnlN3J+JpimZQV1W79/6EIsqAB6uE1KPBWbARsBGwEbARsBGwEbARsBGwEbARcIvAfMQEBOFRjHSoAAAAASUVORK5CYII=\" width=\"44\" height=\"18\" style=\"width: 44px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAASaADAAQAAAABAAAAJAAAAABLVRfgAAADBklEQVRoBe2XW4hNURjHZ8a1CaUZU67jUmSUeKFcQ0gpohDlYR4kxfCilDxoUpLEg7y41OSSvLhFnkZN8uAWyb0GQ5JbLiky/P7HXrVb1jp7n5Oafeasr35nr/V939rnW/+zzlp7V1QECwoEBYICQYGgQFCgeyuwiOn1sadYaTu6eb8v87sGAxzzVOwxzHXEysq1ntn+zsMylxrltJKqEOAR3IaHDjGe4WuBTkesbFzLmek7qC6bGRcx0euM2VHEuLIZMouZai96CaegCcbAf7NB3KnGuls/+qMtX5a7FyjOtWG34Z9RTOFTGLQTzoOU180ngqw/HIWfIH8rZN16UOAJeACm7rhgv/BvA6+5TrfhZDfAERgC7TAK6uAinIXBsAFkEvBerpX8oc1zTnJaYsZ2Mj4lZv2b0BvXWFgDm0HPRsYaaWgBFGSXyZbi+0EnglbWeJBNBfNrDMt50n3si40z44u5FvKdvspGEDgTq+cz7YGu5J4uJ75eMD2KneN6EJpBS1Y27u8ld6R2RO00l9MkmXukyfflfPQFCvC/IHcFXIIFoK1kHeyGVDabLP3CKmYtbIK4STTFT8adJdquoe43oPkcd82hyuXEJ2Vld2AhHFAnZvOi9pWYr1Sb7ym8NSpee21qu0GmWUn11ij1FRNDrVipdrdG8znmmoBrT6olcXKUfJjrc2vg/Kh/n+srK5bU7erTzVff2yhwy5dg+1fh0CrpBJ0AtmnzVXyvHUjRz9LpFi93Dx3NaWbcadqulWT2ozaSdALETXuYvR9NwvcEvsUTPe0snW6mRGmwBLR53zTOpGsHCVJ1oyNRgij2A6pBD5kt4DsACHW5LaaCXeB7iN1CTP+apZDKJpAlEcRIsG0lDsU+gFacHji1h2XV9EryFcycdMTrXVSmH7YJvsNqSG1SVTe86xmh00yryOTUe/Ky5G6mGL2fGaG+0L4Kr+EQ6N+Q1yrzRt3BOtx6v9MzlL68FEyrZxroqn9BOzwFvYoECwoEBYICQYGgQFAgKBAUKFKBP1iVuwiAyNGcAAAAAElFTkSuQmCC\" width=\"36.5\" height=\"18\" style=\"width: 36.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e, the sum of the multiples of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e2\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; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e3\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; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e4\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; \"\u003e\u003cspan style=\"\"\u003e or \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e5\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; \"\u003e\u003cspan style=\"\"\u003e is:\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003e            \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAsAAAAkCAYAAADvj7NHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAEC6ADAAQAAAABAAAAJAAAAADJhzXVAAAZ5ElEQVR4Ae2cCbgdRZXHAzxkD+sIBAgkgIRFQQgYIxMCYR0FRIRhURgMKuogjIwhLEO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xoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMtMfA/wHARx0hpQvx5AAAAABJRU5ErkJggg==\" width=\"517.5\" height=\"18\" style=\"width: 517.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler(x,n)\r\n    y = x;\r\nend","test_suite":"%%\r\nx = 25; n = 5;\r\ny_correct = 209;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 100; n = 10;\r\ny_correct = 3906;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1000; n = 50;\r\ny_correct = 423700;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1000000; n = 100;\r\ny_correct = 439509281294;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1234567; n = 12345;\r\ny_correct = 705704007582;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 88888888; n = 8888;\r\ny_correct = 3728232828310875;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 123456789; n = 321;\r\ny_correct = 6886242066026507;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nxs = 1e3:5e2:1e4; n = 100;\r\nss = sum(arrayfun(@(x) euler(x,n),xs));\r\nss_correct = 316106410;\r\nassert(isequal(ss,ss_correct))\r\n%%\r\nxs = 1e6:1e6:1e8; n = 5e4;\r\nys = arrayfun(@(x) euler(x,n),xs);\r\nss = int64(floor([sum(mod(ys,1e10)) mean(ys) median(ys) mode(ys) std(ys) sum(num2str(ys))]));\r\nss_correct = [496066896447 1595475560668964 1201207453553981 462570111284 1427637776486459 88608];\r\nassert(isequal(ss,ss_correct))\r\n%%\r\nfiletext = fileread('euler.m');\r\nnot_allowed = contains(filetext, 'persistent') || contains(filetext, 'global') || contains(filetext, 'BigInteger') || contains(filetext, 'java'); \r\nassert(~not_allowed)","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-01-24T10:36:23.000Z","updated_at":"2026-03-03T12:58:14.000Z","published_at":"2022-01-25T11:21:09.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\u003eYou know the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edrill\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eGiven two integers \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\u003ex\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, with \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\u003ex \u0026gt; n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, find the sum of all positive integers below \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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, that are multiples of any of the integers from \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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e up to \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\u003en\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, for \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\u003ex=25\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en=5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, the sum of the multiples 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e2\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e or \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\u003e5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is:\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            \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\u003e2+3+4+5+6+8+9+10+12+14+15+16+18+20+21+22+24=209\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\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":42754,"title":"Odd elimination","description":"Inspired by Project Euler problem #539\r\n\r\nYou'll be given a vector from 1 to n; \r\n\r\nGoing from left to right, remove the first number and every other number afterward until the end of the list. \r\n\r\nRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\r\n\r\nExample with n=9 \r\n\r\n1 2 3 4 5 6 7 8 9\r\n\r\n2 4 6 8\r\n\r\n2 6\r\n\r\n6\r\n\r\n\r\n","description_html":"\u003cp\u003eInspired by Project Euler problem #539\u003c/p\u003e\u003cp\u003eYou'll be given a vector from 1 to n;\u003c/p\u003e\u003cp\u003eGoing from left to right, remove the first number and every other number afterward until the end of the list.\u003c/p\u003e\u003cp\u003eRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\u003c/p\u003e\u003cp\u003eExample with n=9\u003c/p\u003e\u003cp\u003e1 2 3 4 5 6 7 8 9\u003c/p\u003e\u003cp\u003e2 4 6 8\u003c/p\u003e\u003cp\u003e2 6\u003c/p\u003e\u003cp\u003e6\u003c/p\u003e","function_template":"function y = odd_elimination(n)\r\n  y=;\r\nend","test_suite":"%%\r\nn = 9;\r\ny_correct = 6;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 1000;\r\ny_correct = 510;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 99;\r\ny_correct = 56;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 5000;\r\ny_correct = 2014;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n%%\r\nn = 100000;\r\ny_correct = 55286;\r\nassert(isequal(odd_elimination(n),y_correct))\r\n\r\n\r\n%%\r\nn = 666;\r\ny_correct = 480;\r\nassert(isequal(odd_elimination(n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":17228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-02-25T09:19:38.000Z","updated_at":"2025-12-07T20:45:00.000Z","published_at":"2016-02-25T09:20:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Project Euler problem #539\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\u003eYou'll be given a vector from 1 to n;\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\u003eGoing from left to right, remove the first number and every other number afterward until the end of the list.\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\u003eRepeat the procedure from right to left, removing the right most number and every other number from the numbers left. Continue removing every other numbers, alternating left to right and right to left, until a single number remains.\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\u003eExample with n=9\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\u003e1 2 3 4 5 6 7 8 9\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\u003e2 4 6 8\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\u003e2 6\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\u003e6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60849,"title":"Permuted Multiples: Project Euler Problem 52","description":"Return the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\r\n\r\n\r\n\r\nYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(255, 255, 255); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(255, 255, 255); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 140.92px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 70.4514px; transform-origin: 407.5px 70.4601px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9896px; 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: 384.497px 10.4861px; text-align: left; transform-origin: 384.497px 10.4948px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = SmallestPermMult()\r\n\r\ny = a + b;\r\n\r\nend","test_suite":"%\u0026%\r\ny = SmallestPermMult()\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(((sum(num2str(y)-'0')^2)/9)^3, 1000) == 441)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(sum(factor(y).^2) == 1686)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(y, 0.5*(2*3^3*11 + 10)-5) == 0) \r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(sum(y - double('JQAKLY').^2) == 821558)\r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12\r\nassert(mod(y, 999) == 0) \r\n% 2 34324 4312 431 4124 41512 541512 412 3123 12","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2601620,"edited_by":2601620,"edited_at":"2025-04-15T20:13:38.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2025-04-15T20:13:38.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-04-15T20:10:36.000Z","updated_at":"2025-04-18T12:11:31.000Z","published_at":"2025-04-15T20:10:36.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\u003eReturn the smallest positive integer, x, for which x, 2x, 3x, 4x, 5x, and 6x, all contain the same digits but in different order.\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\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\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\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\u003eYou can solve the actual problem or try to guess the solution from the test suite. What ever is more fun to you ;)\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\"}]}"},{"id":2721,"title":"Pandigital Factors (Based on Euler 491)","description":"A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero.  Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\r\n\r\nWrite a MATLAB script that takes as input the number X, and another integer Y.  Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y.  For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\r\n\r\n       43120\r\n       42301\r\n       41230\r\n       32410\r\n       31402\r\n       31024\r\n       30142\r\n       23401\r\n       24031\r\n       20314\r\n       14203\r\n       10234\r\n       10423\r\n\r\nThe number 03421 does not count.  Even though it contains all of the digits 0-4, it has a leading zero.  Therefore, the output of pandigit_factors(4,7) would be 13.  You do not need to output all of the numbers themselves, just how many of them there are.  Good luck!","description_html":"\u003cp\u003eA Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero.  Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\u003c/p\u003e\u003cp\u003eWrite a MATLAB script that takes as input the number X, and another integer Y.  Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y.  For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\u003c/p\u003e\u003cpre\u003e       43120\r\n       42301\r\n       41230\r\n       32410\r\n       31402\r\n       31024\r\n       30142\r\n       23401\r\n       24031\r\n       20314\r\n       14203\r\n       10234\r\n       10423\u003c/pre\u003e\u003cp\u003eThe number 03421 does not count.  Even though it contains all of the digits 0-4, it has a leading zero.  Therefore, the output of pandigit_factors(4,7) would be 13.  You do not need to output all of the numbers themselves, just how many of them there are.  Good luck!\u003c/p\u003e","function_template":"function pf = pandigit_factors(x,y)\r\n  pf=x*y;\r\nend","test_suite":"%%\r\nx = 4;y=7;\r\ny_correct = 13;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nx = 3;y=3;\r\ny_correct = 18;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nx = 8;y=8;\r\ny_correct = 45360;\r\nassert(isequal(pandigit_factors(x,y),y_correct));\r\n%%\r\nj=[600 312 600 144 216 312 75 74 0 120 0 144 55];\r\nx=5;y=ceil(13*rand)\r\nassert(isequal(pandigit_factors(x,y),j(y)));\r\n%%\r\nx=1;y=10;\r\nassert(isequal(pandigit_factors(x,y),x));","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-05T17:20:24.000Z","updated_at":"2025-11-30T01:34:22.000Z","published_at":"2014-12-05T17:20:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero. Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a MATLAB script that takes as input the number X, and another integer Y. Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y. For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[       43120\\n       42301\\n       41230\\n       32410\\n       31402\\n       31024\\n       30142\\n       23401\\n       24031\\n       20314\\n       14203\\n       10234\\n       10423]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 03421 does not count. Even though it contains all of the digits 0-4, it has a leading zero. Therefore, the output of pandigit_factors(4,7) would be 13. You do not need to output all of the numbers themselves, just how many of them there are. Good luck!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60837,"title":"Project Euler Problem 48: Self Powers","description":"The series,.\r\nReturn a string of the last ten digits of the series:.\r\n\r\nHint: Use modular arithmetic! \r\nSpoiler: The solution is in the test suite\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(255, 255, 255); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(255, 255, 255); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 171px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 85.5px; transform-origin: 408px 85.5px; vertical-align: baseline; \"\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe series,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAesAAAAmCAYAAADk8rN/AAAAAXNSR0IArs4c6QAAE3hJREFUeF7tnQewNEURx7vNEQMqZS6zZSxUKMWEYE5gQgQVEAwIiJKDoohk0DKRo4iAKEhQEIRSUQyUiFgiiiKmMpY5i7b7e/Ycc/s2zN7u3bv33mwV9fF9t7uz3TPT/86jkq/MgcyBzIHMgcyBzIG55oDO9dflj8scyBzIHMgcyBzIHJAM1nkRZA5kDmQOZA5kDsw5BzJYz/kE5c/LHMgcyBzIHMgcyGCd10DmQOZA5kDmQObAnHMgg/WcT1D+vMyBzIHMgcyBzIGpgLWZ3VFE9hWR14jIOaq6zUpktZkdKiKbi8jdC3rh5a9F5FRV3XUl0evz+SEReZGI3FlE/lvM7Q9FZD9V/ehKojXT0s6BlP1tZq8WkXf4evmLiKwhIh9V1be1j5DvyBzIHChzYHCwNrPdReSNInJfEblF8efxKxGszex4EdlMRK4RkR+LyFNF5G4i8o9CML1XVfdeKcvNzE4TkQ0QtiL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aSfg2L8+YGc1cUGS5Ko8Vjb/VQ2rsI0IN7ww1034kL81QftuxtW9tnXXfcaMksfAq6r5PdBmBXCDbnAM9tm040ANjpxe9kQucEw4rD5hpWg+pc2RmdIejbWroKcGZD4D2j4o1v2FhTePp4P9pId3axCt13Io9G1zgyfQ2nWfNyyAK5A9CjzHp7IJliYV2dPls5GlusCGFXmRBhO48bZ8+aDlT22BTADDaiu5cxCnX8lpqBAnaNBo+yUkHTdrHvI2Wtt+nQCtaKwKWlojEBfdW1RPCd7iStn9hca9RdNq70LtFLbSMdSCrfbaNlqrfh1y3JeHca4+aGeuB5hO0yKTrHvyg2xi8Iuu38rSlSXiw3J5xDwv1tXhpSDQKspJ9A6BRV//J8hnL0RrDWuX5tZ2nCGX+u7jtqMQKwZ4E1r5+O41rZutjXXoXL0r6oBOrEoXicpfxIy9c3TyaWadxK2gMSXIcG5p05O4kc+QK6fu8+QlHdXJhZdOZ8SrvtIlnrfaaZNwh6G21rOdpk7mFyMHhbB7aly5pxvY0eWNmJPgAsLhxd1JVtL8Vea10WlfTul2RCzQTlTkwBxxYVmA9B/zKn5A5kDmQOZA5kDkwcw5ksJ45y/OAmQOZA5kDmQOZA904kMG6G7/y3ZkDmQOZA5kDmQMz50AG65mzPA+YOZA5kDmQOZA50I0DGay78SvfnTmQOZA5kDmQOTBzDmSwnjnL84CZA5kDmQOZA5kD3TiQwbobv/LdmQOZA5kDmQOZAzPnwP8A/9we6l9jjkgAAAAASUVORK5CYII=\" width=\"245.5\" height=\"19\" style=\"width: 245.5px; height: 19px;\"\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a string of the last ten digits of the series:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVMAAAAmCAYAAAB503iyAAAAAXNSR0IArs4c6QAADGBJREFUeF7tXWfMNUUVfo6d2MUS6w8r0ahRo9HYexcUBQQVUUQEIipNwIIoUjWxIsonRRAEI1IUBTEqYo8ajRUL9pZYYjfocZ7rmde5++3d3bs7d+7e+579A997d3bnnDnzzOkr8Ms54BxwDjgHBnNABj/BH+AccA44B5wDcDB1IXAOOAecAxk44GCagYn+COeAc8A54GDqMuAccA44BzJwwME0AxP9Ec4B54BzYCFgqqo3BPA6AM8FcL6I7LmOrFbV4wHsBuAWgV7y8rcAzhSRg9aJXlvPtwN4KoCbAPhPWNsfAni9iJyxTrQ6LePlQBdcUdXnAHi1yelfANwIwBki8vKUstz38dnZwVRVDwHwYgC3B3Ct8N8t6wimqroFwK4Avg3gJwAeCuDmAP4RFvDNInL4eMVyvpmp6lkAHkWhBPBzAHsBuFug//sAniYi/K9fzoGFcaALrqjq3gCOBkAQpYx+FsCHADwCwOki8kJOMPd9kehFgClB5esAvgDg7usIpqr6RADvCQB6mYjsbgtEWs8BcA8A3wLw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l4Ql2mEzaMtpzmAZIbZU17Kzdn2rcs6yxffheekxTP1NqYjSF6HCOQsn5saEsv0ZJDYefMJnqjblIAnIKZcVk6TLtrOlCbS9cAMCwbPSA4Ce7leWS0mdGM47J2NRqjunbR6CNlrbfF0Arc3dZ9cIG3wygHB6/CWRgy3JCZm3wM8DsKM9uX5OSYAOLmWPbaKn7Pafcps+37x713qOqSnlgcOnW1uSG/OCXPfn9JKYFzvwg5LLG9uF/qTGtmmmpiXR5z6Ka7HZ5d+l71r1hcgUUsjbCLr1Wbe/bTHLbxot1/n2lwHSdF8Jpcw44B1abAw6mq71+PnvngHNgJBxwMB3JQvg0nAPOgdXmgIPpaq+fz9454BwYCQccTEeyED4N54BzYLU54GC62uvns3cOOAdGwgEH05EshE/DOeAcWG0O/Bce2AOuvYIzogAAAABJRU5ErkJggg==\" width=\"169.5\" height=\"19\" style=\"width: 169.5px; height: 19px;\"\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHint: Use modular arithmetic! \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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSpoiler: The solution is in the test suite\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function digits_string = selfPowerSeries()\r\n  digits_string = '0123456789';\r\nend","test_suite":"%% \r\nm = 10^10\r\nsum = 0;\r\nfor i = 1:1000\r\n    \r\n    modulo = mod(i, m);\r\n\r\n    for j = 1:i-1\r\n        modulo = mod(modulo * i, m);\r\n    end\r\n    \r\n    sum = sum + modulo;\r\nend\r\n\r\ny_correct = num2str(sum)\r\ny_correct = y_correct(end-9:end)\r\n\r\nassert(isequal(selfPowerSeries(),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2601620,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-04-02T00:34:14.000Z","updated_at":"2025-07-18T08:50:42.000Z","published_at":"2025-04-02T00:34:14.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\u003eThe series,\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\u003e1^1+2^2+3^3+...+10^{10}=10405071317\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\u003eReturn a string of the last ten digits of the series:\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\u003e1^1+2^2+3^3+...+1000^{1000}\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\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\u003eHint: Use modular arithmetic! \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\u003eSpoiler: The solution is in the test suite\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\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\"}]}"},{"id":42913,"title":"Pseudo Square Root (Inspired by Project Euler 266)","description":"Shamelessly copied from the Project Euler page for Problem 266:\r\n-------------\r\n\r\nThe divisors of 12 are: 1,2,3,4,6 and 12.\r\n\r\nThe largest divisor of 12 that does not exceed the square root of 12 is 3.\r\n\r\nWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\r\n\r\nIt can be seen that PSR(3102)=47.\r\n\r\n-------------\r\n\r\nWrite a MATLAB script that will determine what the pseudo square root of a number is.  Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.","description_html":"\u003cp\u003eShamelessly copied from the Project Euler page for Problem 266:\r\n-------------\u003c/p\u003e\u003cp\u003eThe divisors of 12 are: 1,2,3,4,6 and 12.\u003c/p\u003e\u003cp\u003eThe largest divisor of 12 that does not exceed the square root of 12 is 3.\u003c/p\u003e\u003cp\u003eWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\u003c/p\u003e\u003cp\u003eIt can be seen that PSR(3102)=47.\u003c/p\u003e\u003cp\u003e-------------\u003c/p\u003e\u003cp\u003eWrite a MATLAB script that will determine what the pseudo square root of a number is.  Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.\u003c/p\u003e","function_template":"function y = PSR(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12;y_correct = 3;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx = 3102;y_correct = 47;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=10000;y_correct = 100;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=1308276133167003;y_correct = 36105377;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\nx=6469693230;y_correct = 79534;\r\nassert(isequal(PSR(x),y_correct))\r\n%%\r\np=cumprod(1:10);\r\ny=arrayfun(@(p) PSR(p),p);\r\ny_correct=[1 1 2 4 10 24 70 192 576 1890];\r\nassert(isequal(y,y_correct))\r\n%%\r\nx=1000000000000002;\r\nassert(isequal(PSR(PSR(x)),2))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-07-19T13:50:36.000Z","updated_at":"2026-03-16T15:35:55.000Z","published_at":"2016-07-19T13:50:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eShamelessly copied from the Project Euler page for Problem 266: -------------\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\u003eThe divisors of 12 are: 1,2,3,4,6 and 12.\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\u003eThe largest divisor of 12 that does not exceed the square root of 12 is 3.\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\u003eWe shall call the largest divisor of an integer n that does not exceed the square root of n the pseudo square root (PSR) of n.\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\u003eIt can be seen that PSR(3102)=47.\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-------------\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 MATLAB script that will determine what the pseudo square root of a number is. Please note that if the number is a perfect square, the pseudo square root will equal the actual square root.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":250,"title":"Project Euler: Problem 10, Sum of Primes","description":"The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\r\n\r\nFind the sum of all the primes below the input, N.\r\n\r\nThank you \u003chttp://projecteuler.net/problem=10 Project Euler Problem 10\u003e","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe sum of the primes less than or equal to 10 is 2 + 3 + 5 + 7 = 17.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the sum of all the primes less than or equal to the input, N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; 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=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThank you\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://projecteuler.net/problem=10\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 10\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler010(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2000000;\r\ny_correct = 142913828922;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 17;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct =4227;\r\nassert(isequal(euler010(x),y_correct))\r\n\r\n%%\r\nx = 11;\r\ny_correct = 28;\r\nassert(isequal(euler010(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":7,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2093,"test_suite_updated_at":"2012-06-08T13:08:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-03T18:17:24.000Z","updated_at":"2026-03-15T19:05:27.000Z","published_at":"2012-02-03T18:17:24.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\u003eThe sum of the primes less than or equal to 10 is 2 + 3 + 5 + 7 = 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\u003eFind the sum of all the primes less than or equal to the input, N.\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\u003eThank you\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=10\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 10\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":240,"title":"Project Euler: Problem 6, Natural numbers, squares and sums.","description":"The sum of the squares of the first ten natural numbers is,\r\n\r\n1^2 + 2^2 + ... + 10^2 = 385\r\nThe square of the sum of the first ten natural numbers is,\r\n\r\n(1 + 2 + ... + 10)^2 = 55^2 = 3025\r\nHence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\r\n\r\nFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=6 Project Euler Problem 6\u003e","description_html":"\u003cp\u003eThe sum of the squares of the first ten natural numbers is,\u003c/p\u003e\u003cp\u003e1^2 + 2^2 + ... + 10^2 = 385\r\nThe square of the sum of the first ten natural numbers is,\u003c/p\u003e\u003cp\u003e(1 + 2 + ... + 10)^2 = 55^2 = 3025\r\nHence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\u003c/p\u003e\u003cp\u003eFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=6\"\u003eProject Euler Problem 6\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler006(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 2640;\r\nassert(isequal(euler006(x),y_correct))\r\n\r\n%%\r\nx = 20;\r\ny_correct = 41230;\r\nassert(isequal(euler006(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct = 401323300;\r\nassert(isequal(euler006(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":3,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2540,"test_suite_updated_at":"2012-02-02T20:31:39.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-02-02T20:31:39.000Z","updated_at":"2026-03-26T08:44:39.000Z","published_at":"2012-02-02T20:32:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe sum of the squares of the first ten natural numbers is,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the difference between the sum of the squares of the first N (where N is the input) natural numbers and the square of the sum.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=6\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1084,"title":"Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)","description":"Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\r\n\r\nProject Euler Problem 92: \u003chttp://projecteuler.net/problem=92 Link\u003e","description_html":"\u003cp\u003eGiven a number \u003ci\u003en\u003c/i\u003e, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\u003c/p\u003e\u003cp\u003eProject Euler Problem 92: \u003ca href=\"http://projecteuler.net/problem=92\"\u003eLink\u003c/a\u003e\u003c/p\u003e","function_template":"function y = digits_squared_chain(x)\r\n  y = 1;\r\nend","test_suite":"%%\r\nassert(digits_squared_chain(649) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(79) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(608) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(487) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(739) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(565) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(68) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(383) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(379) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(203) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(632) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(391) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(863) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(13) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(100) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(236) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(293) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(230) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(31) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(806) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(623) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(7) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(13) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(836) == 1)\r\n\r\n%%\r\nassert(digits_squared_chain(954) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(567) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(388) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(789) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(246) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(787) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(311) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(856) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(143) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(873) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(215) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(995) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(455) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(948) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(875) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(788) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(722) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(250) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(227) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(640) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(835) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(965) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(726) == 89)\r\n\r\n%%\r\nassert(digits_squared_chain(689) == 89)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":256,"test_suite_updated_at":"2012-12-05T06:42:14.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-12-03T06:49:33.000Z","updated_at":"2026-03-26T09:05:10.000Z","published_at":"2012-12-05T06:42:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return the terminal value of the number chain formed by summing the square of the digits. According to the Project Euler problem, this number chain always terminates with either 1 or 89.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 92:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=92\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLink\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1106,"title":"I've got the power! (Inspired by Project Euler problem 29)","description":"Consider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\r\n\r\n    2^2=4,  2^3=8,   2^4=16,  2^5=32\r\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\r\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\r\n    5^2=25, 5^3=125, 5^4=625\r\n\r\nIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\r\n\r\n4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\r\n\r\nGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.","description_html":"\u003cp\u003eConsider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\u003c/p\u003e\u003cpre\u003e    2^2=4,  2^3=8,   2^4=16,  2^5=32\r\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\r\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\r\n    5^2=25, 5^3=125, 5^4=625\u003c/pre\u003e\u003cp\u003eIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\u003c/p\u003e\u003cp\u003e4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\u003c/p\u003e\u003cp\u003eGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.\u003c/p\u003e","function_template":"function z = euler029(x,y)\r\n  z = x+y;\r\nend","test_suite":"%%\r\nassert(isequal(euler029(5,5),[4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125]));\r\n%%\r\nassert(isequal(euler029(4,15),[4\t8\t9\t16\t25\t27\t32\t36\t49\t64\t81\t100\t121\t125\t128\t144\t169\t196\t216\t225\t243\t256\t343\t512\t625\t729\t1000\t1024\t1296\t1331\t1728\t2048\t2187\t2197\t2401\t2744\t3375\t4096\t6561\t8192\t10000\t14641\t16384\t19683\t20736\t28561\t32768\t38416\t50625\t59049\t65536\t177147\t262144\t531441\t1048576\t1594323\t4194304\t4782969\t14348907\t16777216\t67108864\t268435456\t1073741824]));\r\n%%\r\nassert(isequal(euler029(10,10),[4,8,9,16,25,27,32,36,49,64,81,100,125,128,216,243,256,343,512,625,729,1000,1024,1296,2187,2401,3125,4096,6561,7776,10000,15625,16384,16807,19683,32768,46656,59049,65536,78125,100000,117649,262144,279936,390625,531441,823543,1000000,1048576,1679616,1953125,2097152,4782969,5764801,9765625,10000000,10077696,16777216,40353607,43046721,60466176,100000000,134217728,282475249,387420489,1000000000,1073741824,3486784401,10000000000]));\r\n%%\r\na=ceil(rand*80)+2\r\nb=ceil(rand*80)+2\r\nassert(isequal(euler029(a,b),euler029(b,a)))\r\n%%\r\nassert(isequal(euler029(30,2),[4,8,9,16,25,32,36,49,64,81,100,121,128,144,169,196,225,256,289,324,361,400,441,484,512,529,576,625,676,729,784,841,900,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824]))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":143,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-07T17:27:47.000Z","updated_at":"2026-03-09T19:34:22.000Z","published_at":"2012-12-07T17:27:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider all integer combinations of a^b and b^a for the integer values 2 ≤ a ≤ 4 and 2 ≤ b ≤ 5:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[    2^2=4,  2^3=8,   2^4=16,  2^5=32\\n    3^2=9,  3^3=27,  3^4=81,  3^5=243\\n    4^2=16, 4^3=64,  4^4=256, 4^5=1024\\n    5^2=25, 5^3=125, 5^4=625]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf they are then placed in numerical order, with any repeats removed, we get the following sequence of 14 distinct terms:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two values for x and y, find the unique, sorted sequence given by the values a^b and b^a for 2≤a≤x and 2≤b≤y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":230,"title":"Project Euler: Problem 1, Multiples of 3 and 5","description":"If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\r\n\r\nFind the sum of all the multiples of 3 or 5 below the input value.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=1 Project Euler Problem 1\u003e","description_html":"\u003cp\u003eIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\u003c/p\u003e\u003cp\u003eFind the sum of all the multiples of 3 or 5 below the input value.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=1\"\u003eProject Euler Problem 1\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler001(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 1000;\r\ny_correct = 233168;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 4000;\r\ny_correct = 3732668;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 2340;\r\ny_correct = 1276470;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n%%\r\nx = 2341;\r\ny_correct = 1278810;\r\nassert(isequal(euler001(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":49,"comments_count":5,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3677,"test_suite_updated_at":"2012-02-02T21:27:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T14:46:43.000Z","updated_at":"2026-03-31T15:10:58.000Z","published_at":"2012-02-02T21:43:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sum of all the multiples of 3 or 5 below the input value.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42394,"title":"It's going down.  We're finding simbers!","description":"This problem is inspired by Project Euler 520: Simbers.\r\n\r\n\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\r\n\r\nFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\r\n\r\nGiven a number, determine if it a simber or not.  Please note that the number will be in *string* format as some of the entries may be quite long.  You can assume there will be no leading zeroes in any of the numbers.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 87px; vertical-align: baseline; perspective-origin: 332px 87px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis problem is inspired by Project Euler 520: Simbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; perspective-origin: 309px 31.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003estring\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = simber(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(simber('141221242'),true))\r\n%%\r\nassert(isequal(simber('1223334444'),true))\r\n%%\r\nassert(isequal(simber('122333444'),false))\r\n%%\r\nassert(isequal(simber('567886'),true))\r\n%%\r\nassert(isequal(simber('999999999888888888'),false))\r\n%%\r\nassert(isequal(simber('6677788'),true))\r\n%%\r\nv=arrayfun(@(x) simber(num2str(x)),1:100);\r\ny_correct=[1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1];\r\nassert(isequal(v,y_correct))\r\n%%\r\nk=arrayfun(@(x) simber(sprintf('%.0f',2^x+1)),1:39);\r\ny_correct=[1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];\r\nassert(isequal(k,y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2020-09-29T03:05:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-06-18T19:55:17.000Z","updated_at":"2026-03-16T15:14:55.000Z","published_at":"2015-06-18T19:55:17.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\u003eThis problem is inspired by Project Euler 520: Simbers.\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\\\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\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, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\\\"\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\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estring\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\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\"}]}"},{"id":1082,"title":"Lychrel Number Test (Inspired by Project Euler Problem 55)","description":"The task for this problem is to create a function that takes a number _n_ and tests if it might be a Lychrel number. This is, return |true| if the number satisfies the criteria stated below.\r\n\r\n*From Project Euler:* \u003chttp://projecteuler.net/problem=55 Link\u003e\r\n\r\nIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\r\n\r\nNot all numbers produce palindromes so quickly. For example,\r\n\r\n349 + 943 = 1292,\r\n1292 + 2921 = 4213\r\n4213 + 3124 = 7337\r\n\r\nThat is, 349 took three iterations to arrive at a palindrome.\r\n\r\nAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\r\n\r\nSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.","description_html":"\u003cp\u003eThe task for this problem is to create a function that takes a number \u003ci\u003en\u003c/i\u003e and tests if it might be a Lychrel number. This is, return \u003ctt\u003etrue\u003c/tt\u003e if the number satisfies the criteria stated below.\u003c/p\u003e\u003cp\u003e\u003cb\u003eFrom Project Euler:\u003c/b\u003e \u003ca href=\"http://projecteuler.net/problem=55\"\u003eLink\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\u003c/p\u003e\u003cp\u003eNot all numbers produce palindromes so quickly. For example,\u003c/p\u003e\u003cp\u003e349 + 943 = 1292,\r\n1292 + 2921 = 4213\r\n4213 + 3124 = 7337\u003c/p\u003e\u003cp\u003eThat is, 349 took three iterations to arrive at a palindrome.\u003c/p\u003e\u003cp\u003eAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\u003c/p\u003e\u003cp\u003eSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.\u003c/p\u003e","function_template":"function tf = islychrel(n)\r\n  tf = false;\r\nend","test_suite":"%%\r\nassert(islychrel(3763));\r\n\r\n%%\r\nassert(islychrel(5943));\r\n\r\n%%\r\nassert(islychrel(4709));\r\n\r\n%%\r\nassert(~islychrel(3664));\r\n\r\n%%\r\nassert(~islychrel(3692));\r\n\r\n%%\r\nassert(islychrel(196));\r\n\r\n%%\r\nassert(islychrel(8619));\r\n\r\n%%\r\nassert(islychrel(9898));\r\n\r\n%%\r\nassert(islychrel(9344));\r\n\r\n%%\r\nassert(islychrel(9884));\r\n\r\n%%\r\nassert(islychrel(4852));\r\n\r\n%%\r\nassert(islychrel(7491));\r\n\r\n%%\r\nassert(~islychrel(5832));\r\n\r\n%%\r\nassert(~islychrel(7400));\r\n\r\n%%\r\nassert(~islychrel(2349));\r\n\r\n%%\r\nassert(~islychrel(7349));\r\n\r\n%%\r\nassert(~islychrel(9706));\r\n\r\n%%\r\nassert(~islychrel(8669));\r\n\r\n%%\r\nassert(~islychrel(863));\r\n\r\n%%\r\nassert(~islychrel(5979));\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":"2012-12-06T06:32:48.000Z","rescore_all_solutions":false,"group_id":44,"created_at":"2012-12-02T06:02:08.000Z","updated_at":"2026-02-07T16:07:23.000Z","published_at":"2012-12-04T20:00:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe task for this problem is to create a function that takes a number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and tests if it might be a Lychrel number. This is, return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etrue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e if the number satisfies the criteria stated below.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFrom Project Euler:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=55\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLink\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNot all numbers produce palindromes so quickly. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e349 + 943 = 1292, 1292 + 2921 = 4213 4213 + 3124 = 7337\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThat is, 349 took three iterations to arrive at a palindrome.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSurprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42937,"title":"Project Euler: Problem 14, Longest Collatz sequence","description":"The following iterative sequence is defined for the set of positive integers:\r\n\r\nn → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\r\n\r\nUsing the rule above and starting with 13, we generate the following sequence:\r\n\r\n13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\r\n\r\nWhich starting number, under _N_, produces the longest chain?\r\n\r\nNOTE: Once the chain starts the terms are allowed to go above _N_.\r\n","description_html":"\u003cp\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/p\u003e\u003cp\u003en → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\u003c/p\u003e\u003cp\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/p\u003e\u003cp\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/p\u003e\u003cp\u003eWhich starting number, under \u003ci\u003eN\u003c/i\u003e, produces the longest chain?\u003c/p\u003e\u003cp\u003eNOTE: Once the chain starts the terms are allowed to go above \u003ci\u003eN\u003c/i\u003e.\u003c/p\u003e","function_template":"function y = LongestCollatz(N)\r\n  y = 123456; \r\nend","test_suite":"%%\r\nassert(isequal(LongestCollatz(1e5),77031))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e6),837799))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e7),8400511))\r\n\r\n%%\r\nassert(isequal(LongestCollatz(1e8),63728127))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":85274,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-29T15:37:52.000Z","updated_at":"2026-01-17T12:10:52.000Z","published_at":"2016-08-29T15:38:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en → n/2 (n is even) n → 3n + 1 (n is odd)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhich starting number, under\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, produces the longest chain?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNOTE: Once the chain starts the terms are allowed to go above\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42935,"title":"Sums of cubes and squares of sums","description":"Given the positive integers 1:n, can you:\r\n\r\n  1. Compute twice the sum of the cubes of those numbers.\r\n  2. Subtract the square of the sum of those numbers.\r\n  3. Divide that result by n/2. \r\n\r\nSo, for n = 3, we might compute a result like this:\r\n\r\n  ((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\r\n  ans =\r\n      24\r\n\r\nYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\r\n\r\nI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.","description_html":"\u003cp\u003eGiven the positive integers 1:n, can you:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1. Compute twice the sum of the cubes of those numbers.\r\n2. Subtract the square of the sum of those numbers.\r\n3. Divide that result by n/2. \r\n\u003c/pre\u003e\u003cp\u003eSo, for n = 3, we might compute a result like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\r\nans =\r\n    24\r\n\u003c/pre\u003e\u003cp\u003eYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\u003c/p\u003e\u003cp\u003eI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.\u003c/p\u003e","function_template":"function y = cubesLessSquare(n)\r\n  y = n; % your work goes here. be careful!\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 2;\r\ny_correct = 9;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 24;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 5;\r\ny_correct = 90;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 10;\r\ny_correct = 605;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 123;\r\ny_correct = 945624;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 31;\r\ny_correct = 15872;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 314;\r\ny_correct = 15578325;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 3141;\r\ny_correct = 15504233562;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 31415;\r\ny_correct = 15502753617120;\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 314159;\r\ny_correct = uint64(15503197751395200);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 1e5;\r\ny_correct = uint64(500010000050000);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n%%\r\nn = 123456;\r\ny_correct = uint64(940835389047072);\r\nassert(isequal(cubesLessSquare(n),y_correct))\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":371,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-28T20:26:16.000Z","updated_at":"2026-03-29T22:01:01.000Z","published_at":"2016-08-28T21:45:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the positive integers 1:n, can you:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Compute twice the sum of the cubes of those numbers.\\n2. Subtract the square of the sum of those numbers.\\n3. Divide that result by n/2.]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, for n = 3, we might compute a result like this:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[((1^3 + 2^3 + 3^3)*2 - (1 + 2 + 3)^2)/(3/2)\\nans =\\n    24]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYes, you probably can do all of this, but be careful on this problem, as n may be somewhat large, and I am expecting to see the correct result, not just an approximate value. Remember there are always different ways one may solve a problem.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI point out the Project Euler reference because PE problem 6 is what made me think of this problem, and because the test cases will push the limits of what you can do if you are not careful.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2664,"title":"Divisors for big integer","description":"Inspired by Problem 1025 and Project Euler 12.\r\n\r\nGiven n, return the number y of integers that divide N. \r\n\r\nFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\r\n\r\nIt's easy with normal integer but how to proceed with big number?\r\n\r\n","description_html":"\u003cp\u003eInspired by Problem 1025 and Project Euler 12.\u003c/p\u003e\u003cp\u003eGiven n, return the number y of integers that divide N.\u003c/p\u003e\u003cp\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/p\u003e\u003cp\u003eIt's easy with normal integer but how to proceed with big number?\u003c/p\u003e","function_template":"function y = divisors_Big(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 784;\r\ny_correct = 15;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 1452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 5452637;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 16452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 116452637;\r\ny_correct = 8;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 416452638;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 12250000;\r\ny_correct = 105;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 2031120;\r\ny_correct = 240;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 76576500;\r\ny_correct = 576;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 816452637;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 103672800;\r\ny_correct = 648;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 842161320;\r\ny_correct = 1024;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":240,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-11-12T02:00:29.000Z","updated_at":"2026-01-05T00:22:49.000Z","published_at":"2014-11-12T02:28:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 1025 and Project Euler 12.\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\u003eGiven n, return the number y of integers that divide N.\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, with n = 10, the divisors are [1 2 5 10], so y = 4.\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\u003eIt's easy with normal integer but how to proceed with big number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":241,"title":"Project Euler: Problem 7, Nth prime","description":"By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\r\nWhat is the Nth prime number?\r\nThank you to Project Euler Problem 7","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\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: 298px 8px; transform-origin: 298px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBy listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\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: 97.5px 8px; transform-origin: 97.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhat is the Nth prime number?\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: 41.5px 8px; transform-origin: 41.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 7\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler007(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler007.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || ...\r\n          contains(filetext, 'if') || contains(filetext, 'switch'); \r\nassert(~illegal)\r\n\r\n%%\r\nx = 6;\r\ny_correct = 13;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 69;\r\ny_correct = 347;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 420;\r\ny_correct = 2903;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 1729;\r\ny_correct = 14759;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 10001;\r\ny_correct = 104743;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n%%\r\nx = 123456;\r\ny_correct = 1632899;\r\nassert(isequal(euler007(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":21,"comments_count":11,"created_by":240,"edited_by":223089,"edited_at":"2022-12-27T06:14:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1753,"test_suite_updated_at":"2022-12-27T06:14:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T21:11:56.000Z","updated_at":"2026-03-15T19:01:28.000Z","published_at":"2012-02-03T14:47:05.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\u003eBy listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\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\u003eWhat is the Nth prime number?\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":239,"title":"Project Euler: Problem 5, Smallest multiple","description":"2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\r\n\r\nWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=5 Project Euler Problem 5\u003e","description_html":"\u003cp\u003e2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\u003c/p\u003e\u003cp\u003eWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=5\"\u003eProject Euler Problem 5\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler005(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = 232792560;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 2520;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct = 27720;\r\nassert(isequal(euler005(x),y_correct))\r\n\r\n%%\r\nx = 14;\r\ny_correct = 360360;\r\nassert(isequal(euler005(x),y_correct))","published":true,"deleted":false,"likes_count":11,"comments_count":4,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1651,"test_suite_updated_at":"2012-02-02T20:39:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T19:45:07.000Z","updated_at":"2026-03-15T18:59:49.000Z","published_at":"2012-02-02T20:39:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to input number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=5\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1190,"title":"Golomb's self-describing sequence (based on Euler 341)","description":"The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\r\n\r\n* |n =\u0026nbsp;    1    2    3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t…|\r\n* |G(n) 1    2\t2\t3\t3\t4\t4\t4\t5\t5\t\u0026nbsp;5\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;…|\r\n\r\nWrite a MATLAB script that will give you G(n) when given n.\r\n\r\nEfficiency is key here, since some of the values in the test suite will take a while to calculate.","description_html":"\u003cp\u003eThe Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ctt\u003en =\u0026nbsp;    1    2    3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t…\u003c/tt\u003e\u003c/li\u003e\u003cli\u003e\u003ctt\u003eG(n) 1    2\t2\t3\t3\t4\t4\t4\t5\t5\t\u0026nbsp;5\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;6\t\u0026nbsp;…\u003c/tt\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eWrite a MATLAB script that will give you G(n) when given n.\u003c/p\u003e\u003cp\u003eEfficiency is key here, since some of the values in the test suite will take a while to calculate.\u003c/p\u003e","function_template":"function y = euler341(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(euler341(1),1))\r\n%%\r\nassert(isequal(euler341(10),5))\r\n%%\r\nassert(isequal(euler341(310),42))\r\n%%\r\nassert(isequal(euler341(4242),210))\r\n%%\r\nassert(isequal(euler341(328509),3084))\r\n%%\r\nassert(isequal(euler341(551368),4247))\r\n%%\r\nassert(isequal(euler341(614125),4540))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":183,"test_suite_updated_at":"2013-10-01T17:43:23.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2013-01-09T15:55:47.000Z","updated_at":"2026-03-25T04:50:04.000Z","published_at":"2013-01-09T15:55:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eG(n) 1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 …\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a MATLAB script that will give you G(n) when given n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEfficiency is key here, since some of the values in the test suite will take a while to calculate.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44732,"title":"Highly divisible triangular number (inspired by Project Euler 12)","description":"Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\r\n\r\n 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...\r\n\r\nAll divisors for each of these numbers are listed below\r\n\r\n 1: 1\r\n 3: 1,3\r\n 6: 1,2,3,6\r\n 10: 1,2,5,10\r\n 15: 1,3,5,15\r\n 21: 1,3,7,21\r\n 28: 1,2,4,7,14,28\r\n 36: 1,2,3,4,6,9,12,18,36\r\n 45: 1,3,5,9,15,45\r\n 55: 1,5,11,55\r\n\r\nYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).","description_html":"\u003cp\u003eTriangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\u003c/p\u003e\u003cpre\u003e 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...\u003c/pre\u003e\u003cp\u003eAll divisors for each of these numbers are listed below\u003c/p\u003e\u003cpre\u003e 1: 1\r\n 3: 1,3\r\n 6: 1,2,3,6\r\n 10: 1,2,5,10\r\n 15: 1,3,5,15\r\n 21: 1,3,7,21\r\n 28: 1,2,4,7,14,28\r\n 36: 1,2,3,4,6,9,12,18,36\r\n 45: 1,3,5,9,15,45\r\n 55: 1,5,11,55\u003c/pre\u003e\u003cp\u003eYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).\u003c/p\u003e","function_template":"function y = div_tri_n(d)\r\n y = d;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp', 'regexpi', 'str2num'},'FileName','div_tri_n.m')\r\n\r\n%%\r\nassert(isequal(div_tri_n(2),6))\r\n\r\n%%\r\nassert(isequal(div_tri_n(4),28))\r\n\r\n%%\r\nassert(isequal(div_tri_n(8),36))\r\n\r\n%%\r\nassert(isequal(div_tri_n(10),120))\r\n\r\n%%\r\nassert(isequal(div_tri_n(20),630))\r\n\r\n%%\r\nassert(isequal(div_tri_n(25),2016))\r\n\r\n%%\r\nassert(isequal(div_tri_n(39),3240))\r\n\r\n%%\r\nassert(isequal(div_tri_n(40),5460))\r\n\r\n%%\r\nassert(isequal(div_tri_n(50),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(70),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(80),25200))\r\n\r\n%%\r\nassert(isequal(div_tri_n(100),73920))\r\n\r\n%%\r\nassert(isequal(div_tri_n(115),157080))\r\n\r\n%%\r\nassert(isequal(div_tri_n(120),157080))\r\n\r\n%%\r\nassert(isequal(div_tri_n(130),437580))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2018-08-20T16:04:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-08-20T15:15:06.000Z","updated_at":"2026-01-05T00:21:49.000Z","published_at":"2018-08-20T16:04:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTriangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAll divisors for each of these numbers are listed below\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1: 1\\n 3: 1,3\\n 6: 1,2,3,6\\n 10: 1,2,5,10\\n 15: 1,3,5,15\\n 21: 1,3,7,21\\n 28: 1,2,4,7,14,28\\n 36: 1,2,3,4,6,9,12,18,36\\n 45: 1,3,5,9,15,45\\n 55: 1,5,11,55]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour challenge is to write a function that will return the value of the first triangular number to have over d divisors (d will be passed to your function).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":232,"title":"Project Euler: Problem 2, Sum of even Fibonacci","description":"Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\r\n1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\r\nBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.","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: 406.5px 61.5px; transform-origin: 406.5px 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: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; 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.5px 7.81667px; transform-origin: 383.5px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\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: 383.5px 10.5px; text-align: left; transform-origin: 383.5px 10.5px; white-space-collapse: preserve; 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: 109.992px 7.81667px; transform-origin: 109.992px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\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: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; 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: 376.317px 7.81667px; transform-origin: 376.317px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler002(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler002.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || ...\r\n    contains(filetext, '144');\r\nassert(~illegal)\r\n\r\n%%\r\nx =2;\r\nassert(isequal(euler002(x),2))\r\n\r\n%%\r\nx =4000000;\r\ny_correct = 4613732;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =97455000;\r\ny_correct = 82790070;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =597455000;\r\ny_correct = 350704366;\r\nassert(isequal(euler002(x),y_correct))\r\n\r\n%%\r\nx =666576;\r\ny_correct = 257114;\r\nassert(isequal(euler002(x),y_correct))","published":true,"deleted":false,"likes_count":31,"comments_count":8,"created_by":1,"edited_by":223089,"edited_at":"2024-07-04T14:55:54.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2837,"test_suite_updated_at":"2024-07-04T14:55:54.000Z","rescore_all_solutions":false,"group_id":27,"created_at":"2012-02-02T15:26:01.000Z","updated_at":"2026-03-31T16:32:01.000Z","published_at":"2012-02-07T15:29:53.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\u003eEach new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:\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\u003e1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\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\u003eBy considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.\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\"}]}"},{"id":249,"title":"Project Euler: Problem 9, Pythagorean numbers","description":"A Pythagorean triplet is a set of three natural numbers, a b c, for which,\r\n a^2 + b^2 = c^2\r\nFor example,\r\n 3^2 + 4^2 = 9 + 16 = 5^2 = 25.\r\nThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\r\nFind the product abc.\r\nThank you to Project Euler Problem 9.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 199px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 408px 99.5px; transform-origin: 408px 99.5px; vertical-align: baseline; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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.525px 8px; transform-origin: 220.525px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA Pythagorean triplet is a set of three natural numbers, a b c, for which,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 18px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 404px 9px; transform-origin: 404px 9px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18px; 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; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 61.6px 8.5px; tab-size: 4; transform-origin: 61.6px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e a^2 + b^2 = c^2\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\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: 40.8417px 8px; transform-origin: 40.8417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 18px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 404px 9px; transform-origin: 404px 9px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18px; 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; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 119.35px 8.5px; tab-size: 4; transform-origin: 119.35px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e 3^2 + 4^2 = 9 + 16 = 5^2 = 25.\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\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: 243.692px 8px; transform-origin: 243.692px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 65.7333px 8px; transform-origin: 65.7333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the product abc.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 40.45px 8px; transform-origin: 40.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"about:blank\u0026lt;\u0026gt;\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 9\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler009(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('euler009.m');\r\nassert(isempty(strfind(filetext, 'elseif')))\r\nassert(isempty(strfind(filetext, 'str2num')))\r\n\r\n%%\r\nx = 1000;\r\ny_correct =  31875000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct =  60;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 2000;\r\ny_correct =  255000000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 320;\r\ny_correct =  1044480;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 5000;\r\ny_correct = 3984375000;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 240;\r\ny_correct = 48e4;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 90;\r\ny_correct = 21060;\r\nassert(isequal(euler009(x),y_correct))\r\n\r\n%%\r\nx = 598;\r\ny_correct = 4825860;\r\nassert(isequal(euler009(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":8,"created_by":240,"edited_by":223089,"edited_at":"2026-01-18T07:05:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1385,"test_suite_updated_at":"2026-01-18T07:05:22.000Z","rescore_all_solutions":false,"group_id":44,"created_at":"2012-02-03T18:08:00.000Z","updated_at":"2026-04-03T04:11:38.000Z","published_at":"2012-03-13T15:41:02.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\u003eA Pythagorean triplet is a set of three natural numbers, a b c, for which,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ a^2 + b^2 = c^2]]\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,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 3^2 + 4^2 = 9 + 16 = 5^2 = 25.]]\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\u003eThere exists exactly one Pythagorean triplet for which a + b + c = N (the input).\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\u003eFind the product abc.\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"about:blank\u0026lt;\u0026gt;\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 9\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\"}]}"},{"id":246,"title":"Project Euler: Problem 8, Find largest product in a large string of numbers","description":"Find the greatest product of five consecutive digits in an n-digit number.\r\n\r\n7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843\r\n8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557\r\n6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749\r\n3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776\r\n6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397\r\n5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474\r\n8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586\r\n1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408\r\n0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606\r\n0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\r\n\r\nThe large number will be given as a string, 1xn characters.\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=8 Project Euler Problem 8\u003e","description_html":"\u003cp\u003eFind the greatest product of five consecutive digits in an n-digit number.\u003c/p\u003e\u003cp\u003e7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843\r\n8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557\r\n6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749\r\n3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776\r\n6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397\r\n5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474\r\n8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586\r\n1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408\r\n0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606\r\n0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\u003c/p\u003e\u003cp\u003eThe large number will be given as a string, 1xn characters.\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=8\"\u003eProject Euler Problem 8\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler008(x)\r\n  y = x;\r\nend","test_suite":"%%\r\na = ['73167176531330624919225119674426574742355349194934'...\r\n     '96983520312774506326239578318016984801869478851843'...\r\n     '85861560789112949495459501737958331952853208805511'...\r\n     '12540698747158523863050715693290963295227443043557'...\r\n     '66896648950445244523161731856403098711121722383113'...\r\n     '62229893423380308135336276614282806444486645238749'...\r\n     '30358907296290491560440772390713810515859307960866'...\r\n     '70172427121883998797908792274921901699720888093776'...\r\n     '65727333001053367881220235421809751254540594752243'...\r\n     '52584907711670556013604839586446706324415722155397'...\r\n     '53697817977846174064955149290862569321978468622482'...\r\n     '83972241375657056057440261407972968652414535100474'...\r\n     '82166370484403199890058895243450658541227588666881'...\r\n     '16427171479924442928260863465674813919123162824586'...\r\n     '17866458359124566529486545682848912883142607690042'...\r\n     '24219022671055626321191109370544217506941658960408'...\r\n     '07198403850962455444362981230987879927244284909188'...\r\n     '84580156166097919133855499200524066689912560717606'...\r\n     '05886116467109405077541002256983155200055935729725'...\r\n     '71636269561882670428232483600823267530420752963450']\r\n \r\n\r\ny_correct = 40824;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n%%\r\n\r\na = ['73467176531330624919225119674426574742355349194934'...\r\n     '96953520312774506326239578318016984801869478851843'...\r\n     '85866560789112949495459501737958331952853208805511'...\r\n     '12540898747158523863050715693290963295227443043557'...\r\n     '66896698950445244523161731856403098711121722383113'...\r\n     '62229890423380308135336276614282806444486645238749'...\r\n     '30358907896290491560440772390713810515859307960866'...\r\n     '70172427621883998797908792274921901699720888093776'...\r\n     '65727333501053367881220235421809751254540594752243'...\r\n     '52584907511670556013604839586446706324415722155397'...\r\n     '53697817477846174064955149290862569321978468622482'...\r\n     '83972241775657056057490261407972968652414535100474'...\r\n     '82166370984403199890008895243450658541227588666881'...\r\n     '16427171079924442928230863465674813919123162824586'...\r\n     '17866458359124566529476545682848912883142607690042'...\r\n     '24219022671055626321111109370544217506941658960408'...\r\n     '07198403850962455444362981230987879927244284909188'...\r\n     '84580156166097919133875499200524063689912560717606'...\r\n     '05886116467109405077541002256983155200055935729725'...\r\n     '71636269561882670428252483600823257530420752963450']\r\n \r\na = reshape(a,10,100);\r\na = a';\r\na = a(:)';\r\n\r\ny_correct = 35721;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n%%\r\na = ['05886116460109405000541002256983155200055935029025'...\r\n     '96952652026120060506262622695082618016986080186960'...\r\n     '85866560089112960960956059501026095826295208805511'...\r\n     '12560089806001585226862605002629522060602606026550'...\r\n     '66896698950526161026185660026098011121022268261126'...\r\n     '62229890608026620661602828066060606086660522680609'...\r\n     '26026589009156060600002269001268105158592600960866'...\r\n     '00102602062699809090809220609219016990208880926006'...\r\n     '65020262626501052626608812202265602180905125226026'...\r\n     '52586090051160055601266060826958660606006261552690'...\r\n     '52669081060008606106006609551609290862569266226082'...\r\n     '82690226060506090261600090296865260160526510060060'...\r\n     '82166260061998900088952602660506585601220588666881'...\r\n     '16602010129282260862660656060812691912261628260586'...\r\n     '10866605826591260566529600658912882616026006900602'...\r\n     '26021902262626211111092600566021050696016589606008'...\r\n     '00198600268509626055606060260809920260602860909188'...\r\n     '86058015616609091912626805605640626689912560010606'...\r\n     '05886116606010960050005601002251552000559265029025'...\r\n     '01626626956188260060282526082668260602005296266050']\r\n \r\na = reshape(a,10,100);\r\na = a';\r\na = a(:)';\r\n\r\ny_correct = 31104;\r\nassert(isequal(euler008(a),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1307,"test_suite_updated_at":"2012-02-03T14:44:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-03T14:44:44.000Z","updated_at":"2026-03-24T14:47:50.000Z","published_at":"2012-02-03T14:48:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the greatest product of five consecutive digits in an n-digit number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843 8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557 6689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749 3035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776 6572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397 5369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474 8216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586 1786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408 0719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606 0588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe large number will be given as a string, 1xn characters.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=8\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":234,"title":"Project Euler: Problem 3, Largest prime factor","description":"The prime factors of 13195 are 5, 7, 13 and 29.\r\n\r\nWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\r\n\r\nThank you to \u003chttp://projecteuler.net/problem=3 Project Euler Problem 3\u003e","description_html":"\u003cp\u003eThe prime factors of 13195 are 5, 7, 13 and 29.\u003c/p\u003e\u003cp\u003eWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\u003c/p\u003e\u003cp\u003eThank you to \u003ca href=\"http://projecteuler.net/problem=3\"\u003eProject Euler Problem 3\u003c/a\u003e\u003c/p\u003e","function_template":"function y = euler003(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 600851475143;\r\ny_correct = 6857;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 3916767508299776;\r\ny_correct = 457;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 32167675;\r\ny_correct = 1286707;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n\r\n%%\r\nx = uint64(321676750829977632);\r\ny_correct = 206830397;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 321676755;\r\ny_correct = 5639;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n%%\r\nx = 361125;\r\ny_correct = 107;\r\nassert(isequal(euler003(x),y_correct))\r\n\r\n\r\n%% \r\nx = 13916767508299776;\r\ny_correct = 98779;\r\nassert(isequal(euler003(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":2,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1790,"test_suite_updated_at":"2012-02-07T15:27:25.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T15:37:18.000Z","updated_at":"2026-03-15T18:58:02.000Z","published_at":"2012-02-07T16:32:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe prime factors of 13195 are 5, 7, 13 and 29.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the largest prime factor of the number being input, input might be uint64 for large numbers, out must be double precision?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2606,"title":"Decrypt the  cypher using XOR encryption (for beginners)","description":"Inspired by Project Euler n°59\r\n\r\nEach character on a computer is assigned a unique code and the preferred standard is ASCII \r\n(American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, \r\nand lowercase k = 107.\r\nA basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given \r\nvalue, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the \r\ncipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\r\n    \r\nYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). \r\nYou must know that the original text contains common FRENCH words about MATLAB.\r\n\r\nDecrypt the message and find the sum of the ASCII values in the original text.","description_html":"\u003cp\u003eInspired by Project Euler n°59\u003c/p\u003e\u003cp\u003eEach character on a computer is assigned a unique code and the preferred standard is ASCII \r\n(American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, \r\nand lowercase k = 107.\r\nA basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given \r\nvalue, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the \r\ncipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\u003c/p\u003e\u003cp\u003eYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). \r\nYou must know that the original text contains common FRENCH words about MATLAB.\u003c/p\u003e\u003cp\u003eDecrypt the message and find the sum of the ASCII values in the original text.\u003c/p\u003e","function_template":"function y = XOR_cypher(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=[15 3 22 14 3 0 236 98 39 49 54 98 55 44 98 46 35 44 37 35 37 39 98 38 39 98 42 35 55 54 98 44 43 52 39 35 55];\r\ny_correct=3360;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[29 40 184 57 63 122 186 122 23 27 14 22 27 24 118 122 44 53 47 41 122 42 53 47 44 63 32 122 59 52 59 54 35 41 63 40 122 62 63 41 122 62 53 52 52 179 63 41 116];\r\ny_correct=4783;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[28 33 41 53 54 43 60 35 117 121 47 48 42 44 56 53 48 42 60 35 121 60 45 121 52 54 61 176 53 48 42 60 35 121 47 54 42 121 61 54 55 55 176 60 42 121 56 47 60 58 121 20 24 13 21 24 27 119];\r\ny_correct=5667;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[11 39 50 42 39 36 124 102 42 35 102 42 39 40 33 39 33 35 102 34 51 102 37 39 42 37 51 42 102 53 37 47 35 40 50 47 55 51 35];\r\ny_correct=3666;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n%%\r\nx=[27 36 62 57 58 62 36 34 107 40 35 36 56 34 57 107 6 42 63 39 42 41 107 46 63 107 59 42 56 107 27 50 63 35 36 37 107 116];\r\ny_correct=3547;\r\nassert(isequal(XOR_cypher(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":32,"created_at":"2014-09-27T10:32:11.000Z","updated_at":"2026-03-19T21:22:18.000Z","published_at":"2014-09-27T10:33:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Project Euler n°59\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\u003eEach character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107. A basic encryption method is to take a text file or a sentence, convert the bytes to ASCII, then XOR each byte with a given value, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the cipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.\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\u003eYour task has been made easy, as the encryption key consists only of a upper case character (different in every tests). You must know that the original text contains common FRENCH words about MATLAB.\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\u003eDecrypt the message and find the sum of the ASCII values in the original text.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42938,"title":"Project Euler: Problem 18, Maximum path sum I","description":"By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\r\n\r\n       3*\r\n     7*  4\r\n   2   4*  6\r\n 8   5   9*  3\r\n \r\n3 + 7 + 4 + 9 = 23\r\n\r\nFind the maximum total from top to bottom of a given triangle.\r\n","description_html":"\u003cp\u003eBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\u003c/p\u003e\u003cpre\u003e       3*\r\n     7*  4\r\n   2   4*  6\r\n 8   5   9*  3\u003c/pre\u003e\u003cp\u003e3 + 7 + 4 + 9 = 23\u003c/p\u003e\u003cp\u003eFind the maximum total from top to bottom of a given triangle.\u003c/p\u003e","function_template":"function s = maxPathSum(tr)\r\n    % tr: lower triangular matrix\r\n  s = inf;\r\nend","test_suite":"%%\r\nx = [3 0 0 0\r\n  7 4 0 0\r\n  2 4 6 0\r\n  8 5 9 3];\r\nassert(isequal(maxPathSum(x),23))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(magic(10))),891))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(magic(100)^2)),251716502500))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(mod(magic(1000),997))),741570))\r\n\r\n%%\r\nassert(isequal(maxPathSum(tril(gallery('integerdata',1e4,5e3,4))),37455089))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":85274,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":144,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-30T10:52:35.000Z","updated_at":"2026-01-05T00:26:41.000Z","published_at":"2016-08-30T10:53:42.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[       3*\\n     7*  4\\n   2   4*  6\\n 8   5   9*  3]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3 + 7 + 4 + 9 = 23\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the maximum total from top to bottom of a given triangle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":235,"title":"Project Euler: Problem 4, Palindromic numbers","description":"A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\r\nFind the largest palindrome made from the product of numbers less than or equal to the input number.\r\nThank you to Project Euler Problem 4","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: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 51px; transform-origin: 407px 51px; 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: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\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: 321px 8px; transform-origin: 321px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the largest palindrome made from the product of numbers less than or equal to the input number.\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: 41.5px 8px; transform-origin: 41.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThank you to\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 4\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler004(x)\r\n  y = rand;\r\nend","test_suite":"%%\r\nx = 12;\r\ny_correct = 121;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 25;\r\ny_correct = 575;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 999;\r\ny_correct = 906609;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 9999;\r\ny_correct = 99000099;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 100;\r\ny_correct = 9009;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 2500;\r\ny_correct = 6167616;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 200;\r\ny_correct = 36863;\r\nassert(isequal(euler004(x),y_correct))\r\n\r\n%%\r\nx = 1234;\r\ny_correct = 1503051;\r\nassert(isequal(euler004(x),y_correct))","published":true,"deleted":false,"likes_count":14,"comments_count":7,"created_by":240,"edited_by":223089,"edited_at":"2023-01-29T06:25:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":1268,"test_suite_updated_at":"2023-01-29T06:25:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-02T15:46:47.000Z","updated_at":"2026-03-24T14:13:17.000Z","published_at":"2012-02-02T20:33:24.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\u003eA palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\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\u003eFind the largest palindrome made from the product of numbers less than or equal to the input number.\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\u003eThank you to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":1095,"title":"Circular Primes (based on Project Euler, problem 35)","description":"The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\r\n\r\nThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\r\n\r\nGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.","description_html":"\u003cp\u003eThe number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\u003c/p\u003e\u003cp\u003eThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\u003c/p\u003e\u003cp\u003eGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.\u003c/p\u003e","function_template":"function [how_many what_numbers]=circular_prime(x)\r\n    how_many=3;\r\n    what_numbers=[2 3 5];\r\nend","test_suite":"%%\r\n[y numbers]=circular_prime(197)\r\nassert(isequal(y,16)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197]))\r\n%%\r\n[y numbers]=circular_prime(100)\r\nassert(isequal(y,13)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97]))\r\n%%\r\n[y numbers]=circular_prime(250)\r\nassert(isequal(y,17)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199]))\r\n%%\r\n[y numbers]=circular_prime(2000)\r\nassert(isequal(y,27)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931]))\r\n%%\r\n[y numbers]=circular_prime(10000)\r\nassert(isequal(y,33)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377]))\r\n%%\r\n[y numbers]=circular_prime(54321)\r\nassert(isequal(y,38)\u0026\u0026isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377 11939 19391 19937 37199 39119]))\r\n","published":true,"deleted":false,"likes_count":10,"comments_count":6,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":651,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-05T18:02:09.000Z","updated_at":"2026-02-15T10:48:53.000Z","published_at":"2012-12-05T18:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.\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\u003eThere are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.\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\u003eGiven a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44316,"title":"Pandigital Multiples of 11 (based on Project Euler 491)","description":"A \"Pandigital number of order X\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u003e9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \"01\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\r\n\r\nGiven a number X, determine how many pandigital numbers of that order are divisible by 11.  You do not need to return the numbers themselves, just how many of them there are.","description_html":"\u003cp\u003eA \"Pandigital number of order X\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u0026gt;9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \"01\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\u003c/p\u003e\u003cp\u003eGiven a number X, determine how many pandigital numbers of that order are divisible by 11.  You do not need to return the numbers themselves, just how many of them there are.\u003c/p\u003e","function_template":"function y = pandigitalby11(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;y_correct = 0;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 3;y_correct = 6;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 7;y_correct = 4032;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\np6=pandigitalby11(6);\r\np8=pandigitalby11(8);\r\np9=pandigitalby11(9);\r\n\r\nassert(p8\u003ep6);\r\nassert(p9\u003ep8);\r\n\r\nf6=factor(p6);\r\nf8=factor(p8);\r\nf9=factor(p9);\r\nf9e1=f9(end-1);\r\n\r\nassert(p6\u003e256);\r\nassert(max(f9)\u003cmax(f8));\r\nassert(f9e1\u003emax(f6));\r\nassert(numel(f9)\u003enumel(f8));\r\n%%\r\nx = 11;y_correct = 9072000;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nx = 14;y_correct = 3216477600;\r\nassert(isequal(pandigitalby11(x),y_correct))\r\n%%\r\nassert(isequal(pandigitalby11(16),222911740800))","published":true,"deleted":false,"likes_count":5,"comments_count":15,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2017-10-23T01:32:05.000Z","rescore_all_solutions":false,"group_id":35,"created_at":"2017-09-12T15:26:05.000Z","updated_at":"2026-02-03T09:29:47.000Z","published_at":"2017-10-16T01:50:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA \\\"Pandigital number of order X\\\" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X\u0026gt;9, the cycle 0-9 repeats itself. For example, 2310 is a Pandigital number of order 3 (0-3), while 120345678901 is a Pandigital number of order 11, with the \\\"01\\\" at the end of the number representing 10 and 11, respectively (10 and 11 mod 10, essentially). 0321 is not a Pandigital number, as it has a leading zero.\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\u003eGiven a number X, determine how many pandigital numbers of that order are divisible by 11. You do not need to return the numbers themselves, just how many of them there are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42936,"title":"Project Euler: Problem 11, Largest product in a grid","description":"What is the greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in a n×n grid ?\r\nProject Euler Problem 11","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440001px; 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: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 36px; transform-origin: 332px 36px; 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: 309px 21px; text-align: left; transform-origin: 309px 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWhat is the greatest product of\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ek\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e adjacent numbers in the same direction (up, down, left, right, or diagonally) in a\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en×n\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e grid ?\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: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://projecteuler.net/problem=11\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 11\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = PE11(A,k)\r\n    % A: nxn grid, Aij \u003e 0\r\n    % k: k adjacent numbers\r\n    % y: greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in A\r\n  y = x;\r\nend","test_suite":"%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nrng default\r\nmd5.update(typecast(uint64(PE11(magic(10),4)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  '9260342934CE67F6A3E74F7EF9001460'))\r\n\r\n%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nmd5.update(typecast(uint64(PE11(randi(20,100),10)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  '20F511AE2F0B0670E5B587DA93EC29D3'))\r\n\r\n%%\r\nimport java.security.MessageDigest.*\r\nmd5 = getInstance('MD5');\r\nmd5.update(typecast(uint64(PE11(randi(30,1000),10)),'uint8'))\r\nassert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...\r\n  'C0C7E4AEAD3242DBAB38472C6349F233'))","published":true,"deleted":false,"likes_count":5,"comments_count":12,"created_by":85274,"edited_by":26769,"edited_at":"2024-01-26T14:55:28.000Z","deleted_by":null,"deleted_at":null,"solvers_count":136,"test_suite_updated_at":"2024-01-26T14:55:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-29T15:18:57.000Z","updated_at":"2026-01-05T00:21:00.000Z","published_at":"2016-08-29T15:20:19.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\u003eWhat is the greatest product of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e adjacent numbers in the same direction (up, down, left, right, or diagonally) in a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en×n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e grid ?\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:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=11\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 11\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":44793,"title":"Project Euler 249: Prime Subset Sums","description":"Inspired by Problem 249 of Project Euler.\r\n\u003chttps://projecteuler.net/problem=249\u003e\r\n\r\nLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\r\n\r\nFind the number of subsets of S, the sum of whose elements is a prime number.\r\nEnter the rightmost 16 digits as your answer.\r\nThe answer must be a uint64 integer.","description_html":"\u003cp\u003eInspired by Problem 249 of Project Euler. \u003ca href = \"https://projecteuler.net/problem=249\"\u003ehttps://projecteuler.net/problem=249\u003c/a\u003e\u003c/p\u003e\u003cp\u003eLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\u003c/p\u003e\u003cp\u003eFind the number of subsets of S, the sum of whose elements is a prime number.\r\nEnter the rightmost 16 digits as your answer.\r\nThe answer must be a uint64 integer.\u003c/p\u003e","function_template":"function num = euler249(N)\r\n  num = uint64(7) % answer for N = 10\r\nend","test_suite":"%%\r\ntic;\r\nSUM = euler249(10)\r\ntoc;\r\nassert(isequal(SUM, uint64(7)))\r\n\r\n%%\r\ntic;\r\nSUM = euler249(100)\r\ntoc;\r\nassert(isequal(SUM, uint64(5253640)))\r\n\r\n%%\r\ntic;\r\nSUM = euler249(1000)\r\ntoc;\r\nassert(isequal(SUM, uint64(5725053962252706)))\r\n%%\r\ntic;\r\nSUM = euler249(2000)\r\ntoc;\r\nassert(isequal(SUM, uint64(9536598422264105)))\r\n%%\r\ntic;\r\nSUM = euler249(4900)\r\ntoc;\r\nassert(isequal(SUM, uint64(2455225028344813)))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":8269,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-11-22T00:50:24.000Z","updated_at":"2025-12-15T21:24:15.000Z","published_at":"2018-11-22T00:50:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 249 of Project Euler.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=249\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://projecteuler.net/problem=249\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet S = {2, 3, 5, ...} be the set of prime numbers less than N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the number of subsets of S, the sum of whose elements is a prime number. Enter the rightmost 16 digits as your answer. The answer must be a uint64 integer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1103,"title":"Right Triangle Side Lengths (Inspired by Project Euler Problem 39)","description":"If p is the perimeter of a right angle triangle with integral length sides, { a, b, c }, there are exactly three solutions for p = 120.\r\n{[20,48,52], [24,45,51], [30,40,50]}\r\nGiven any value of p, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is p. Furthermore, the elements of the output should be sorted by their shortest side length.","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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 212px 8px; transform-origin: 212px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the perimeter of a right angle triangle with integral length sides, {\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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: 120px 8px; transform-origin: 120px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e }, there are exactly three solutions for\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 8px 8px; transform-origin: 8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e = 120.\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: 109px 8px; transform-origin: 109px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e{[20,48,52], [24,45,51], [30,40,50]}\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: 59px 8px; transform-origin: 59px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven any value of\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 306.5px 8px; transform-origin: 306.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Furthermore, the elements of the output should be sorted by their shortest side length.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function c = right_triangle_sides(p)\r\n  c = {[p p p]};\r\nend","test_suite":"%%\r\nassert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(12),{ [3 4 5] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(418),{ [57 176 185] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(490),{ [140 147 203] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(112),{ [14 48 50] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(60),{ [10 24 26] [15 20 25] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(650),{ [25 312 313] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(732),{ [183 244 305] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(648),{ [162 216 270] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(930),{ [155 372 403] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(876),{ [219 292 365] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(588),{ [84 245 259] [147 196 245] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(208),{ [39 80 89] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(228),{ [57 76 95] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(312),{ [24 143 145] [78 104 130] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(924),{ [42 440 442] [77 420 427] [132 385 407] [198 336 390] [231 308 385] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(980),{ [280 294 406] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(112),{ [14 48 50] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(30),{ [5 12 13] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(680),{ [102 280 298] [136 255 289] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(396),{ [33 180 183] [72 154 170] [99 132 165] }))\r\n\r\n%%\r\nassert(isequal(right_triangle_sides(988),{ [266 312 410] }))\r\n\r\n","published":true,"deleted":false,"likes_count":37,"comments_count":9,"created_by":134,"edited_by":223089,"edited_at":"2023-02-02T09:19:18.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2043,"test_suite_updated_at":"2023-02-02T09:19:18.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-12-07T06:24:10.000Z","updated_at":"2026-03-24T15:20:06.000Z","published_at":"2012-12-07T06:24:10.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\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the perimeter of a right angle triangle with integral length sides, {\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e }, there are exactly three solutions for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 120.\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{[20,48,52], [24,45,51], [30,40,50]}\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\u003eGiven any value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Furthermore, the elements of the output should be sorted by their shortest side length.\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\"}]}"},{"id":1891,"title":"High Precision Square Root (Inspired by Project Euler 80)","description":"Given a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point.  Your output should be a string.  For example, the output of string_sqrt(1000,10) should be '31.6227766016'  Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\r\n\r\nSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive.  Good luck.","description_html":"\u003cp\u003eGiven a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point.  Your output should be a string.  For example, the output of string_sqrt(1000,10) should be '31.6227766016'  Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\u003c/p\u003e\u003cp\u003eSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive.  Good luck.\u003c/p\u003e","function_template":"function y = string_sqrt(n,k)\r\n  y = sqrt(n);\r\nend","test_suite":"%%\r\nassert(strcmp(string_sqrt(1000,10),'31.6227766016'))\r\n%%\r\nassert(strcmp(string_sqrt(10,11),'3.16227766016'))\r\n%%\r\nassert(strcmp(string_sqrt(3,100),'1.7320508075688772935274463415058723669428052538103806280558069794519330169088000370811461867572485756'))\r\n%%\r\nassert(strcmp(string_sqrt(314159,314),'560.49888492306565872479934293941633491101288779142813321911971670725840486880541273457870660258696202335374555140881778649205224589390756076993240996126057385009263605818384161945745399159720436585888004381611637660905033452884843995010613320008027334007622507916692664539613518278405454926834945753785814159773889523'))\r\n%%\r\na=2:50;\r\na(sqrt(a)==floor(sqrt(a)))=[];\r\nna=numel(a);\r\nb=zeros(na,100);\r\nfor flag=1:na\r\n    temp=string_sqrt(a(flag),101);\r\n    t2=regexprep(temp,'\\.','')-'0';\r\n    b(flag,:)=t2(1:100);\r\nend\r\ny_correct=sum(sum(b))\r\nassert(isequal(19543,y_correct))\r\n%%\r\nassert(strcmp(string_sqrt(12345,1),'111.1'))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":32,"test_suite_updated_at":"2018-06-07T19:02:44.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2013-09-25T17:51:53.000Z","updated_at":"2026-01-11T21:55:54.000Z","published_at":"2013-09-25T17:51:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a positive integer n which is not a perfect square, write a MATLAB script that will calculate the square root of n truncated to k places after the decimal point. Your output should be a string. For example, the output of string_sqrt(1000,10) should be '31.6227766016' Notice that the square root of 1000 is (according to MATLAB) 31.62277660168379, so we want the integer part complete, as well as the first k numbers after the decimal point without rounding.\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\u003eSeveral of the values of k will be larger than the usual precision shown by MATLAB, so you'll need to be inventive. Good luck.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":52532,"title":"Easy Sequences 5: Project Euler Problem 1 - Again!","description":"We are all familiar with Project Euler Problem 1. This time let's try it on bigger multiples and larger range.\r\nFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 72.5px 8px; transform-origin: 72.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWe are all familiar with \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/230\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 1\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: 181px 8px; transform-origin: 181px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. This time let's try it on bigger multiples and larger range.\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: 354px 8px; transform-origin: 354px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function sumMults = euler(mult1,mult2,limit)\r\n    sumMults = mult1 * mult2 / limit;\r\nend","test_suite":"%%\r\nx = '3';\r\ny = '5';\r\nz = '1000';\r\ns = '233168';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '333';\r\ny = '555';\r\nz = '1000000000000000000';\r\ns = '2102102102102102397897897897898053';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '1234567';\r\ny = '67891011';\r\nz = '10000000000000000000000000000';\r\ns = '41236503492327959372976875681892749947271207402890';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '123456789101112';\r\ny = '1234567891011121314151617181920';\r\nz = '10000000000000000000000000000000000000000000';\r\ns = '405000003353802152272811475598036987756535154447670107236880553924296912';\r\nassert(isequal(euler(x,y,z),s))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":255988,"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-08-14T04:00:48.000Z","updated_at":"2025-11-30T19:42:11.000Z","published_at":"2021-08-14T18:07:20.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\u003eWe are all familiar with \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/230\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This time let's try it on bigger multiples and larger range.\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\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\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\"}]}"},{"id":1215,"title":"Diophantine Equations (Inspired by Project Euler, problem 66)","description":"Consider the quadratic Diophantine equation of the form:\r\n\r\nx^2 – Dy^2 = 1\r\n\r\nWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1.  It can be assumed that there are no solutions in positive integers when D is square.\r\n\r\nGiven a value of D, find the minimum value of X that gives a solution to the equation.","description_html":"\u003cp\u003eConsider the quadratic Diophantine equation of the form:\u003c/p\u003e\u003cp\u003ex^2 – Dy^2 = 1\u003c/p\u003e\u003cp\u003eWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1.  It can be assumed that there are no solutions in positive integers when D is square.\u003c/p\u003e\u003cp\u003eGiven a value of D, find the minimum value of X that gives a solution to the equation.\u003c/p\u003e","function_template":"function y = Diophantine(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2; y_correct = 3; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 151; y_correct = 1728148040; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 61; y_correct = 1766319049; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 66; y_correct = 65; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 12000; y_correct = 13007560326001; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nx = 2345; y_correct = 15129001; assert(isequal(Diophantine(x),y_correct))\r\n%%\r\nj=[10:10:90 110:10:200]; v=arrayfun(@(x) Diophantine(j(x)),1:length(j));\r\ny_correct=[19 9 11 19 99 31 251 9 19 21 11 6499 71 49 721 339 161 52021 99];\r\nassert(all(isequal(v,y_correct)))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":8,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":70,"test_suite_updated_at":"2013-10-17T19:30:05.000Z","rescore_all_solutions":false,"group_id":25,"created_at":"2013-01-18T19:13:15.000Z","updated_at":"2026-02-15T03:32:35.000Z","published_at":"2013-01-18T19:13:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider the quadratic Diophantine equation of the form:\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\u003ex^2 – Dy^2 = 1\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\u003eWhen D=13, the minimal solution in x is 649^2 – 13×180^2 = 1. It can be assumed that there are no solutions in positive integers when D is square.\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\u003eGiven a value of D, find the minimum value of X that gives a solution to the equation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45429,"title":"Prime Sum","description":"What is the minimum value that can be written as sum of primes in n different ways?\r\n\r\nFor example,\r\n 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\r\n\r\n \r\n 2 + 2 + 2 + 2 + 2\r\n 2 + 2 + 3 + 3\r\n 2 + 3 + 5\r\n 5 + 5\r\n 3 +7\r\n\r\n\r\n8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\r\n \r\n\r\n\u003chttps://projecteuler.net/problem=77\u003e","description_html":"\u003cp\u003eWhat is the minimum value that can be written as sum of primes in n different ways?\u003c/p\u003e\u003cp\u003eFor example,\r\n 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\u003c/p\u003e\u003cpre\u003e 2 + 2 + 2 + 2 + 2\r\n 2 + 2 + 3 + 3\r\n 2 + 3 + 5\r\n 5 + 5\r\n 3 +7\u003c/pre\u003e\u003cp\u003e8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://projecteuler.net/problem=77\"\u003ehttps://projecteuler.net/problem=77\u003c/a\u003e\u003c/p\u003e","function_template":"function i = prime_sum(n)","test_suite":"%%\r\nassert(isequal(prime_sum(3),7))\r\n%%\r\nassert(isequal(prime_sum(6),11))\r\n\r\n%%\r\nassert(isequal(prime_sum(500),45))\r\n\r\n%%\r\nassert(isequal(prime_sum(2678),64))\r\n\r\n%%\r\nassert(isequal(prime_sum(4290),70))\r\n\r\n%%\r\nassert(isequal(prime_sum(6500),75))\r\n\r\n%%\r\nassert(isequal(prime_sum(116500),117))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":5,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-09T04:25:11.000Z","updated_at":"2020-04-09T04:25:11.000Z","published_at":"2020-04-09T04:25:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the minimum value that can be written as sum of primes in n different ways?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, 10 is the minimum value that can be written as the sum of primes in exactly five different ways:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 2 + 2 + 2 + 2 + 2\\n 2 + 2 + 3 + 3\\n 2 + 3 + 5\\n 5 + 5\\n 3 +7]]\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e8 can be written in 3 different ways but 7 can also be written in 3 different ways. So 7 is the right answer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=77\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://projecteuler.net/problem=77\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44448,"title":"Project Euler: Problem 14 Longest Collatz sequence","description":"This problem is a hard version of \"Problem 42673. Longest Collatz Sequence\", because of time limits.\r\n\u003chttps://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003e\r\n\r\nThe following iterative sequence is defined for the set of positive integers:\r\n\r\nn → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\r\n\r\nUsing the rule above and starting with 13, we generate the following sequence:\r\n\r\n13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\r\n\r\nWhich starting number, no more than N, produces the longest chain, and how long?\r\nDon't cheat!","description_html":"\u003cp\u003eThis problem is a hard version of \"Problem 42673. Longest Collatz Sequence\", because of time limits. \u003ca href = \"https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\"\u003ehttps://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/p\u003e\u003cp\u003en → n/2 (n is even)\r\nn → 3n + 1 (n is odd)\u003c/p\u003e\u003cp\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/p\u003e\u003cp\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\r\nIt can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/p\u003e\u003cp\u003eWhich starting number, no more than N, produces the longest chain, and how long?\r\nDon't cheat!\u003c/p\u003e","function_template":"function [num, len] = euler014(N)\r\n  \r\nend","test_suite":"%%\r\nfiletext = fileread('euler014.m');\r\nassert(isempty(strfind(filetext, 'tic')),'tic forbidden');\r\nassert(isempty(strfind(filetext, 'toc')),'toc forbidden');\r\nassert(isempty(strfind(filetext, 'pause')),'pause forbidden');\r\n\r\n%%\r\nN = 1234321;\r\nnum_correct = 1117065;\r\nlen_correct = 528;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 10;\r\nnum_correct = 9;\r\nlen_correct = 20;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 100;\r\nnum_correct = 97;\r\nlen_correct = 119;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1000;\r\nnum_correct = 871;\r\nlen_correct = 179;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e4;\r\nnum_correct = 6171;\r\nlen_correct = 262;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e5;\r\nnum_correct = 77031;\r\nlen_correct = 351;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e6;\r\nnum_correct = 837799;\r\nlen_correct = 525;\r\n[num, len] = euler014(N);\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\n\r\n%%\r\nN = 1e7;\r\nnum_correct = 8400511;\r\nlen_correct = 686;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 1.5);\r\nassert(t \u003e 0.001);\r\n\r\n%%\r\nN = 1e8;\r\nnum_correct = 63728127;\r\nlen_correct = 950;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 15);\r\nassert(t \u003e 1);\r\n\r\n%%\r\nN = randi([7e7, 1e8]);\r\nnum_correct = 63728127;\r\nlen_correct = 950;\r\ntic;\r\n[num, len] = euler014(N);\r\nt = toc;\r\nt\r\nassert(isequal(num, num_correct));\r\nassert(isequal(len, len_correct));\r\nassert(t \u003c 15);\r\nassert(t \u003e 1);\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":9,"created_by":8269,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2018-10-10T02:15:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-12T01:06:38.000Z","updated_at":"2018-10-26T04:19:54.000Z","published_at":"2017-12-12T01:44:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is a hard version of \\\"Problem 42673. Longest Collatz Sequence\\\", because of time limits.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://ww2.mathworks.cn/matlabcentral/cody/problems/42673-longest-collatz-sequence\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe following iterative sequence is defined for the set of positive integers:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en → n/2 (n is even) n → 3n + 1 (n is odd)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsing the rule above and starting with 13, we generate the following sequence:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhich starting number, no more than N, produces the longest chain, and how long? Don't cheat!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":53965,"title":"Easy Sequences 67: Project Euler Problem 1 - Not Again!!!","description":"You know the drill...\r\nGiven two integers  and , with , find the sum of all positive integers below , that are multiples of any of the integers from  up to .\r\nFor example, for  and , the sum of the multiples of , ,  or  is:\r\n            .","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 132px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eYou know the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://projecteuler.net/problem=1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003edrill\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; \"\u003e\u003cspan style=\"\"\u003e...\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eGiven two integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003ex\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; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003en\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; \"\u003e\u003cspan style=\"\"\u003e, with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRd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Mx/D39CVwiaQ8GkD8BTzs2uC5SrXgT6ZXpKmecSOJEGqIV+IKnjtJZIfiFpX8fVl72kRFyb6kHceQqECTS1aX39b8qNpN2Tx/g8mkGwuc+BhreHWsncd8DxPi8xyPak/QnXZSViMqsHUtsMpd6u+8VkSH9h3JalMUT5wPVlRdc+yOcYDZ6qUdGB6EB0IDoQHYgORAeiAzkdeAkD/LY5+rbkeAAAAABJRU5ErkJggg==\" width=\"36.5\" height=\"18\" style=\"width: 36.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e, find the sum of all positive integers below \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003ex\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; \"\u003e\u003cspan style=\"\"\u003e, that are multiples of any of the integers from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e2\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; \"\u003e\u003cspan style=\"\"\u003e up to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: normal; color: rgb(0, 0, 0);\"\u003en\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; \"\u003e\u003cspan style=\"\"\u003e.\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFor example, for \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAkCAYAAAANdf2OAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAWKADAAQAAAABAAAAJAAAAADbokXeAAAD7ElEQVRoBe2YbWhOYRjHH+yFYZLyks2mef3gg5dI3rZiKKShFPJZyUqRsvjAYogPS/mgiKEUkSihpCnJO5EMG5GFhlDD8Puv566zZ+c855xnT+15tvuq3859rvu67uc+17nOda6zSMSKjYCNgI2AjYCNgI2AjYCNQLAIDMJsBhRCD0iG5LBIaTIWSuc11rL5N/DPwVfGOyAb/GQdBnUe/EA/x2+Brjx/nIszgW12jI3uLrqsOAHIZC725hhfHR95+WZ4TXQh/RquZSlsgBpogjwoA2VvLkyCbVABbrISpW6A7GPlD4pTscruct6LC20EBdhNVIv/grLwg5tBVKcM3RxnvttOzebKz/hc/TnmzeM+1MV2IbovoEwPLT1De6SXwyi2u9Nny/cd870dYzPcxEBdwiXYB0sgXr1mOpyolSmAYS5uegTHg14C6SqqzcrgX6DrccoUTkx2O4+f0VdBH6dx2PFEHKpBrYkW/wnTwMgYBo9Bc1eMMg2Pe6LXcNZl78rWG/ApauMMssbPIR88JV6jPQQv1R49DrdhHByE9aBsVm27CaVwHcrBT5ZhUOJnFGBeb3vtLRlSyyJ62c2Dq3EWVDymwnaY7LB7wlj+3xy60EO1J7pjD0F1+wKMhbByAIfYLEjkPC/sD3vYF0X3c9pj3k2tpFTr9xHM3j3rfLwMdi4+lxOVgRaohJdwDMLKdBwmhHVysT+BTl9PHRWtUwzqgxshjBRjrIxX3dbTpA6kGRKS/ngpuLpj1xJaIfWcVBK+g4KbqKhUmSwenegixk/lQYttNIo0Phay93ewuIPXoPeSCbB67g6JPge12MkOrdL5zgPYgrqf1UnYit5HegoUl0JoJxntNO4KtWwLolMz3U0CaTu7i1Dfeh4OQU2gHcc30me2Wjj10PWQkGhTatPmg3kcChJaKRLpzC4ikz1fhK0+e8/zmXdO692kIHu+l4Jk8F4WqIbL8BbyYRY0gETF/UXryP+P2qFn/ma+Fk2+Fm0N9CgrY59CZdupNmclnOljancbrfdJGVPqxHTjEpIVeB1xeGqTyuKjUZ1arl3RcaoeFIDDcA9U5vQkxqJAKZF04/QRJRkMFaCXuup2rOSiUMLp6Q6SqK3+w6NOSvkquAV9wcgqBgqwCrt+WFmdA6ks+9mc9hwE1WcjWxgYn/eMl5sJjgXwAGphIASWkVi2gBauAy3klGxO9GOafwWyT2UpZ3Paa1AWOS7GlD6nr0rMHVAXomTTR0Zc0eMTKyNQqM4q9X/HTnLeD1SnlN3J+JpimZQV1W79/6EIsqAB6uE1KPBWbARsBGwEbARsBGwEbARsBGwEbARcIvAfMQEBOFRjHSoAAAAASUVORK5CYII=\" width=\"44\" height=\"18\" style=\"width: 44px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAkCAYAAADFGRdYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAASaADAAQAAAABAAAAJAAAAABLVRfgAAADBklEQVRoBe2XW4hNURjHZ8a1CaUZU67jUmSUeKFcQ0gpohDlYR4kxfCilDxoUpLEg7y41OSSvLhFnkZN8uAWyb0GQ5JbLiky/P7HXrVb1jp7n5Oafeasr35nr/V939rnW/+zzlp7V1QECwoEBYICQYGgQFCgeyuwiOn1sadYaTu6eb8v87sGAxzzVOwxzHXEysq1ntn+zsMylxrltJKqEOAR3IaHDjGe4WuBTkesbFzLmek7qC6bGRcx0euM2VHEuLIZMouZai96CaegCcbAf7NB3KnGuls/+qMtX5a7FyjOtWG34Z9RTOFTGLQTzoOU180ngqw/HIWfIH8rZN16UOAJeACm7rhgv/BvA6+5TrfhZDfAERgC7TAK6uAinIXBsAFkEvBerpX8oc1zTnJaYsZ2Mj4lZv2b0BvXWFgDm0HPRsYaaWgBFGSXyZbi+0EnglbWeJBNBfNrDMt50n3si40z44u5FvKdvspGEDgTq+cz7YGu5J4uJ75eMD2KneN6EJpBS1Y27u8ld6R2RO00l9MkmXukyfflfPQFCvC/IHcFXIIFoK1kHeyGVDabLP3CKmYtbIK4STTFT8adJdquoe43oPkcd82hyuXEJ2Vld2AhHFAnZvOi9pWYr1Sb7ym8NSpee21qu0GmWUn11ij1FRNDrVipdrdG8znmmoBrT6olcXKUfJjrc2vg/Kh/n+srK5bU7erTzVff2yhwy5dg+1fh0CrpBJ0AtmnzVXyvHUjRz9LpFi93Dx3NaWbcadqulWT2ozaSdALETXuYvR9NwvcEvsUTPe0snW6mRGmwBLR53zTOpGsHCVJ1oyNRgij2A6pBD5kt4DsACHW5LaaCXeB7iN1CTP+apZDKJpAlEcRIsG0lDsU+gFacHji1h2XV9EryFcycdMTrXVSmH7YJvsNqSG1SVTe86xmh00yryOTUe/Ky5G6mGL2fGaG+0L4Kr+EQ6N+Q1yrzRt3BOtx6v9MzlL68FEyrZxroqn9BOzwFvYoECwoEBYICQYGgQFAgKBAUKFKBP1iVuwiAyNGcAAAAAElFTkSuQmCC\" width=\"36.5\" height=\"18\" style=\"width: 36.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e, the sum of the multiples of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e2\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; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e3\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; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e4\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; \"\u003e\u003cspan style=\"\"\u003e or \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: normal; font-weight: normal; color: rgb(0, 0, 0);\"\u003e5\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; \"\u003e\u003cspan style=\"\"\u003e is:\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003e            \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAsAAAAkCAYAAADvj7NHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAEC6ADAAQAAAABAAAAJAAAAADJhzXVAAAZ5ElEQVR4Ae2cCbgdRZXHAzxkD+sIBAgkgIRFQQgYIxMCYR0FRIRhURgMKuogjIwhLEOQRYOADIp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YA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8aAMWAMtMfA/wHARx0hpQvx5AAAAABJRU5ErkJggg==\" width=\"517.5\" height=\"18\" style=\"width: 517.5px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = euler(x,n)\r\n    y = x;\r\nend","test_suite":"%%\r\nx = 25; n = 5;\r\ny_correct = 209;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 100; n = 10;\r\ny_correct = 3906;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1000; n = 50;\r\ny_correct = 423700;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1000000; n = 100;\r\ny_correct = 439509281294;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 1234567; n = 12345;\r\ny_correct = 705704007582;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 88888888; n = 8888;\r\ny_correct = 3728232828310875;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nx = 123456789; n = 321;\r\ny_correct = 6886242066026507;\r\nassert(isequal(euler(x,n),y_correct))\r\n%%\r\nxs = 1e3:5e2:1e4; n = 100;\r\nss = sum(arrayfun(@(x) euler(x,n),xs));\r\nss_correct = 316106410;\r\nassert(isequal(ss,ss_correct))\r\n%%\r\nxs = 1e6:1e6:1e8; n = 5e4;\r\nys = arrayfun(@(x) euler(x,n),xs);\r\nss = int64(floor([sum(mod(ys,1e10)) mean(ys) median(ys) mode(ys) std(ys) sum(num2str(ys))]));\r\nss_correct = [496066896447 1595475560668964 1201207453553981 462570111284 1427637776486459 88608];\r\nassert(isequal(ss,ss_correct))\r\n%%\r\nfiletext = fileread('euler.m');\r\nnot_allowed = contains(filetext, 'persistent') || contains(filetext, 'global') || contains(filetext, 'BigInteger') || contains(filetext, 'java'); \r\nassert(~not_allowed)","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-01-24T10:36:23.000Z","updated_at":"2026-03-03T12:58:14.000Z","published_at":"2022-01-25T11:21:09.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\u003eYou know the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://projecteuler.net/problem=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edrill\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eGiven two integers \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\u003ex\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, with \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\u003ex \u0026gt; n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, find the sum of all positive integers below \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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, that are multiples of any of the integers from \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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e up to \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\u003en\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, for \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\u003ex=25\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en=5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, the sum of the multiples 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e2\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e or \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\u003e5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is:\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            \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\u003e2+3+4+5+6+8+9+10+12+14+15+16+18+20+21+22+24=209\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\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:\"projecteuler\"","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:\"projecteuler\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"projecteuler\"","","\"","projecteuler","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f534ae74e20\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f534ae74d80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f534ae744c0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f534ae750a0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f534ae75000\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f534ae74f60\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f534ae74ec0\u003e":"tag:\"projecteuler\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f534ae74ec0\u003e":"tag:\"projecteuler\""},"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:\"projecteuler\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"projecteuler\"","","\"","projecteuler","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f534ae74e20\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f534ae74d80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f534ae744c0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f534ae750a0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f534ae75000\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f534ae74f60\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f534ae74ec0\u003e":"tag:\"projecteuler\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f534ae74ec0\u003e":"tag:\"projecteuler\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42754,"difficulty_rating":"easy-medium"},{"id":60849,"difficulty_rating":"easy-medium"},{"id":2721,"difficulty_rating":"easy-medium"},{"id":60837,"difficulty_rating":"easy-medium"},{"id":42913,"difficulty_rating":"easy-medium"},{"id":250,"difficulty_rating":"easy-medium"},{"id":240,"difficulty_rating":"easy-medium"},{"id":1084,"difficulty_rating":"easy-medium"},{"id":1106,"difficulty_rating":"easy-medium"},{"id":230,"difficulty_rating":"easy-medium"},{"id":42394,"difficulty_rating":"easy-medium"},{"id":1082,"difficulty_rating":"easy-medium"},{"id":42937,"difficulty_rating":"easy-medium"},{"id":42935,"difficulty_rating":"medium"},{"id":2664,"difficulty_rating":"medium"},{"id":241,"difficulty_rating":"medium"},{"id":239,"difficulty_rating":"medium"},{"id":1190,"difficulty_rating":"medium"},{"id":44732,"difficulty_rating":"medium"},{"id":232,"difficulty_rating":"medium"},{"id":249,"difficulty_rating":"medium"},{"id":246,"difficulty_rating":"medium"},{"id":234,"difficulty_rating":"medium"},{"id":2606,"difficulty_rating":"medium"},{"id":42938,"difficulty_rating":"medium"},{"id":235,"difficulty_rating":"medium"},{"id":1095,"difficulty_rating":"medium"},{"id":44316,"difficulty_rating":"medium"},{"id":42936,"difficulty_rating":"medium"},{"id":44793,"difficulty_rating":"medium-hard"},{"id":1103,"difficulty_rating":"medium-hard"},{"id":1891,"difficulty_rating":"medium-hard"},{"id":52532,"difficulty_rating":"medium-hard"},{"id":1215,"difficulty_rating":"medium-hard"},{"id":45429,"difficulty_rating":"medium-hard"},{"id":44448,"difficulty_rating":"hard"},{"id":53965,"difficulty_rating":"hard"}]}}