{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":49835,"title":"Decimal to Binary conversion for Large Integers","description":null,"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: 436.9px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 218.45px; transform-origin: 407px 218.45px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eDecimal integer, a base-10 number we normally use without fractional component, can be represented as \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Binary_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ebinary\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, a base-2 number composed either 0 or 1. The procedure to convert a decimal integer X to its binary equivalent is as follows:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 60px; font-family: Helvetica, Arial, sans-serif; list-style-type: decimal; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 30px; transform-origin: 391px 30px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDivide X by 2. The remainder (either 0 or 1) is the first binary value.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDivide the quotient of previous step by 2. The remainder is the next binary value.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRepeat the process until the quotient cannot be divided anymore and so last binary is found.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e\u003cdiv style=\"block-size: 22.1px; 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 11.05px; text-align: left; transform-origin: 384px 11.05px; 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=\"\"\u003eAs example, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,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\" width=\"141.5\" height=\"19.5\" style=\"width: 141.5px; height: 19.5px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e through process below:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 223.6px; 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 111.8px; text-align: left; transform-origin: 384px 111.8px; 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=\"\"\u003e        \u003c/span\u003e\u003c/span\u003e\u003cimg class=\"imageNode\" width=\"60\" height=\"218\" style=\"vertical-align: baseline;width: 60px;height: 218px\" src=\"https://upload.wikimedia.org/wikipedia/commons/d/d0/Decimal_to_Binary_Conversion.gif\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eGiven a decimal string input x, build a function dectobin(x) that returns its binary equivalent in character array. Unlike built-in dec2bin function, your function should also work for large integers up to thousands number of digits.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = dectobin(x)\r\n  y = x;\r\nend","test_suite":"clear\r\n%%\r\nbannedWords = {'regexp','regexpi','import','java'};\r\nassessFunctionAbsence(bannedWords,'Filename','dectobin.m')\r\n\r\n%%\r\nx = '0';\r\ny_correct = x;\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '1';\r\ny_correct = x;\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '13';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '1234';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '123456789';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = num2str(randi([1e6 1e9])); % 7-10 digits\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n \r\n%%\r\nx = num2str(int64(randi([1e14 1e15]))); % 15-16 digits\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\n% 100 digits\r\nx = '9935889422099775700620749019825066687005320193436482650621467845674334663581207733950858713953594810';\r\ny_correct = '100100010101110101001011011110111011001010010010000001101010001111010001111000110111110100011000000010001001010111101101111101000101110000110110100100001101001010010001010000010011111111010100111111100110010011111001110111001111011111000010011101111100000000100000001011011000001010111001110001010101001101110011111011110110110111010';\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\n% 1,000 digits\r\nx = '3059201154261253530451690354977606310924322607284223918856338124374709270871880662494169428937121052075859797206813475095556104269276596500978875324047465920883111580522711413182514848655486194576723389296141674672149809829265420167820519225209898307641365760914568721866463844355172261421834003336488535238809007328873935253700111210006241805977393874531741494641320187019834745948717074377488851592337628009671305943507313220241345532153678625541382153876303729081245594666363375641541440039672508266173273547591929050186861649876277730738299377510850280883881669370053397327830542446255453962902873897458955875563317360197974644289445704776742967853660702740237720951325610419441880361333911947025395121778148262639261460523590232675016389707381618111484504793129877986986813532838182033892534760974140550358778239119177192242757139854881677013489678325929427533280319023842380171528893573940130880205407716783800858180602225696643483888830206964236483084265907918866516345819848257322544972900223';\r\ny_correct = '100101010000010000001101010010100110001010110110111010110011000100110001100101100011010101101110000011101111100011011101110100000001001001011110000111111011111011111000010010000010011011110011111010101100001111001111111100010001100110011101011011100101001001011100111000011000111100110110110100001000110101011010001110110111010010001111111101100110111110110100101010000110100010110101110011100111100011100000101001001011110010010000110011001011111101100001001110010001111011011100001101100111000011001000101100000110011101000010001011110101110111010001110111011111000010100000010010000001001010001010110101010111100101100111010110011101001000111001001101100110010111011001010011010100011100010100111010110111011111111101010111011000000010111010110100001010001000110010011011000110111011110011101010100101101100000101010000101001000000000010010110000110100111111000111110001011001111110010001011011100011110011001110001101110010010101100101110100110100101000110001010110011000010011110101111110100010100011001101010101101110100001010000100001011010110110000111011001000001101111110011111000100001100000011101010011011000010111110100111100111010101001001001111001011000100001110101110001001110110010010101001000111001010100101110000110111001110001110111100110110101011010000001110110011010011011101100100000101111100001010010100000000001111101001011111110001100001001110101101111101101110111100001000001111101111111100100010111000011111001110011101001001110111001001111011000110000101100101000101100001001101000110000011010001111001110000100001011110111011011111111110000000011110101111101001100101010101111111011010001100100100001110000010110110100101100111111100100011101000111010100001001111110010101101100101010101011100000101101001110000010001011010110101100000011010100111010001111100100001001101000010011100110000010111111010000110010100000110101010000000001010000011011011101001010111010100111100011100011101101111010010110111001000111001001010000111100001110111110110000000001100011100010111110100010000110111110111110000001010000011010001001000011100011011010110010000010101011100100010110101000111110111101111110101011001101001000011110010101011000000000010110010000110010011100101000101101001111011010010101100110011011110101111111001010000100011111000100000010000101110100110100000111111011111011111011010110100000100100010011001010111101110010011011001010000111011111011100101111000100000100101010110000110000000001000100110100000111101111000011111110010101011101101100110111001011110101110000010000101110010100101000101111100110011111111111001001011101010111001001100110010101011101000101011110100100001111001111101110101100011110100001010110101110100011110001101001101011010110011101101011111101001010010110101001011001011001101110010100001001100101110001101100110010010010011111010011111110110000100010101011101001110000010010010110001100011100100011010011011010111010110100110011101000000101010101100110101000111111010000110011010000001111001111101000010111010111101100100111100001010001010110010100001010010010110110100101000001001101010101101100111011111101000110100000100110111010100111101011100111001111110001101111001111010101111111100101000111010101101011110010010001110001111111011000001001001000101010001000111101001011011001010010011011001010110110000011000001100110010011111011110010011101111111';\r\nassert(isequal(dectobin(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":392030,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2021-01-17T04:22:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-01-16T07:49:57.000Z","updated_at":"2025-11-19T01:41:17.000Z","published_at":"2021-01-16T08:14:40.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\u003eDecimal integer, a base-10 number we normally use without fractional component, can be represented as \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Binary_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ebinary\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, a base-2 number composed either 0 or 1. The procedure to convert a decimal integer X to its binary equivalent is as follows:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide X by 2. The remainder (either 0 or 1) is the first binary value.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide the quotient of previous step by 2. The remainder is the next binary value.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat the process until the quotient cannot be divided anymore and so last binary is found.\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\u003eAs example, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e357_{10} \\\\equiv 10010101101_2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e through process below:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"218\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"60\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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 decimal string input x, build a function dectobin(x) that returns its binary equivalent in character array. Unlike built-in dec2bin function, your function should also work for large integers up to thousands number of digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.gif\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.gif\",\"contentType\":\"image/gif\",\"content\":\"https://upload.wikimedia.org/wikipedia/commons/d/d0/Decimal_to_Binary_Conversion.gif\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"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\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":49835,"title":"Decimal to Binary conversion for Large Integers","description":null,"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: 436.9px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 218.45px; transform-origin: 407px 218.45px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eDecimal integer, a base-10 number we normally use without fractional component, can be represented as \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Binary_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ebinary\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, a base-2 number composed either 0 or 1. The procedure to convert a decimal integer X to its binary equivalent is as follows:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 60px; font-family: Helvetica, Arial, sans-serif; list-style-type: decimal; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 30px; transform-origin: 391px 30px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDivide X by 2. The remainder (either 0 or 1) is the first binary value.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDivide the quotient of previous step by 2. The remainder is the next binary value.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRepeat the process until the quotient cannot be divided anymore and so last binary is found.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e\u003cdiv style=\"block-size: 22.1px; 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 11.05px; text-align: left; transform-origin: 384px 11.05px; 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=\"\"\u003eAs example, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,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\" width=\"141.5\" height=\"19.5\" style=\"width: 141.5px; height: 19.5px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e through process below:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 223.6px; 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 111.8px; text-align: left; transform-origin: 384px 111.8px; 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=\"\"\u003e        \u003c/span\u003e\u003c/span\u003e\u003cimg class=\"imageNode\" width=\"60\" height=\"218\" style=\"vertical-align: baseline;width: 60px;height: 218px\" src=\"https://upload.wikimedia.org/wikipedia/commons/d/d0/Decimal_to_Binary_Conversion.gif\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eGiven a decimal string input x, build a function dectobin(x) that returns its binary equivalent in character array. Unlike built-in dec2bin function, your function should also work for large integers up to thousands number of digits.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = dectobin(x)\r\n  y = x;\r\nend","test_suite":"clear\r\n%%\r\nbannedWords = {'regexp','regexpi','import','java'};\r\nassessFunctionAbsence(bannedWords,'Filename','dectobin.m')\r\n\r\n%%\r\nx = '0';\r\ny_correct = x;\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '1';\r\ny_correct = x;\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '13';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '1234';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = '123456789';\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\nx = num2str(randi([1e6 1e9])); % 7-10 digits\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n \r\n%%\r\nx = num2str(int64(randi([1e14 1e15]))); % 15-16 digits\r\ny_correct = dec2bin(str2num(x));\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\n% 100 digits\r\nx = '9935889422099775700620749019825066687005320193436482650621467845674334663581207733950858713953594810';\r\ny_correct = '100100010101110101001011011110111011001010010010000001101010001111010001111000110111110100011000000010001001010111101101111101000101110000110110100100001101001010010001010000010011111111010100111111100110010011111001110111001111011111000010011101111100000000100000001011011000001010111001110001010101001101110011111011110110110111010';\r\nassert(isequal(dectobin(x),y_correct))\r\n\r\n%%\r\n% 1,000 digits\r\nx = '3059201154261253530451690354977606310924322607284223918856338124374709270871880662494169428937121052075859797206813475095556104269276596500978875324047465920883111580522711413182514848655486194576723389296141674672149809829265420167820519225209898307641365760914568721866463844355172261421834003336488535238809007328873935253700111210006241805977393874531741494641320187019834745948717074377488851592337628009671305943507313220241345532153678625541382153876303729081245594666363375641541440039672508266173273547591929050186861649876277730738299377510850280883881669370053397327830542446255453962902873897458955875563317360197974644289445704776742967853660702740237720951325610419441880361333911947025395121778148262639261460523590232675016389707381618111484504793129877986986813532838182033892534760974140550358778239119177192242757139854881677013489678325929427533280319023842380171528893573940130880205407716783800858180602225696643483888830206964236483084265907918866516345819848257322544972900223';\r\ny_correct = '100101010000010000001101010010100110001010110110111010110011000100110001100101100011010101101110000011101111100011011101110100000001001001011110000111111011111011111000010010000010011011110011111010101100001111001111111100010001100110011101011011100101001001011100111000011000111100110110110100001000110101011010001110110111010010001111111101100110111110110100101010000110100010110101110011100111100011100000101001001011110010010000110011001011111101100001001110010001111011011100001101100111000011001000101100000110011101000010001011110101110111010001110111011111000010100000010010000001001010001010110101010111100101100111010110011101001000111001001101100110010111011001010011010100011100010100111010110111011111111101010111011000000010111010110100001010001000110010011011000110111011110011101010100101101100000101010000101001000000000010010110000110100111111000111110001011001111110010001011011100011110011001110001101110010010101100101110100110100101000110001010110011000010011110101111110100010100011001101010101101110100001010000100001011010110110000111011001000001101111110011111000100001100000011101010011011000010111110100111100111010101001001001111001011000100001110101110001001110110010010101001000111001010100101110000110111001110001110111100110110101011010000001110110011010011011101100100000101111100001010010100000000001111101001011111110001100001001110101101111101101110111100001000001111101111111100100010111000011111001110011101001001110111001001111011000110000101100101000101100001001101000110000011010001111001110000100001011110111011011111111110000000011110101111101001100101010101111111011010001100100100001110000010110110100101100111111100100011101000111010100001001111110010101101100101010101011100000101101001110000010001011010110101100000011010100111010001111100100001001101000010011100110000010111111010000110010100000110101010000000001010000011011011101001010111010100111100011100011101101111010010110111001000111001001010000111100001110111110110000000001100011100010111110100010000110111110111110000001010000011010001001000011100011011010110010000010101011100100010110101000111110111101111110101011001101001000011110010101011000000000010110010000110010011100101000101101001111011010010101100110011011110101111111001010000100011111000100000010000101110100110100000111111011111011111011010110100000100100010011001010111101110010011011001010000111011111011100101111000100000100101010110000110000000001000100110100000111101111000011111110010101011101101100110111001011110101110000010000101110010100101000101111100110011111111111001001011101010111001001100110010101011101000101011110100100001111001111101110101100011110100001010110101110100011110001101001101011010110011101101011111101001010010110101001011001011001101110010100001001100101110001101100110010010010011111010011111110110000100010101011101001110000010010010110001100011100100011010011011010111010110100110011101000000101010101100110101000111111010000110011010000001111001111101000010111010111101100100111100001010001010110010100001010010010110110100101000001001101010101101100111011111101000110100000100110111010100111101011100111001111110001101111001111010101111111100101000111010101101011110010010001110001111111011000001001001000101010001000111101001011011001010010011011001010110110000011000001100110010011111011110010011101111111';\r\nassert(isequal(dectobin(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":392030,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2021-01-17T04:22:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-01-16T07:49:57.000Z","updated_at":"2025-11-19T01:41:17.000Z","published_at":"2021-01-16T08:14:40.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\u003eDecimal integer, a base-10 number we normally use without fractional component, can be represented as \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Binary_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ebinary\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, a base-2 number composed either 0 or 1. The procedure to convert a decimal integer X to its binary equivalent is as follows:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide X by 2. The remainder (either 0 or 1) is the first binary value.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide the quotient of previous step by 2. The remainder is the next binary value.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat the process until the quotient cannot be divided anymore and so last binary is found.\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\u003eAs example, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e357_{10} \\\\equiv 10010101101_2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e through process below:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"218\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"60\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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 decimal string input x, build a function dectobin(x) that returns its binary equivalent in character array. Unlike built-in dec2bin function, your function should also work for large integers up to thousands number of digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.gif\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.gif\",\"contentType\":\"image/gif\",\"content\":\"https://upload.wikimedia.org/wikipedia/commons/d/d0/Decimal_to_Binary_Conversion.gif\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"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\"}]}"}],"term":"tag:\"large number\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"large number\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"large number\"","","\"","large number","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d912a020\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d9129f80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d9129580\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d912a2a0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d912a200\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d912a160\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d912a0c0\u003e":"tag:\"large number\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d912a0c0\u003e":"tag:\"large number\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"large number\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"large number\"","","\"","large number","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d912a020\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d9129f80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d9129580\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d912a2a0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d912a200\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d912a160\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d912a0c0\u003e":"tag:\"large number\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d912a0c0\u003e":"tag:\"large number\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":49835,"difficulty_rating":"easy-medium"},{"id":44733,"difficulty_rating":"medium"}]}}