{"group":{"group":{"id":50,"name":"Project Euler II","lockable":false,"created_at":"2018-08-21T18:19:56.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"More problems inspired by Project Euler.","is_default":false,"created_by":26769,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":37,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":448,"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":"{\"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\u003eMore problems inspired by Project Euler.\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\"}]}","description_html":"\u003cdiv style = \"text-align: start; line-height: normal; 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 solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; perspective-origin: 289.5px 10.5px; transform-origin: 289.5px 10.5px; \"\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; white-space: pre-wrap; perspective-origin: 266.5px 10.5px; transform-origin: 266.5px 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMore problems inspired by Project Euler.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2019-06-10T20:18:26.000Z"},"current_player":null},"problems":[{"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":2337,"title":"Sum of big primes without primes","description":"Inspired by Project Euler n°10 (I am quite obviously a fan).\r\nWith problem n°250 by Doug, you can find some global methods to compute the sum of all the primes below the input n.\r\nFor example, the sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\r\nBut how to proceed (in time) with big number and WITHOUT the primes function ?\r\nHINTS: sum(primes(n)) is possible here but why miss the wonderfull Sieve of Eratosthenes ?\r\nhttp://en.wikipedia.org/wiki/Sieve_of_Eratosthenes","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: 171px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 85.5px; transform-origin: 407px 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: 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: 183px 8px; transform-origin: 183px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eInspired by Project Euler n°10 (I am quite obviously a fan).\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: 376px 8px; transform-origin: 376px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWith problem n°250 by Doug, you can find some global methods to compute the sum of all the primes below the input n.\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: 208px 8px; transform-origin: 208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, the sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\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: 255.5px 8px; transform-origin: 255.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBut how to proceed (in time) with big number and WITHOUT the primes function ?\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: 288.5px 8px; transform-origin: 288.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHINTS: sum(primes(n)) is possible here but why miss the wonderfull Sieve of Eratosthenes ?\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ehttp://en.wikipedia.org/wiki/Sieve_of_Eratosthenes\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = big_euler10(n)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('big_euler10.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || ...\r\n          contains(filetext, 'primes'); \r\nassert(~illegal)\r\n\r\n%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 10;\r\ny_correct = 17;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 1060;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 1000;\r\ny_correct = 76127;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 10000;\r\ny_correct = 5736396;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 100000;\r\ny_correct = 454396537;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 1000000;\r\ny_correct = 37550402023;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 1000000-100;\r\ny_correct = 37542402433;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%%\r\nx = 2000000-1000;\r\ny_correct = 142781862782;\r\nassert(isequal(big_euler10(x),y_correct))\r\n%% Solution of Project Euler 10 with n=2000000\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":5390,"edited_by":223089,"edited_at":"2023-06-05T10:25:19.000Z","deleted_by":null,"deleted_at":null,"solvers_count":239,"test_suite_updated_at":"2023-06-05T10:25:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-05-27T21:25:58.000Z","updated_at":"2026-03-29T22:02:38.000Z","published_at":"2014-05-27T21:51:18.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\u003eInspired by Project Euler n°10 (I am quite obviously a fan).\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\u003eWith problem n°250 by Doug, you can find some global methods to compute the sum of all the primes below 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\u003eFor example, the sum of the primes below 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\u003eBut how to proceed (in time) with big number and WITHOUT the primes function ?\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\u003eHINTS: sum(primes(n)) is possible here but why miss the wonderfull Sieve of Eratosthenes ?\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Sieve_of_Eratosthenes\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":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":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":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":44733,"title":"Large Sum (inspired by Project Euler 13)","description":"Your function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will be very large. The function must return the first eight digits of the sum of all the numbers as an integer.","description_html":"\u003cp\u003eYour function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will be very large. The function must return the first eight digits of the sum of all the numbers as an integer.\u003c/p\u003e","function_template":"function y = sum_large_n(c)\r\n y = sum(c);\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp', 'regexpi'},'FileName','sum_large_n.m')\r\n\r\n%%\r\nfiletext = fileread('sum_large_n.m');\r\nassert(isempty(strfind(filetext, 'java')),'java forbidden')\r\n\r\n%%\r\nc = {'12345678'};\r\nassert(isequal(sum_large_n(c),12345678))\r\n\r\n%%\r\nc = {'1234567890','9'};\r\nassert(isequal(sum_large_n(c),12345678))\r\n\r\n%%\r\nc = {'11223344','11223344'};\r\nassert(isequal(sum_large_n(c),22446688))\r\n\r\n%%\r\nc = {'1000000000','99','1'};\r\nassert(isequal(sum_large_n(c),10000001))\r\n\r\n%%\r\nc = {'100000000000000000000000000000000000000000','9999','9999','9999'};\r\nassert(isequal(sum_large_n(c),10000000))\r\n\r\n%%\r\nc = {'15934672','34627951','63195472','98416599','13652729','32167958','32368197'};\r\nassert(isequal(sum_large_n(c),29036357))\r\n\r\n%%\r\nc = {'65281492489834938429841293654542962328498421794427152995741538492824984','37812654179574152749152791584279521794471529572419527149652719458479854'};\r\nassert(isequal(sum_large_n(c),10309414))\r\n\r\n%%\r\nc = {'64854985662353823234394299423463672233451381975635955356744918981347271658799472175596688623815297551711518872659685481224881454663419214254991734594937657622921687245928642452634633638974619883614322', ...\r\n     '41657761135648795316841323455859693737713378487164915457385127524627393723167546676927326556746488366583329656565759211145476799227155854775426317347474774134328484748742893748728958622478835122752521', ...\r\n     '86976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189'};\r\nassert(isequal(sum_large_n(c),19348963))\r\n\r\n%%\r\nc = {'64854985662353823234394299423463672233451381975635955356744918981347271658799472175596688623815297551711518872659685481224881454663419214254991734594937657622921687245928642452634633638974619883614322', ...\r\n     '41657761135648795316841323455859693737713378487164915457385127524627393723167546676927326556746488366583329656565759211145476799227155854775426317347474774134328484748742893748728958622478835122752521', ...\r\n     '86976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189', ...\r\n     '72712636767379814476842172453652813351412836947746192385743174561377221146751622122233239762219763269234174946242784735864354467442133699537777175218226957295718725354423196929864373177764483888569418', ...\r\n     '64936642142748762939341621746461987846653353891518919178589622211694499797463375467656517949485422378718971477337563287912152911673242596141549859249976492768478359536474579387914633766614537837282648', ...\r\n     '55845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396', ...\r\n     '56852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122', ...\r\n     '74731539941789156776746219369224943244241616835615628985373966213897736849135176588835711359733896318691638244872327622595118548457836916433792829847584169247197625598974953476799592136595457182534623', ...\r\n     '22385429486488589446974795531215196112521748441116388952357456927648426638992316148542492581793279692744286781957782569896681841722633444622137377883353886373545979351768994152231775485994546872814784', ...\r\n     '79323439162825941244397949168397868333683486928735468188446777449683669155198482635823548923749968469697568249469961166976539517519332336133847682981536366651541555878125985417524274918656718132916668'};\r\nassert(isequal(sum_large_n(c),62027779))\r\n\r\n%%\r\nc = {'6475498566235382323439429942346367223345138697688918695583596876361667997696128582561641522222163575552588326642911226619771899885242193335618684512639295793457812415422975917762632291314192135193313157611795184371176577837641846712559871118981975635955356744918981347271658799472175596688623815297551711518872659685481224881454663419214254991734594937657622921687245928642452634633638974619883614322', ...\r\n     '2165776113564879531684132345585969373771337848716491545738512752462739372316754667692732655674648836658332965656575921114547679922715585477542793234391628259412443979491683978683336834869287354681884467774496836691551984826358235489237499684696975682494699611669765395175193323361338476829815363666515415558781259854175242749186567181329166686317347474774134328484748742893748728958622478835122752521', ...\r\n     '8697688918695583596876361667997696128582561641522222163575552588326642911226619771899885242193335618684512635685254967745626748745477479871465138181752627611214865819152617899531567165296496585574368424348444231433425738141212232269925453142194971776527349843699638491572423451533329987242137654357767625412292957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189', ...\r\n     '7271263676737981447684217245365281335141283694774619238574317456137722114675162212223323976221976326923417494624278473586435446744213369953777717521822695729571872535442319692986437317776445584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239683888569418', ...\r\n     '6293664214274876293934162174646198784665335389151891917858962221169449979746337546765651794948542237871897147733756328791215291167324259614154985568525496774562674874547747987146513818175262761121486581915261789953156716529649658557436842434844423143342573814121223226992545314219497177652734984369963849157242345153332998724213765435776762541229249976492768478359536474579387914633766614537837282648', ...\r\n     '5584591927674681196342333231512689695428194147857913127786198359784563737624373984578663575632548872163993896895761565857499845388949884689726131512689695479857499845388966295297837624373984578632571235635787174428334456445697482112331512689695388949884689761479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239687232762259511854845785534518148468892396', ...\r\n     '5685254967745626748745477479871465138181752627611214865819152617899531567165296496585574368424348444231433425738793234391628259412443979491683978683336834869287354681884467774496836691551984826358235489237499684696975682494699611669765395175193323361338476829815363666515415558781259854175242749186567181329166681412122322699254531421949717765273498436996384915724234515333299872421376543577676254122', ...\r\n     '7873153994178915677674621936922494324424161683561562898537396621389773684913517658883571135973389631869163824455845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396872327622595118548457836916433792829847584169247197625598974953476799592136595457182534623', ...\r\n     '2238542948648858944697479553121519611252174844111638895235745692764842663899231614854249258179327969274428678195778256989668184172263355845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396444622137377883353886373545979351768994152231775485994546872814784', ...\r\n     '7392343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587815584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239625985417524274918656718132916668'};\r\nassert(isequal(sum_large_n(c),59677779))\r\n\r\n%%\r\nc = {'69754985662353823234394299423463672233451386976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189819756359553567449189813472716587994721755966886238152975517115188726596854812248814546634192142549917345949376576229223854294864885894469747955312151961125217484411163889523574569276484266389923161485424925817932796927442867819577825698966818417226335584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239644462213737788335388637354597935176899415223177548599454687281478421687245928642452634633638974619883614322', ...\r\n     '51057761135648795316841323455859693737713378487164915457385127524627393723167546676927326556746488366583329656565759211145476799227155854775427932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291686976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783764184671255987111896686317347474774134328484748742893748728958622478835122752521', ...\r\n     '76976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783767392343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587815584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239625985417524274918656718132916668418467125598711189', ...\r\n     '72712636767379814476842172453652813351412836947746192385743174561377221146751622122233239762219763269234174946242784735864354467442133699537777175218226957295718725354423196929864373177764455845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112331512689695534586976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783764184671255987111891814846889239683888569418', ...\r\n     '62936642142748762939341621746461987846653353891518919178589622211694499797463375467656517949485422378718971477337563287912152911673242596141549855685254967745626748745477479871465138181752627611214865819152617899531567165296496585574368424348444231433425738141212232269925453142194971776527349843699638491572423451533568525496774562674874547747987146513818175262761121486581915261789953156716529649658557436842434844423143342573879323439162825941244397949168397868333683486928735468188446777449683669155198482635823548923749968469697568249469961166976539517519332336133847682981536366651541555878125985417524274918656718132916668141212232269925453142194971776527349843699638491572423451533329987242137654357767625412232998724213765435776762541229249976492768478359536474579387914633766614537837282648', ...\r\n     '55845919276746811963423332315126896954281941478579131277861983597845637376243739845786635756325488721639938968957615658574998453889498846897261315126896954798574998453889662952978376243739845786325712356357871744283344564456974821123315126896953889498846897614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396872327622595118548457855345181484688956852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435776762541222396', ...\r\n     '50852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435755845919276746811963423332315126896954281941478579131277861983597845637376243739845786635756325488721639938968957615658574998453889498846897261315126896954798574998453889662952978376243739845786325712356357871744283344564456974821123315126896953889498846897614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396872327622595118548457855345181484688923967676254122', ...\r\n     '18731539941789156776746219369224943244241616835615628985373966213897736849135176588835711359733896318691638244558459192767468119634233324281941478579131277861983597845637563254887216399389689576156549884689726147985749984538896629529783762437398457866357871744283344564456974821123315126896955345181484688923968726293664214274876293934162174646198784665335389151891917858962221169449979746337546765651794948542237871897147733756328791215291167324259614154985568525496774562674874547747987146513818175262761121486581915261789953156716529649658557436842434844423143342573814121223226992545314219497177652734984369963849157242345153332998724213765435776762541229249976492768478359536474579387914633766614537837282648327622595118548457836916433792829847584169247197625598974953476799592136595457182534623', ...\r\n     '24185429486488589446974795531215196112521748441116388952357456927648426638992316148542492581793279692744286781957782569896681841722633558459192767468119634233324281941478579131277861983597845637563254887216399389689576156549884689726147985749984538896629529783762437398457866357871744283344564456974821123315126896955345181484688923964446221373778833538863735464754985662353823234394299423463672233451386976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189819756359553567449189813472716587994721755966886238152975517115188726596854812248814546634192142549917345949376576229216872459286424526346336389746198836143225979351768994152231775485994546872814784', ...\r\n     '73923439162825941244397949168397868333683486928735468188446777449683669155198482635823548923749968469697568249469961166976539517519332336133847682981536366651541555878155845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435776762541223151268969553451814846889239625985417524274918656718132916668'};\r\nassert(isequal(sum_large_n(c),55697779))\r\n\r\n%%\r\nc = {'169754985662353823234394299423463672233451386976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189819756359553567449189813472716587994721755966886238152975517115188726596854812248814546634192142549917345949376576229223854294864885894469747955312151961125217484411163889523574569276484266389923161485424925817932796927442867819577825698966818417226335584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239644462213737788335388637354597935176899415223177548599454687281478421687245928642452634633638974619883614322', ...\r\n     '51057761135648795316841323455859693737713378487164915457385127524627393723167546676927326556746488366583329656565759211145476799227155854775427932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291686976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783764184671255987111896686317347474774134328484748742893748728958622478835122752521', ...\r\n     '476976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783767392343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587815584591927674681196342333242819414785791312778619835978456375632548872163993896895761565498846897261479857499845388966295297837624373984578663578717442833445644569748211233151268969553451814846889239625985417524274918656718132916668418467125598711189', ...\r\n     '72712636767379814476842172453652813351412836947746192385743174561377221146751622122233239762219763269234174946242784735864354467442133699537777175218226957295718725354423196929864373177764455845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112331512689695534586976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257381412122322699254531421949717765273498436996384915724234515333299872421376543577676254122929579345781241542297591776263229131419213519331315761179518437117657783764184671255987111891814846889239683888569418', ...\r\n     '562936642142748762939341621746461987846653353891518919178589622211694499797463375467656517949485422378718971477337563287912152911673242596141549855685254967745626748745477479871465138181752627611214865819152617899531567165296496585574368424348444231433425738141212232269925453142194971776527349843699638491572423451533568525496774562674874547747987146513818175262761121486581915261789953156716529649658557436842434844423143342573879323439162825941244397949168397868333683486928735468188446777449683669155198482635823548923749968469697568249469961166976539517519332336133847682981536366651541555878125985417524274918656718132916668141212232269925453142194971776527349843699638491572423451533329987242137654357767625412232998724213765435776762541229249976492768478359536474579387914633766614537837282648', ...\r\n     '755845919276746811963423332315126896954281941478579131277861983597845637376243739845786635756325488721639938968957615658574998453889498846897261315126896954798574998453889662952978376243739845786325712356357871744283344564456974821123315126896953889498846897614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396872327622595118548457855345181484688956852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435776762541222396', ...\r\n     '50852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435755845919276746811963423332315126896954281941478579131277861983597845637376243739845786635756325488721639938968957615658574998453889498846897261315126896954798574998453889662952978376243739845786325712356357871744283344564456974821123315126896953889498846897614798574998453889662952978376243739845786635787174428334456445697482112331512689695534518148468892396872327622595118548457855345181484688923967676254122', ...\r\n     '8731539941789156776746219369224943244241616835615628985373966213897736849135176588835711359733896318691638244558459192767468119634233324281941478579131277861983597845637563254887216399389689576156549884689726147985749984538896629529783762437398457866357871744283344564456974821123315126896955345181484688923968726293664214274876293934162174646198784665335389151891917858962221169449979746337546765651794948542237871897147733756328791215291167324259614154985568525496774562674874547747987146513818175262761121486581915261789953156716529649658557436842434844423143342573814121223226992545314219497177652734984369963849157242345153332998724213765435776762541229249976492768478359536474579387914633766614537837282648327622595118548457836916433792829847584169247197625598974953476799592136595457182534623', ...\r\n     '24185429486488589446974795531215196112521748441116388952357456927648426638992316148542492581793279692744286781957782569896681841722633558459192767468119634233324281941478579131277861983597845637563254887216399389689576156549884689726147985749984538896629529783762437398457866357871744283344564456974821123315126896955345181484688923964446221373778833538863735464754985662353823234394299423463672233451386976889186955835968763616679976961285825616415222221635755525883266429112266197718998852421933356186845126392957934578124154229759177626322913141921351933131576117951843711765778376418467125598711189819756359553567449189813472716587994721755966886238152975517115188726596854812248814546634192142549917345949376576229216872459286424526346336389746198836143225979351768994152231775485994546872814784', ...\r\n     '973923439162825941244397949168397868333683486928735468188446777449683669155198482635823548923749968469697568249469961166976539517519332336133847682981536366651541555878155845919276746811963423332428194147857913127786198359784563756325488721639938968957615654988468972614798574998453889662952978376243739845786635787174428334456445697482112356852549677456267487454774798714651381817526276112148658191526178995315671652964965855743684243484442314334257387932343916282594124439794916839786833368348692873546818844677744968366915519848263582354892374996846969756824946996116697653951751933233613384768298153636665154155587812598541752427491865671813291666814121223226992545314219497177652734984369963849157242345153332998724213765435776762541223151268969553451814846889239625985417524274918656718132916668'};\r\nassert(isequal(sum_large_n(c),31469777))\r\n\r\n%%\r\nc = {'16975498566235382323439429942346367223345138697688', ...\r\n     '91869558359687636166799769612858256164152222216357', ...\r\n     '55525883266429112266197718998852421933356186845126', ...\r\n     '39295793457812415422975917762632291314192135193313', ...\r\n     '15761179518437117657783764184671255987111898197563', ...\r\n     '59553567449189813472716587994721755966886238152975', ...\r\n     '51711518872659685481224881454663419214254991734594', ...\r\n     '93765762292238542948648858944697479553121519611252', ...\r\n     '17484411163889523574569276484266389923161485424925', ...\r\n     '81793279692744286781957782569896681841722633558459', ...\r\n     '19276746811963423332428194147857913127786198359784', ...\r\n     '56375632548872163993896895761565498846897261479857', ...\r\n     '49984538896629529783762437398457866357871744283344', ...\r\n     '56445697482112331512689695534518148468892396444622', ...\r\n     '13737788335388637354597935176899415223177548599454', ...\r\n     '68728147842168724592864245263463363897461988361432', ...\r\n     '51057761135648795316841323455859693737713378487164', ...\r\n     '91545738512752462739372316754667692732655674648836', ...\r\n     '65833296565657592111454767992271558547754279323439', ...\r\n     '16282594124439794916839786833368348692873546818844', ...\r\n     '67774496836691551984826358235489237499684696975682', ...\r\n     '49469961166976539517519332336133847682981536366651', ...\r\n     '54155587812598541752427491865671813291686976889186', ...\r\n     '95583596876361667997696128582561641522222163575552', ...\r\n     '58832664291122661977189988524219333561868451263568', ...\r\n     '52549677456267487454774798714651381817526276112148', ...\r\n     '65819152617899531567165296496585574368424348444231', ...\r\n     '43342573814121223226992545314219497177652734984369', ...\r\n     '96384915724234515333299872421376543577676254122929', ...\r\n     '57934578124154229759177626322913141921351933131576', ...\r\n     '11795184371176577837641846712559871118966863173474', ...\r\n     '74774134328484748742893748728958622478835122752521', ...\r\n     '47697688918695583596876361667997696128582561641522', ...\r\n     '22216357555258832664291122661977189988524219333561', ...\r\n     '86845126356852549677456267487454774798714651381817', ...\r\n     '52627611214865819152617899531567165296496585574368', ...\r\n     '42434844423143342573814121223226992545314219497177', ...\r\n     '65273498436996384915724234515333299872421376543577', ...\r\n     '67625412292957934578124154229759177626322913141921', ...\r\n     '35193313157611795184371176577837673923439162825941', ...\r\n     '24439794916839786833368348692873546818844677744968', ...\r\n     '36691551984826358235489237499684696975682494699611', ...\r\n     '66976539517519332336133847682981536366651541555878', ...\r\n     '15584591927674681196342333242819414785791312778619', ...\r\n     '83597845637563254887216399389689576156549884689726', ...\r\n     '14798574998453889662952978376243739845786635787174', ...\r\n     '42833445644569748211233151268969553451814846889239', ...\r\n     '62598541752427491865671813291666841846712559871189', ...\r\n     '72712636767379814476842172453652813351412836947746', ...\r\n     '19238574317456137722114675162212223323976221976326', ...\r\n     '92341749462427847358643544674421336995377771752182', ...\r\n     '26957295718725354423196929864373177764455845919276', ...\r\n     '74681196342333242819414785791312778619835978456375', ...\r\n     '63254887216399389689576156549884689726147985749984', ...\r\n     '53889662952978376243739845786635787174428334456445', ...\r\n     '69748211233151268969553458697688918695583596876361', ...\r\n     '66799769612858256164152222216357555258832664291122', ...\r\n     '66197718998852421933356186845126356852549677456267', ...\r\n     '48745477479871465138181752627611214865819152617899', ...\r\n     '53156716529649658557436842434844423143342573814121', ...\r\n     '22322699254531421949717765273498436996384915724234', ...\r\n     '51533329987242137654357767625412292957934578124154', ...\r\n     '22975917762632291314192135193313157611795184371176', ...\r\n     '57783764184671255987111891814846889239683888569418', ...\r\n     '56293664214274876293934162174646198784665335389151', ...\r\n     '89191785896222116944997974633754676565179494854223', ...\r\n     '78718971477337563287912152911673242596141549855685', ...\r\n     '25496774562674874547747987146513818175262761121486', ...\r\n     '58191526178995315671652964965855743684243484442314', ...\r\n     '33425738141212232269925453142194971776527349843699', ...\r\n     '63849157242345153356852549677456267487454774798714', ...\r\n     '65138181752627611214865819152617899531567165296496', ...\r\n     '58557436842434844423143342573879323439162825941244', ...\r\n     '39794916839786833368348692873546818844677744968366', ...\r\n     '91551984826358235489237499684696975682494699611669', ...\r\n     '76539517519332336133847682981536366651541555878125', ...\r\n     '98541752427491865671813291666814121223226992545314', ...\r\n     '21949717765273498436996384915724234515333299872421', ...\r\n     '37654357767625412232998724213765435776762541229249', ...\r\n     '97649276847835953647457987914633766614537837282648', ...\r\n     '75584591927674681196342333231512689695428194147857', ...\r\n     '91312778619835978456373762437398457866357563254887', ...\r\n     '21639938968957615658574998453889498846897261315126', ...\r\n     '89695479857499845388966295297837624373984578632571', ...\r\n     '23563578717442833445644569748211233151268969538894', ...\r\n     '98846897614798574998453889662952978376243739845786', ...\r\n     '63578717442833445644569748211233151268969553451814', ...\r\n     '84688923968723276225951185484578553451814846889568', ...\r\n     '52549677456267487454774798714651381817526276112148', ...\r\n     '65819152617899531567165296496585574368424348444231', ...\r\n     '43342573879323439162825941244397949168397868333683', ...\r\n     '48692873546818844677744968366915519848263582354892', ...\r\n     '37499684696975682494699611669765395175193323361338', ...\r\n     '47682981536366651541555878125985417524274918656718', ...\r\n     '13291666814121223226992545314219497177652734984369', ...\r\n     '96384915724234515333299872421376543577676541222396', ...\r\n     '50852549677456267487454774798714651381817526276112', ...\r\n     '14865819152617899531567165296496585574368424348444', ...\r\n     '23143342573879323439162825941244397949168397868333', ...\r\n     '68348692873546818844677744968366915519848263582354', ...\r\n     '89237499684696975682494699611669765395175193323361', ...\r\n     '33847682981536366651541555878125985417524274918656', ...\r\n     '71813291666814121223226992545314219497177652734984', ...\r\n     '36996384915724234515333299872421376543575584591927', ...\r\n     '67468119634233323151268969542819414785791312778619', ...\r\n     '83597845637376243739845786635756325488721639938968', ...\r\n     '95761565857499845388949884689726131512689695479857', ...\r\n     '49984538896629529783762437398457863257123563578717', ...\r\n     '44283344564456974821123315126896953889498846897614', ...\r\n     '79857499845388966295297837624373984578663578717442', ...\r\n     '83344564456974821123315126896955345181484688923968', ...\r\n     '72327622595118548457855345181484688923967676254122', ...\r\n     '87315399417891567767462193692249432442416168356156', ...\r\n     '28985373966213897736849135176588835711359733896318', ...\r\n     '69163824455845919276746811963423332428194147857913', ...\r\n     '12778619835978456375632548872163993896895761565498', ...\r\n     '84689726147985749984538896629529783762437398457866', ...\r\n     '35787174428334456445697482112331512689695534518148', ...\r\n     '46889239687262936642142748762939341621746461987846', ...\r\n     '65335389151891917858962221169449979746337546765651', ...\r\n     '79494854223787189714773375632879121529116732425961', ...\r\n     '41549855685254967745626748745477479871465138181752', ...\r\n     '62761121486581915261789953156716529649658557436842', ...\r\n     '43484442314334257381412122322699254531421949717765', ...\r\n     '27349843699638491572423451533329987242137654357767', ...\r\n     '62541229249976492768478359536474579387914633766614', ...\r\n     '53783728264832762259511854845783691643379282984758', ...\r\n     '41692471976255989749534767995921365954570182534623', ...\r\n     '24185429486488589446974795531215196112521748441116', ...\r\n     '38895235745692764842663899231614854249258179327969', ...\r\n     '27442867819577825698966818417226335584591927674681', ...\r\n     '19634233324281941478579131277861983597845637563254', ...\r\n     '88721639938968957615654988468972614798574998453889', ...\r\n     '66295297837624373984578663578717442833445644569748', ...\r\n     '21123315126896955345181484688923964446221373778833', ...\r\n     '53886373546475498566235382323439429942346367223345', ...\r\n     '13869768891869558359687636166799769612858256164152', ...\r\n     '22221635755525883266429112266197718998852421933356', ...\r\n     '18684512639295793457812415422975917762632291314192', ...\r\n     '13519331315761179518437117657783764184671255987111', ...\r\n     '89819756359553567449189813472716587994721755966886', ...\r\n     '23815297551711518872659685481224881454663419214254', ...\r\n     '99173459493765762292168724592864245263463363897461', ...\r\n     '98836143225979351768994152231775485994546872814784', ...\r\n     '97392343916282594124439794916839786833368348692873', ...\r\n     '54681884467774496836691551984826358235489237499684', ...\r\n     '69697568249469961166976539517519332336133847682981', ...\r\n     '53636665154155587815584591927674681196342333242819', ...\r\n     '41478579131277861983597845637563254887216399389689', ...\r\n     '57615654988468972614798574998453889662952978376243', ...\r\n     '73984578663578717442833445644569748211235685254967', ...\r\n     '74562674874547747987146513818175262761121486581915', ...\r\n     '26178995315671652964965855743684243484442314334257', ...\r\n     '38793234391628259412443979491683978683336834869287', ...\r\n     '35468188446777449683669155198482635823548923749968', ...\r\n     '46969756824946996116697653951751933233613384768298', ...\r\n     '15363666515415558781259854175242749186567181329166', ...\r\n     '68141212232269925453142194971776527349843699638491', ...\r\n     '57242345153332998724213765435776762541223151268969', ...\r\n     '55345181484688923962585417524274918656718132916668'};\r\nassert(isequal(sum_large_n(c),87139239))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114,"test_suite_updated_at":"2018-08-20T17:27:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-08-20T17:18:24.000Z","updated_at":"2026-01-05T00:23:53.000Z","published_at":"2018-08-20T17:18: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\",\"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\u003eYour function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will be very large. The function must return the first eight digits of the sum of all the numbers as an 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":42673,"title":"Longest Collatz Sequence","description":"Inspired by Projet Euler n°14.\r\n\r\nThe Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of positive integers:\r\n\r\n* n → n/2 (n is even)\r\n* n → 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\n\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 number given in input, produces the longest chain?\r\n\r\nBe smart because numbers can be big...\r\n","description_html":"\u003cp\u003eInspired by Projet Euler n°14.\u003c/p\u003e\u003cp\u003eThe Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of positive integers:\u003c/p\u003e\u003cul\u003e\u003cli\u003en → n/2 (n is even)\u003c/li\u003e\u003cli\u003en → 3n + 1 (n is odd)\u003c/li\u003e\u003c/ul\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\u003c/p\u003e\u003cp\u003eIt 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 number given in input, produces the longest chain?\u003c/p\u003e\u003cp\u003eBe smart because numbers can be big...\u003c/p\u003e","function_template":"function y = euler14(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\nassert(isequal(euler14(x),9))\r\n%%\r\nx = 100;\r\nassert(isequal(euler14(x),97))\r\n%%\r\nx = 96;\r\nassert(isequal(euler14(x),73))\r\n%%\r\nx = 1000;\r\nassert(isequal(euler14(x),871))\r\n%%\r\nx = 870;\r\nassert(isequal(euler14(x),703))\r\n%%\r\nassert(isequal(euler14(871),871))\r\n%%\r\nx = 77030;\r\nassert(isequal(euler14(x),52527))\r\n%%\r\nx = 77031;\r\nassert(isequal(euler14(x),77031))\r\n%%\r\nassert(isequal(euler14(500000),410011))\r\n%%\r\nz = 900000;\r\ny_correct=837799;\r\nassert(isequal(euler14(z),y_correct))\r\n%% Projet Euler n°14 solution with x=1000000\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":1,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":137,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-28T10:14:25.000Z","updated_at":"2026-01-05T00:24:55.000Z","published_at":"2015-10-28T10:15: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\u003eInspired by Projet Euler n°14.\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 Collatz iterative sequence (See Cody problem n° 2103 and 211) 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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en → n/2 (n is even)\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:t\u003en → 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\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\u003eIt 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 number given in input, 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\u003eBe smart because numbers can be big...\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":252,"title":"Project Euler: Problem 16, Sums of Digits of Powers of Two","description":"2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.\r\n\r\nWhat is the sum of the digits of the number 2^N?\r\n\r\nThanks to \u003chttp://projecteuler.net/problem=16 Project Euler Problem 16\u003e.","description_html":"\u003cp\u003e2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.\u003c/p\u003e\u003cp\u003eWhat is the sum of the digits of the number 2^N?\u003c/p\u003e\u003cp\u003eThanks to \u003ca href=\"http://projecteuler.net/problem=16\"\u003eProject Euler Problem 16\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = pow2_sumofdigits(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 0;\r\ny_correct = 1;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 2;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))\r\n\r\n%%\r\nx = 15;\r\ny_correct = 26;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))\r\n\r\n%%\r\nx = 345;\r\ny_correct = 521;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))\r\n\r\n%%\r\nx = 999;\r\ny_correct = 1367;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))\r\n\r\n%%\r\nx = 2000;\r\ny_correct = 2704;\r\nassert(isequal(pow2_sumofdigits(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":178,"test_suite_updated_at":"2012-02-04T07:44:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-03T20:15:41.000Z","updated_at":"2026-01-15T22:21:41.000Z","published_at":"2012-02-04T07:53:38.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\u003e2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.\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 sum of the digits of the number 2^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\u003eThanks 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=16\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 16\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\"},{\"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":273,"title":"Recurring Cycle Length (Inspired by Project Euler Problem 26)","description":"Preface: This problem is inspired by Project Euler Problem 26 and uses text from that question to explain what a recurring cycle is.\r\nDescription\r\nA unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:\r\n1/2  =   0.5\r\n1/3  =  0.(3)\r\n1/4  =   0.25\r\n1/5  =   0.2\r\n1/6  =   0.1(6)\r\n1/7  =   0.(142857)\r\n1/8  =   0.125\r\n1/9  =   0.(1)\r\n1/10 =   0.1\r\nWhere 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle.\r\nCreate a function that can determine the length of the recurring cycle of 1/d given d.","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: 377.9px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 188.95px; transform-origin: 407px 188.95px; 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: 113px 8px; transform-origin: 113px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePreface: This problem is inspired by\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 26\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: 190px 8px; transform-origin: 190px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and uses text from that question to explain what a recurring cycle 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; 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: 40.5px 8px; transform-origin: 40.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eDescription\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: 382px 8px; transform-origin: 382px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 183.9px; 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; perspective-origin: 404px 91.95px; transform-origin: 404px 91.95px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 48px 8.5px; tab-size: 4; transform-origin: 48px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/2  =   0.5\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 52px 8.5px; tab-size: 4; transform-origin: 52px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/3  =  0.(3)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 52px 8.5px; tab-size: 4; transform-origin: 52px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/4  =   0.25\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 48px 8.5px; tab-size: 4; transform-origin: 48px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/5  =   0.2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 60px 8.5px; tab-size: 4; transform-origin: 60px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/6  =   0.1(6)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 76px 8.5px; tab-size: 4; transform-origin: 76px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/7  =   0.(142857)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/8  =   0.125\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/9  =   0.(1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 48px 8.5px; tab-size: 4; transform-origin: 48px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e1/10 =   0.1\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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: 374.5px 8px; transform-origin: 374.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhere 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle.\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: 264.5px 8px; transform-origin: 264.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCreate a function that can determine the length of the recurring cycle of 1/d given d.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function L = recurring_cycle(d)\r\n    L = d;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 3;\r\ny_correct = 1;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 4;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 6;\r\ny_correct = 1;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = 6;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 8;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 9;\r\ny_correct = 1;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 17;\r\ny_correct = 16;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 19;\r\ny_correct = 18;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 29;\r\ny_correct = 28;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 19;\r\ny_correct = 18;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 109;\r\ny_correct = 108;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 197;\r\ny_correct = 98;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 223;\r\ny_correct = 222;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 2^randi(10);\r\ny_correct = 0;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 1977;\r\ny_correct = 658;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = 12345;\r\ny_correct = 822;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n\r\n%%\r\nx = randi(6)*3;\r\ny_correct = 1;\r\nassert(isequal(recurring_cycle(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":134,"edited_by":223089,"edited_at":"2023-02-02T10:48:13.000Z","deleted_by":null,"deleted_at":null,"solvers_count":161,"test_suite_updated_at":"2023-02-02T10:48:13.000Z","rescore_all_solutions":false,"group_id":44,"created_at":"2012-02-06T22:59:19.000Z","updated_at":"2026-01-05T00:27:32.000Z","published_at":"2012-02-23T17:44:12.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\u003ePreface: This problem is inspired by\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 26\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and uses text from that question to explain what a recurring cycle 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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\u003eA unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:\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/2  =   0.5\\n1/3  =  0.(3)\\n1/4  =   0.25\\n1/5  =   0.2\\n1/6  =   0.1(6)\\n1/7  =   0.(142857)\\n1/8  =   0.125\\n1/9  =   0.(1)\\n1/10 =   0.1]]\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\u003eWhere 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle.\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\u003eCreate a function that can determine the length of the recurring cycle of 1/d given d.\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":2340,"title":"Numbers spiral diagonals (Part 1)","description":"Inspired by Project Euler n°28 et 58.\r\n\r\nA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\r\n\r\nFor exemple with n=5, the spiral matrix is :\r\n\r\n                       21 22 23 24 25\r\n                       20  7  8  9 10\r\n                       19  6  1  2 11\r\n                       18  5  4  3 12\r\n                       17 16 15 14 13\r\n\r\nIn this example, the sum of the numbers on the diagonals is 101.\r\n\r\nWhat is the sum of the numbers on the diagonals in any n by n spiral (n always odd) ?\r\n\r\nHINTS: You want the diagonals, not the whole matrix.","description_html":"\u003cp\u003eInspired by Project Euler n°28 et 58.\u003c/p\u003e\u003cp\u003eA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\u003c/p\u003e\u003cp\u003eFor exemple with n=5, the spiral matrix is :\u003c/p\u003e\u003cpre\u003e                       21 22 23 24 25\r\n                       20  7  8  9 10\r\n                       19  6  1  2 11\r\n                       18  5  4  3 12\r\n                       17 16 15 14 13\u003c/pre\u003e\u003cp\u003eIn this example, the sum of the numbers on the diagonals is 101.\u003c/p\u003e\u003cp\u003eWhat is the sum of the numbers on the diagonals in any n by n spiral (n always odd) ?\u003c/p\u003e\u003cp\u003eHINTS: You want the diagonals, not the whole matrix.\u003c/p\u003e","function_template":"function y = spiral_nb(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = 25;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 5;\r\ny_correct = 101;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 9;\r\ny_correct = 537;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 501;\r\ny_correct = 83960501;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 5001;\r\ny_correct = 83395855001;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 10001;\r\ny_correct = 666916710001;\r\nassert(isequal(spiral_nb(x),y_correct))\r\n%%\r\nx = 10003;\r\ny_correct = 667316890025;\r\nassert(isequal(spiral_nb(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":296,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":31,"created_at":"2014-05-30T22:02:51.000Z","updated_at":"2026-02-01T14:00:50.000Z","published_at":"2014-05-30T22:03:01.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 Project Euler n°28 et 58.\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\u003eA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\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 exemple with n=5, the spiral matrix is :\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[                       21 22 23 24 25\\n                       20  7  8  9 10\\n                       19  6  1  2 11\\n                       18  5  4  3 12\\n                       17 16 15 14 13]]\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\u003eIn this example, the sum of the numbers on the diagonals is 101.\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 sum of the numbers on the diagonals in any n by n spiral (n always 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\u003eHINTS: You want the diagonals, not the whole matrix.\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":2342,"title":"Numbers spiral diagonals (Part 2)","description":"Inspired by Project Euler n°28 and 58.\r\nA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\r\nFor example with n=5, the spiral matrix is :\r\n                       21 22 23 24 25\r\n                       20  7  8  9 10\r\n                       19  6  1  2 11\r\n                       18  5  4  3 12\r\n                       17 16 15 14 13\r\nThe sum of the numbers on the diagonals is 101 (See problem 2340) and you have 5 primes (3, 5, 7, 13, 17) out of the 9 numbers lying along both diagonals. So the prime ratio is 5/9 ≈ 55%.\r\nWith a 7x7 spiral matrix, the ratio is 62% (8 primes out of the 13 diagonal numbers).\r\nWhat is the side length (always odd and greater than 1) of the square spiral for which the ratio of primes along both diagonals FIRST falls below p% ? (0\u003cp\u003c1)","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: 326.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 163.083px; transform-origin: 407px 163.083px; 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: 120px 8px; transform-origin: 120px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eInspired by Project Euler n°28 and 58.\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: 341px 8px; transform-origin: 341px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\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: 131.5px 8px; transform-origin: 131.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example with n=5, the spiral matrix is :\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; 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; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 148px 8.5px; tab-size: 4; transform-origin: 148px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                       21 22 23 24 25\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 148px 8.5px; tab-size: 4; transform-origin: 148px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                       20  7  8  9 10\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 148px 8.5px; tab-size: 4; transform-origin: 148px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                       19  6  1  2 11\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 148px 8.5px; tab-size: 4; transform-origin: 148px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                       18  5  4  3 12\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; 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; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 148px 8.5px; tab-size: 4; transform-origin: 148px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                       17 16 15 14 13\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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: 382.5px 8px; transform-origin: 382.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe sum of the numbers on the diagonals is 101 (See problem 2340) and you have 5 primes (3, 5, 7, 13, 17) out of the 9 numbers lying along both diagonals. So the prime ratio is 5/9 ≈ 55%.\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: 262px 8px; transform-origin: 262px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWith a 7x7 spiral matrix, the ratio is 62% (8 primes out of the 13 diagonal numbers).\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: 364.5px 8px; transform-origin: 364.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"perspective-origin: 74px 8px; transform-origin: 74px 8px; \"\u003eWhat is the side length \u003c/span\u003e\u003cspan style=\"border-block-end-style: solid; border-block-end-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; perspective-origin: 2.5px 8.5px; transform-origin: 2.5px 8.5px; \"\u003e(\u003c/span\u003e\u003cspan style=\"perspective-origin: 96px 8px; transform-origin: 96px 8px; \"\u003ealways odd and greater than 1\u003c/span\u003e\u003cspan style=\"border-block-end-style: solid; border-block-end-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; perspective-origin: 2.5px 8.5px; transform-origin: 2.5px 8.5px; \"\u003e)\u003c/span\u003e\u003cspan style=\"perspective-origin: 189.5px 8px; transform-origin: 189.5px 8px; \"\u003e of the square spiral for which the ratio of primes along both diagonals FIRST falls below p% ? (0\u0026lt;p\u0026lt;1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function res=spiral_ratio(pourcentage)\r\nres=pourcentage*2;\r\nend","test_suite":"%%\r\nx = 0.8;\r\ny_correct = 3;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.5;\r\ny_correct = 11;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.4;\r\ny_correct = 31;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.3;\r\ny_correct = 49;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.25;\r\ny_correct = 99;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.2;\r\ny_correct = 309;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.15;\r\ny_correct = 981;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.14;\r\ny_correct = 1883;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.13;\r\ny_correct = 3593;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.12;\r\ny_correct = 6523;\r\nassert(isequal(spiral_ratio(x),y_correct))\r\n%%\r\nx = 0.11;\r\ny_correct = 12201;\r\nassert(isequal(spiral_ratio(x),y_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":5,"created_by":5390,"edited_by":223089,"edited_at":"2022-09-26T17:42:20.000Z","deleted_by":null,"deleted_at":null,"solvers_count":196,"test_suite_updated_at":"2022-07-09T19:28:50.000Z","rescore_all_solutions":false,"group_id":31,"created_at":"2014-05-31T18:36:25.000Z","updated_at":"2026-03-04T11:06:42.000Z","published_at":"2014-05-31T18:53:35.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\u003eInspired by Project Euler n°28 and 58.\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\u003eA n x n spiral matrix is obtained by starting with the number 1 and moving to the right in a clockwise direction.\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=5, the spiral matrix is :\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[                       21 22 23 24 25\\n                       20  7  8  9 10\\n                       19  6  1  2 11\\n                       18  5  4  3 12\\n                       17 16 15 14 13]]\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\u003eThe sum of the numbers on the diagonals is 101 (See problem 2340) and you have 5 primes (3, 5, 7, 13, 17) out of the 9 numbers lying along both diagonals. So the prime ratio is 5/9 ≈ 55%.\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\u003eWith a 7x7 spiral matrix, the ratio is 62% (8 primes out of the 13 diagonal numbers).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat is the side length (always odd and greater than 1) of the square spiral for which the ratio of primes along both diagonals FIRST falls below p% ? (0\u0026lt;p\u0026lt;1)\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\"}]}"}],"no_progress_badge":{"id":53,"name":"Unknown","symbol":"unknown","description":"Partially completed groups","description_html":null,"image_location":"/images/responsive/supporting/matlabcentral/cody/badges/problem_groups_unknown_2.png","bonus":null,"players_count":0,"active":false,"created_by":null,"updated_by":null,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"created_at":"2018-01-10T23:20:29.000Z","updated_at":"2018-01-10T23:20:29.000Z","community_badge_id":null,"award_multiples":false}}