{"group":{"group":{"id":4567,"name":"Big Numbers","lockable":false,"created_at":"2020-08-06T10:32:46.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Learn to add, subtract, multiply and divide!!!","is_default":false,"created_by":232412,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":36,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":3650,"published":true,"community_created":true,"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\u003eLearn to add, subtract, multiply and divide!!!\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: 20.44px; 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=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 289.5px 10.5px; transform-origin: 289.5px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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: 266.5px 10.5px; text-align: left; transform-origin: 266.5px 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eLearn to add, subtract, multiply and divide!!!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2020-08-14T08:57:40.000Z"},"current_player":null},"problems":[{"id":563,"title":"How to add?","description":"* Imagine you are in 2222 Anno Domini, when everyone must learn how to add,\r\n* and competing for the highly prestigious post of,\r\n* Chief Comptroller of Dda Corporation.\r\n* You are being tested via \u003chttp://www.mathworks.com/matlabcentral/cody MATLAB Cody\u003e for addition of two positive integers X and Y,\r\n* both are fortunately in decimal system, and only a few dozen digits or less, \r\n* and delivered as ASCII strings.\r\n* Please output the result Z in similar style.\r\n* Please adopt a general strategy, as X and Y may be changed later.\r\n* Please rename the function Z = dda(X,Y).\r\n* Function Template:\r\n    \r\n  function Z = dda(X,Y)\r\n     X='98765432109876543210987654321098765432109876543210987654321'\r\n     Y='98765432109876543210987654321098765432109876543210987654321'\r\n     Z='197530864219753086421975308642197530864219753086421975308642';\r\n  end\r\n","description_html":"\u003cul\u003e\u003cli\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\u003c/li\u003e\u003cli\u003eand competing for the highly prestigious post of,\u003c/li\u003e\u003cli\u003eChief Comptroller of Dda Corporation.\u003c/li\u003e\u003cli\u003eYou are being tested via \u003ca href=\"http://www.mathworks.com/matlabcentral/cody\"\u003eMATLAB Cody\u003c/a\u003e for addition of two positive integers X and Y,\u003c/li\u003e\u003cli\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/li\u003e\u003cli\u003eand delivered as ASCII strings.\u003c/li\u003e\u003cli\u003ePlease output the result Z in similar style.\u003c/li\u003e\u003cli\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/li\u003e\u003cli\u003ePlease rename the function Z = dda(X,Y).\u003c/li\u003e\u003cli\u003eFunction Template:\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003efunction Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321'\r\n   Y='98765432109876543210987654321098765432109876543210987654321'\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n\u003c/pre\u003e","function_template":"function Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321';\r\n   Y='98765432109876543210987654321098765432109876543210987654321';\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n","test_suite":"%%\r\nX='98765432109876543210987654321098765432109876543210987654321';\r\nY='98765432109876543210987654321098765432109876543210987654321';\r\nZ='197530864219753086421975308642197530864219753086421975308642';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='6546468768680988454345';\r\nY='5757557542432424209808098908085353545657657';\r\nZ='5757557542432424209814645376854034534112002';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='122';\r\nY='323';\r\nZ='445';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='767678686868667868635435353545';\r\nY='465464643244242424249787979';\r\nZ='768144151511912111059685141524';\r\nassert(isequal(dda(X,Y),Z))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":156,"test_suite_updated_at":"2012-04-08T02:09:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-08T02:09:11.000Z","updated_at":"2026-01-14T15:36:10.000Z","published_at":"2012-04-08T02:09: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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\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\u003eand competing for the highly prestigious post of,\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\u003eChief Comptroller of Dda Corporation.\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\u003eYou are being tested via\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://www.mathworks.com/matlabcentral/cody\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Cody\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for addition of two positive integers X and Y,\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\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\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\u003eand delivered as ASCII strings.\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\u003ePlease output the result Z in similar style.\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\u003ePlease adopt a general strategy, as X and Y may be changed later.\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\u003ePlease rename the function Z = dda(X,Y).\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\u003eFunction Template:\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[function Z = dda(X,Y)\\n   X='98765432109876543210987654321098765432109876543210987654321'\\n   Y='98765432109876543210987654321098765432109876543210987654321'\\n   Z='197530864219753086421975308642197530864219753086421975308642';\\nend]]\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":564,"title":"How to subtract?","description":"*\u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn* \r\n\r\n* Imagine you need to subtract one number from another using MATLAB.\r\n* You will not be using eval for this task.\r\n* Given two ASCII strings representing two integers X and Y.\r\n* Each of them has only 12 or less ASCII characters.\r\n* Each of them represents signed integers, such as '+2345'\r\n* Please output the result of (X-Y) in a similar style.","description_html":"\u003cp\u003e\u003cb\u003e\u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn \u0026plusmn\u003c/b\u003e\u003c/p\u003e\u003cul\u003e\u003cli\u003eImagine you need to subtract one number from another using MATLAB.\u003c/li\u003e\u003cli\u003eYou will not be using eval for this task.\u003c/li\u003e\u003cli\u003eGiven two ASCII strings representing two integers X and Y.\u003c/li\u003e\u003cli\u003eEach of them has only 12 or less ASCII characters.\u003c/li\u003e\u003cli\u003eEach of them represents signed integers, such as '+2345'\u003c/li\u003e\u003cli\u003ePlease output the result of (X-Y) in a similar style.\u003c/li\u003e\u003c/ul\u003e","function_template":"function Z = mysub(X,Y)\r\n   Z = 0;\r\nend\r\n","test_suite":"%%\r\nX='+68768686834554';\r\nY='+76574535435398';\r\nZ_correct='-7805848600844';\r\nassert(isequal(mysub(X,Y),Z_correct))\r\n\r\n%%\r\nX='+1';\r\nY='+2';\r\nZ_correct ='-1';\r\nassert(isequal(mysub(X,Y),Z_correct))\r\n\r\n%%\r\nX='+100';\r\nY='+20';\r\nZ_correct ='+80';\r\nassert(isequal(mysub(X,Y),Z_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":11,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1535,"test_suite_updated_at":"2017-10-16T20:04:25.000Z","rescore_all_solutions":false,"group_id":34,"created_at":"2012-04-08T02:27:39.000Z","updated_at":"2026-02-04T22:10:20.000Z","published_at":"2017-10-16T01:45:05.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn \u0026amp;plusmn\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\u003eImagine you need to subtract one number from another using MATLAB.\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\u003eYou will not be using eval for this task.\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\u003eGiven two ASCII strings representing two integers X and Y.\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\u003eEach of them has only 12 or less ASCII characters.\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\u003eEach of them represents signed integers, such as '+2345'\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\u003ePlease output the result of (X-Y) in a similar style.\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":553,"title":"How to multiply?","description":"Imagine you are in 3012 Anno Domini, when everyone must learn how to multiply,\r\nand competing for the highly prestigious post of,\r\nChief Comptroller of Ylpitlum Corporation.\r\nYou are being tested via MATLAB Cody for multiplication of two positive integers X and Y,\r\nboth are fortunately in decimal system, and only a few dozen digits or less,\r\nand delivered as ASCII strings.\r\nPlease output the result Z in similar style.\r\nPlease adopt a general strategy, as X and Y may be changed later.\r\nPlease rename the function Z = ylpitlum(X,Y).\r\nFunction Template:\r\nfunction Z = ylpitlum(X,Y)\r\n   %  098765432109876543210987654321098765432109876543210987654321\r\n   X='170000000000000000000000000000';\r\n   Y='190000000000000000000000000000';\r\n   Z='32300000000000000000000000000000000000000000000000000000000';\r\nend","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: 346.933px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 173.467px; transform-origin: 407px 173.467px; vertical-align: baseline; \"\u003e\u003cul style=\"block-size: 204.333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 102.167px; transform-origin: 391px 102.167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 254.5px 8px; transform-origin: 254.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eImagine you are in 3012 Anno Domini, when everyone must learn how to multiply,\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 151.5px 8px; transform-origin: 151.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand competing for the highly prestigious post of,\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 131px 8px; transform-origin: 131px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eChief Comptroller of Ylpitlum Corporation.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 76.5px 8px; transform-origin: 76.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou are being tested via\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 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=\"\"\u003eMATLAB Cody\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.5px 8px; transform-origin: 154.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for multiplication of two positive integers X and Y,\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 233.5px 8px; transform-origin: 233.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 96.5px 8px; transform-origin: 96.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand delivered as ASCII strings.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 129px 8px; transform-origin: 129px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePlease output the result Z in similar style.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 210.5px 8px; transform-origin: 210.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 141.5px 8px; transform-origin: 141.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePlease rename the function Z = ylpitlum(X,Y).\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60px 8px; transform-origin: 60px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFunction Template:\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 122.6px; 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 61.3px; transform-origin: 404px 61.3px; 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: 104px 8.5px; tab-size: 4; transform-origin: 104px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); perspective-origin: 36px 8.5px; text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); transform-origin: 36px 8.5px; \"\u003efunction \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 68px 8.5px; transform-origin: 68px 8.5px; \"\u003eZ = ylpitlum(X,Y)\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: 264px 8.5px; tab-size: 4; transform-origin: 264px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 8.5px; \"\u003e   \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(2, 128, 9); border-block-start-color: rgb(2, 128, 9); border-bottom-color: rgb(2, 128, 9); border-inline-end-color: rgb(2, 128, 9); border-inline-start-color: rgb(2, 128, 9); border-left-color: rgb(2, 128, 9); border-right-color: rgb(2, 128, 9); border-top-color: rgb(2, 128, 9); caret-color: rgb(2, 128, 9); color: rgb(2, 128, 9); column-rule-color: rgb(2, 128, 9); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(2, 128, 9); perspective-origin: 252px 8.5px; text-decoration: none; text-decoration-color: rgb(2, 128, 9); text-emphasis-color: rgb(2, 128, 9); transform-origin: 252px 8.5px; \"\u003e%  098765432109876543210987654321098765432109876543210987654321\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: 152px 8.5px; tab-size: 4; transform-origin: 152px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 20px 8.5px; transform-origin: 20px 8.5px; \"\u003e   X=\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 128px 8.5px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 128px 8.5px; \"\u003e'170000000000000000000000000000'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\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: 152px 8.5px; tab-size: 4; transform-origin: 152px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 20px 8.5px; transform-origin: 20px 8.5px; \"\u003e   Y=\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 128px 8.5px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 128px 8.5px; \"\u003e'190000000000000000000000000000'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\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: 268px 8.5px; tab-size: 4; transform-origin: 268px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 20px 8.5px; transform-origin: 20px 8.5px; \"\u003e   Z=\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 244px 8.5px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 244px 8.5px; \"\u003e'32300000000000000000000000000000000000000000000000000000000'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\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: 12px 8.5px; tab-size: 4; transform-origin: 12px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); \"\u003eend\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Z = ylpitlum(X,Y)\r\n   %  098765432109876543210987654321098765432109876543210987654321\r\n   X='170000000000000000000000000000';\r\n   Y='190000000000000000000000000000';\r\n   Z='32300000000000000000000000000000000000000000000000000000000';\r\nend","test_suite":"%%\r\nX='170000000000000000000000000000';\r\nY='190000000000000000000000000000';\r\nZ='32300000000000000000000000000000000000000000000000000000000';\r\nassert(isequal(Z,ylpitlum(X,Y)))\r\n\r\n%%\r\nX='235711131719';\r\nY='232931374143475359';\r\nZ='54904517812220391149679812121';\r\nassert(isequal(Z,ylpitlum(X,Y)))\r\n\r\n%%\r\nX='7657534422342987897979879745232234';\r\nY='9878765654343431233130980808776767';\r\nZ='75646988048394475543709477144832189651639589891288011407029878707478';\r\nassert(isequal(Z,ylpitlum(X,Y)))\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2021-11-28T17:15:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-03T06:24:52.000Z","updated_at":"2026-02-10T19:25:06.000Z","published_at":"2012-04-03T06:24:52.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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine you are in 3012 Anno Domini, when everyone must learn how to multiply,\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand competing for the highly prestigious post of,\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChief Comptroller of Ylpitlum Corporation.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are being tested via\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\u003eMATLAB Cody\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for multiplication of two positive integers X and Y,\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand delivered as ASCII strings.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease output the result Z in similar style.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease adopt a general strategy, as X and Y may be changed later.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease rename the function Z = ylpitlum(X,Y).\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFunction Template:\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[function Z = ylpitlum(X,Y)\\n   %  098765432109876543210987654321098765432109876543210987654321\\n   X='170000000000000000000000000000';\\n   Y='190000000000000000000000000000';\\n   Z='32300000000000000000000000000000000000000000000000000000000';\\nend]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1253,"title":"Infinite precision division","description":"Develop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555566666677777778888888899999999') by a reasonably sized integer or float, supplied as a number.\r\nReturn integer part of quotient as text (leading zeros acceptable), and remainder as a number.\r\nInspired by my initial misapprehension of failure of simple solution at one of the test cases of Doug Hull's http://www.mathworks.com/matlabcentral/cody/problems/234-project-euler-problem-3-largest-prime-factor, and dedicated to those willing to code 'the wrong way around' any problem.\r\nI look forward to not understanding arcane code involving either/both bsxfun and arrayfun! I'm talking to you, @bmtran, Alfnie, et al!","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: 195px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 97.5px; transform-origin: 407px 97.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 338.5px 8px; transform-origin: 338.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDevelop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555566666677777778888888899999999') by a reasonably sized integer or float, supplied as a number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 296.5px 8px; transform-origin: 296.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn integer part of quotient as text (leading zeros acceptable), and remainder as a number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 327px 8px; transform-origin: 327px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eInspired by my initial misapprehension of failure of simple solution at one of the test cases of Doug Hull's\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 = \"https://in.mathworks.com/matlabcentral/cody/groups/4567/problems/1253-infinite-precision-division/edit#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"perspective-origin: 329px 8px; transform-origin: 329px 8px; \"\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/234-project-euler-problem-3-largest-prime-factor\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: 51px 8px; transform-origin: 51px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and dedicated to those willing to code 'the wrong way around' any problem.\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: 375.5px 8px; transform-origin: 375.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eI look forward to not understanding arcane code involving either/both bsxfun and arrayfun! I'm talking to you, @bmtran, Alfnie, et al!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [quotient,remainder] = strdiv(dividend,divisor)\r\n%\r\n% this will not work, but will explain my terminology\r\n%\r\n% (note: some 'leading' zeros in returned quotient are acceptable)\r\n% so, '002...' is just as acceptable as '2...'\r\n%\r\n  quotient = num2str(floor(str2num(dividend)/divisor));\r\n  remainder = mod(dividend,divisor);\r\n\r\nend","test_suite":"%% \r\ndividend = '122333444455555666666777777788888888999999999';\r\ndivisor = 42;\r\nquotient_correct = '2912701058465611111113756614021164023809523';\r\nremainder_correct = 33;\r\n[quotient,remainder]=strdiv(dividend,divisor);\r\nwhile and(numel(quotient)\u003e0,quotient(1)=='0')\r\n  quotient=quotient(2:end);\r\nend\r\nassert(isequal([quotient_correct ' ' num2str(remainder_correct)],[quotient ' ' num2str(remainder)]))\r\n\r\n%% \r\ndividend = '2357111317192329313741434753596167717379838997';\r\ndivisor = 69;\r\nquotient_correct = '34161033582497526286107750052118372715649840';\r\nremainder_correct = 37;\r\n[quotient,remainder]=strdiv(dividend,divisor);\r\nwhile and(numel(quotient)\u003e0,quotient(1)=='0')\r\n  quotient=quotient(2:end);\r\nend\r\nassert(isequal([quotient_correct ' ' num2str(remainder_correct)],[quotient ' ' num2str(remainder)]))\r\n\r\n%% \r\ndividend = '1234567890123456789012345678901234567890';\r\ndivisor = 37;\r\nquotient_correct = '33366699733066399703036369700033366699';\r\nremainder_correct = 27;\r\n[quotient,remainder]=strdiv(dividend,divisor);\r\nwhile and(numel(quotient)\u003e0,quotient(1)=='0')\r\n  quotient=quotient(2:end);\r\nend\r\nassert(isequal([quotient_correct ' ' num2str(remainder_correct)],[quotient ' ' num2str(remainder)]))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":2846,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":69,"test_suite_updated_at":"2021-11-29T06:23:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-07T20:26:17.000Z","updated_at":"2025-12-26T09:48:21.000Z","published_at":"2013-02-07T20:26:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDevelop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555566666677777778888888899999999') by a reasonably sized integer or float, supplied as a number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn integer part of quotient as text (leading zeros acceptable), and remainder as a number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by my initial misapprehension of failure of simple solution at one of the test cases of Doug Hull's\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\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/234-project-euler-problem-3-largest-prime-factor\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and dedicated to those willing to code 'the wrong way around' any 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI look forward to not understanding arcane code involving either/both bsxfun and arrayfun! I'm talking to you, @bmtran, Alfnie, et al!\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":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":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":42415,"title":"Divisible by 13","description":"Write a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different methods:\r\n\r\n# Form the alternating sum of blocks of three (separated at the comma locations). Apply this recursively until a three-digit number remains. If this number is divisible by 13, then so is the original number. This three-digit number can also be further reduced using one of the other methods below.\r\n# Add four times the last digit to the remaining number. Apply recursively until a two-digit number remains. As before, if this number is divisible by 13, then so is the original number.\r\n# Similar to the previous method, multiply the last digit by nine and subtract it from the remaining number. Apply recursion, etc.\r\n\r\nSome of the function restrictions have been lifted.\r\n\r\nPrevious problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42414-divisible-by-12 divisible by 12\u003e. Next problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42416-divisible-by-14 divisible by 14\u003e.","description_html":"\u003cp\u003eWrite a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different methods:\u003c/p\u003e\u003col\u003e\u003cli\u003eForm the alternating sum of blocks of three (separated at the comma locations). Apply this recursively until a three-digit number remains. If this number is divisible by 13, then so is the original number. This three-digit number can also be further reduced using one of the other methods below.\u003c/li\u003e\u003cli\u003eAdd four times the last digit to the remaining number. Apply recursively until a two-digit number remains. As before, if this number is divisible by 13, then so is the original number.\u003c/li\u003e\u003cli\u003eSimilar to the previous method, multiply the last digit by nine and subtract it from the remaining number. Apply recursion, etc.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eSome of the function restrictions have been lifted.\u003c/p\u003e\u003cp\u003ePrevious problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42414-divisible-by-12\"\u003edivisible by 12\u003c/a\u003e. Next problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42416-divisible-by-14\"\u003edivisible by 14\u003c/a\u003e.\u003c/p\u003e","function_template":"function [tf] = divisible_by_13(n_str)\r\n\r\ntf = 1;\r\n\r\nend\r\n","test_suite":"%%\r\nfiletext = fileread('divisible_by_13.m');\r\n% assert(isempty(strfind(filetext, '*')),'* forbidden')\r\nassert(isempty(strfind(filetext, 'mtimes')),'mtimes() forbidden')\r\nassert(isempty(strfind(filetext, 'cross')),'cross() forbidden')\r\nassert(isempty(strfind(filetext, 'prod')),'prod() forbidden')\r\nassert(isempty(strfind(filetext, 'cumprod')),'cumprod() forbidden')\r\nassert(isempty(strfind(filetext, 'times')),'times() forbidden')\r\nassert(isempty(strfind(filetext, 'mldivide')),'mldivide() forbidden')\r\nassert(isempty(strfind(filetext, 'mrdivide')),'mrdivide() forbidden')\r\n% assert(isempty(strfind(filetext, '/')),'/ forbidden')\r\nassert(isempty(strfind(filetext, '\\')),'\\ forbidden')\r\n% assert(isempty(strfind(filetext, '^')),'^ forbidden')\r\nassert(isempty(strfind(filetext, 'dot')),'dot() forbidden')\r\nassert(isempty(strfind(filetext, 'rem')),'rem() forbidden')\r\nassert(isempty(strfind(filetext, 'mod')),'mod() forbidden')\r\nassert(isempty(strfind(filetext, 'round')),'round() forbidden')\r\nassert(isempty(strfind(filetext, 'ceil')),'ceil() forbidden')\r\nassert(isempty(strfind(filetext, 'floor')),'floor() forbidden')\r\nassert(isempty(strfind(filetext, 'java')),'java forbidden')\r\n\r\n%%\r\nn_str = '12';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '13';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '222';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '228';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '221';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '1236123';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '1236131';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567896';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922799';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%%\r\nn_str = '1010010101011010101001011010100101101010010100101101010011010100101';\r\nassert(isequal(divisible_by_13(n_str),0))\r\n\r\n%%\r\nn_str = '10100101010110101010010110101001011010100101001011010100110101001007';\r\nassert(isequal(divisible_by_13(n_str),1))\r\n\r\n%% anti-cheating case\r\nind = randi(4);\r\nswitch ind\r\n\tcase 1\r\n\t\tn_str = '12';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\n\tcase 2\r\n\t\tn_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567896';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\n\tcase 3\r\n\t\tn_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\n\tcase 4\r\n\t\tn_str = '221';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\nend\r\n\r\n%% anti-cheating case\r\nind = randi(4);\r\nswitch ind\r\n\tcase 1\r\n\t\tn_str = '101001010101101010100101101010010110101001010010110101001101010010101';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\n\tcase 2\r\n\t\tn_str = '10100101010110101010010110101001011010100101001011010100110101001007';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\n\tcase 3\r\n\t\tn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\n\tcase 4\r\n\t\tn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\nend\r\n\r\n%% anti-cheating case\r\nind = randi(4);\r\nswitch ind\r\n\tcase 1\r\n\t\tn_str = '228';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\n\tcase 2\r\n\t\tn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';\r\n\t\tassert(isequal(divisible_by_13(n_str),0))\r\n\tcase 3\r\n\t\tn_str = '123678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\n\tcase 4\r\n\t\tn_str = '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';\r\n\t\tassert(isequal(divisible_by_13(n_str),1))\r\nend\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":157,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":22,"created_at":"2015-06-26T01:40:22.000Z","updated_at":"2025-12-24T20:24:26.000Z","published_at":"2015-06-26T01:40:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different methods:\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eForm the alternating sum of blocks of three (separated at the comma locations). Apply this recursively until a three-digit number remains. If this number is divisible by 13, then so is the original number. This three-digit number can also be further reduced using one of the other methods below.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd four times the last digit to the remaining number. Apply recursively until a two-digit number remains. As before, if this number is divisible by 13, then so is the original number.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSimilar to the previous method, multiply the last digit by nine and subtract it from the remaining number. Apply recursion, etc.\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\u003eSome of the function restrictions have been lifted.\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\u003ePrevious problem:\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://www.mathworks.com/matlabcentral/cody/problems/42414-divisible-by-12\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edivisible by 12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Next problem:\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://www.mathworks.com/matlabcentral/cody/problems/42416-divisible-by-14\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edivisible by 14\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":44341,"title":"Hexagonal numbers on a spiral matrix","description":"Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements.\r\n\r\nFormula of hexagonal numbers h(n) = 2n^2 - n\r\n\r\nIf m = 5;\r\n\r\n  spiral(5) =   \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\nFirst 5x5=25 hexagonal numbers are;\r\n\r\n  h = [1 6 15 28 45 66 91 120 153 190 231 276 325 378 435 496 561 630 703 780 861 946 1035 1128 1225]\r\n\r\nWe put them in a spiral format;\r\n\r\n   spiralHex = [\r\n861\t946\t1035\t1128\t1225\r\n780\t91\t120\t153\t190\r\n703\t66\t1\t6\t231\r\n630\t45\t28\t15\t276\r\n561\t496\t435\t378\t325\r\n\r\nAnd sum its diag = 861 + 91 + 1 + 15 + 325 = 1293.\r\n\r\nReturn the output as char.","description_html":"\u003cp\u003ePut hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements.\u003c/p\u003e\u003cp\u003eFormula of hexagonal numbers h(n) = 2n^2 - n\u003c/p\u003e\u003cp\u003eIf m = 5;\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003espiral(5) =   \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\u003c/pre\u003e\u003cp\u003eFirst 5x5=25 hexagonal numbers are;\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eh = [1 6 15 28 45 66 91 120 153 190 231 276 325 378 435 496 561 630 703 780 861 946 1035 1128 1225]\r\n\u003c/pre\u003e\u003cp\u003eWe put them in a spiral format;\u003c/p\u003e\u003cpre\u003e   spiralHex = [\r\n861\t946\t1035\t1128\t1225\r\n780\t91\t120\t153\t190\r\n703\t66\t1\t6\t231\r\n630\t45\t28\t15\t276\r\n561\t496\t435\t378\t325\u003c/pre\u003e\u003cp\u003eAnd sum its diag = 861 + 91 + 1 + 15 + 325 = 1293.\u003c/p\u003e\u003cp\u003eReturn the output as char.\u003c/p\u003e","function_template":"function y = hexagonalSpiral(m)\r\n  \r\nend","test_suite":"%%\r\nm = 1;\r\ny_correct = '1';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 2;\r\ny_correct = '16';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 5;\r\ny_correct = '1293';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 16;\r\ny_correct = '420800';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 100;\r\ny_correct = '4000333360';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 1295;\r\ny_correct = '1456830580539887';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 2500;\r\ny_correct = '39062505208334000';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 5000;\r\ny_correct = '1250000041666668000';\r\nassert(isequal(hexagonalSpiral(m),y_correct))\r\n\r\n%%\r\nm = 8000;\r\ny_correct = '13107200170666668800';\r\nassert(isequal(hexagonalSpiral(m),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":35,"created_at":"2017-09-19T08:06:36.000Z","updated_at":"2025-12-26T10:11:44.000Z","published_at":"2017-10-16T01:50:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePut hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements.\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\u003eFormula of hexagonal numbers h(n) = 2n^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\u003eIf m = 5;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[spiral(5) =   \\n  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\u003eFirst 5x5=25 hexagonal 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[h = [1 6 15 28 45 66 91 120 153 190 231 276 325 378 435 496 561 630 703 780 861 946 1035 1128 1225]]]\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\u003eWe put them in a spiral format;\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[   spiralHex = [\\n861  946  1035  1128  1225\\n780  91  120  153  190\\n703  66  1  6  231\\n630  45  28  15  276\\n561  496  435  378  325]]\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\u003eAnd sum its diag = 861 + 91 + 1 + 15 + 325 = 1293.\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\u003eReturn the output as char.\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":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":42394,"title":"It's going down.  We're finding simbers!","description":"This problem is inspired by Project Euler 520: Simbers.\r\n\r\n\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\r\n\r\nFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\r\n\r\nGiven a number, determine if it a simber or not.  Please note that the number will be in *string* format as some of the entries may be quite long.  You can assume there will be no leading zeroes in any of the numbers.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 87px; vertical-align: baseline; perspective-origin: 332px 87px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis problem is inspired by Project Euler 520: Simbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\"\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; perspective-origin: 309px 31.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003estring\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = simber(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(simber('141221242'),true))\r\n%%\r\nassert(isequal(simber('1223334444'),true))\r\n%%\r\nassert(isequal(simber('122333444'),false))\r\n%%\r\nassert(isequal(simber('567886'),true))\r\n%%\r\nassert(isequal(simber('999999999888888888'),false))\r\n%%\r\nassert(isequal(simber('6677788'),true))\r\n%%\r\nv=arrayfun(@(x) simber(num2str(x)),1:100);\r\ny_correct=[1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1];\r\nassert(isequal(v,y_correct))\r\n%%\r\nk=arrayfun(@(x) simber(sprintf('%.0f',2^x+1)),1:39);\r\ny_correct=[1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];\r\nassert(isequal(k,y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2020-09-29T03:05:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-06-18T19:55:17.000Z","updated_at":"2026-03-16T15:14:55.000Z","published_at":"2015-06-18T19:55:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is inspired by Project Euler 520: Simbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\"We define a simber to be a positive integer in which any odd digit, if present, occurs an odd number of times, and any even digit, if present, occurs an even number of times.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, 141221242 is a 9-digit simber because it has three 1's, four 2's and two 4's.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a number, determine if it a simber or not. Please note that the number will be in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estring\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e format as some of the entries may be quite long. You can assume there will be no leading zeroes in any of the numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"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}}