{"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":43755,"title":"Divide the Least Common Multiple by the Greatest Common Divisor of two numbers","description":"Divide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\r\n\r\n  223530915/3 =\r\n  74510305 (ANSWER)","description_html":"\u003cp\u003eDivide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e223530915/3 =\r\n74510305 (ANSWER)\r\n\u003c/pre\u003e","function_template":"function z = your_fcn_name(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12345;\r\ny = 54321;\r\ny_correct = 74510305;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 12;\r\ny = 54;\r\ny_correct = 18;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 1;\r\ny = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 987654321;\r\ny = x;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 800;\r\ny = 26000;\r\ny_correct = 130;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 65536;\r\ny = 32768;\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(x,y),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T23:00:01.000Z","updated_at":"2026-03-19T18:26:49.000Z","published_at":"2016-12-07T23:00:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[223530915/3 =\\n74510305 (ANSWER)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":49327,"title":"Divisors","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the divisors of a given number. But don't return the number itself, neither 1.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = divisores(n)\r\n    y = n;\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = [2,4,5,10];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 30;\r\ny_correct = [2,3,5,6,10,15];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 77;\r\ny_correct = [7,11];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 101; %dalmatians\r\ny_correct = [];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 777;\r\ny_correct = [3,7,21,37,111,259];\r\nassert(isequal(divisores(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":40,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-23T11:05:39.000Z","updated_at":"2026-02-28T08:27:11.000Z","published_at":"2020-12-31T01:21:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the divisors of a given number. But don't return the number itself, neither 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44748,"title":"Amicable numbers","description":"Test whether two numbers are \u003chttps://en.wikipedia.org/wiki/Amicable_numbers amicable\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\r\n\r\n\r\nExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.","description_html":"\u003cp\u003eTest whether two numbers are \u003ca href = \"https://en.wikipedia.org/wiki/Amicable_numbers\"\u003eamicable\u003c/a\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\u003c/p\u003e\u003cp\u003eExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.\u003c/p\u003e","function_template":"function y = amicable(m,n)\r\n  y = false;\r\nend","test_suite":"%%\r\nm = 220; n = 284;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 220; n = 504;\r\ny_correct = false;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 2620; n = 2924;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 5020; n = 5564;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 2924; n = 5020;\r\ny_correct = false;\r\nassert(isequal(amicable(m,n),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":254267,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":"2018-10-22T18:10:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-10-22T17:57:52.000Z","updated_at":"2026-03-16T15:34:17.000Z","published_at":"2018-10-22T18:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest whether two numbers are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Amicable_numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eamicable\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45794,"title":"*Prime number check 2 (in construction)","description":"Another way to see if a number is prime is to count the number of factors. For example,\r\n\r\n  the number 4 has 2 factors, [ 2 4 ]\r\n  the number 16 has 4 factors, [ 2 4 8 16 ]\r\n  the number 7 has 1 factor, [ 7 ]\r\n\r\nThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial. \r\n\r\nYour function should create a vector containing all the factors of any number x.","description_html":"\u003cp\u003eAnother way to see if a number is prime is to count the number of factors. For example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ethe number 4 has 2 factors, [ 2 4 ]\r\nthe number 16 has 4 factors, [ 2 4 8 16 ]\r\nthe number 7 has 1 factor, [ 7 ]\r\n\u003c/pre\u003e\u003cp\u003eThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial.\u003c/p\u003e\u003cp\u003eYour function should create a vector containing all the factors of any number x.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 16;\r\ny_correct = [ 2 4 8 16 ];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 23;\r\ny_correct = [ 23 ];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = [ 2 4 5 10 20 25 50 100 ];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-07T20:00:06.000Z","updated_at":"2025-08-03T17:44:27.000Z","published_at":"2020-06-07T20:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAnother way to see if a number is prime is to count the number of factors. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[the number 4 has 2 factors, [ 2 4 ]\\nthe number 16 has 4 factors, [ 2 4 8 16 ]\\nthe number 7 has 1 factor, [ 7 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should create a vector containing all the factors of any number x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1933,"title":"That's some divisor you've got there...","description":"Given a positive integer x, calculate the sum of all of the divisors of the number.  Please include the number itself in your final answer.  For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\r\n\r\nYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size.  Good luck!","description_html":"\u003cp\u003eGiven a positive integer x, calculate the sum of all of the divisors of the number.  Please include the number itself in your final answer.  For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\u003c/p\u003e\u003cp\u003eYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size.  Good luck!\u003c/p\u003e","function_template":"function y = sum_divisors(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nt_in=clock;\r\n\r\nx = 1; y_correct = 1; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 2; y_correct = 3; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 120; y_correct = 360; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\n% Perfect Number!\r\nx = 33550336; y_correct = 67100672; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 223092870; y_correct = 836075520; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 4294967295; y_correct = 7304603328; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx=arrayfun(@(y) sum_divisors(y),1:20000);assert(isequal(sum(x),329004151));\r\nt_out=etime(clock,t_in)*1000;\r\nassert(all(x\u003e0));\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx=arrayfun(@(p) sum_divisors(p),primes(200000));assert(isequal(sum(x),1709618797));\r\nt_out=etime(clock,t_in)*1000;\r\nassert(all(x\u003e0));\r\n\r\nudx=unique(diff(x));\r\nassert(isequal(numel(udx),39))\r\nassert(isequal(sum_divisors(max(udx)),132))\r\n\r\nt2=min(100000,t_out);\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2018-08-22T14:05:40.000Z","rescore_all_solutions":false,"group_id":38,"created_at":"2013-10-11T15:21:25.000Z","updated_at":"2025-03-08T05:05:07.000Z","published_at":"2013-10-11T15:21:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your final answer. For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size. Good luck!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60935,"title":"Compute the antisigma function","description":"The sum of divisors function, or , is the sum of the numbers that divide . The antisigma function is the sum of numbers less than  that do not divide . For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \r\nWrite a function that computes the antisigma function. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 36px; transform-origin: 408px 36px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 99.175px 8px; transform-origin: 99.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe sum of divisors function, or \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAlCAYAAADx5+EfAAADs0lEQVRoQ+2YS8hNURTHv29OihEDBgwor/IsI+VRUpIByow8hgYUIyPESAYeGdyMUJKYMGAg5TGhFAMUA0ZeMef/0161Hft17j3n3K/uPfXvPs7Za63/eu21z+TECF6TI8h5Ykx6VKI+jEjvlHPfC88bcPJ8yVgpXK8jq2vSB2XcegHiTV1nJGheHZldkobwdmFzU2w9ORbpImd2RXqTDLzpIvK1BdKIfCL0hIs5+V2QnikjPghHSgzKGZy4v0r3HgjLhXcpOV2Qpub2CHM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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: 120.175px 8px; transform-origin: 120.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is the sum of the numbers that divide \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 145.208px 8px; transform-origin: 145.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The antisigma function is the sum of numbers less than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 57.175px 8px; transform-origin: 57.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that do not divide \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.358px 8px; transform-origin: 219.358px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 168.283px 8px; transform-origin: 168.283px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the antisigma function. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = antisigma(n)\r\n  y = n-sum(n);\r\nend","test_suite":"%%\r\nassert(isequal(antisigma(0),0))\r\n\r\n%%\r\nassert(isequal(antisigma(1),0))\r\n\r\n%%\r\nassert(isequal(antisigma(15),96))\r\n\r\n%%\r\nassert(isequal(antisigma(66),2067))\r\n\r\n%%\r\nassert(isequal(antisigma(214),22681))\r\n\r\n%%\r\nassert(isequal(antisigma(651),211202))\r\n\r\n%%\r\nassert(isequal(antisigma(2030),2057145))\r\n\r\n%%\r\nassert(isequal(antisigma(4306),9266509))\r\n\r\n%%\r\nassert(isequal(antisigma(6771),22917182))\r\n\r\n%%\r\nassert(isequal(antisigma(8888),39484356))\r\n\r\n%%\r\nassert(isequal(antisigma(9999),49979088))\r\n\r\n%%\r\nassert(isequal(antisigma(45364),1028882242))\r\n\r\n%%\r\nassert(isequal(antisigma(351433),61752399801))\r\n\r\n%%\r\nassert(isequal(antisigma(7665534),29380192820025))\r\n\r\n%%\r\nassert(isequal(antisigma(88432534),3910156446398041))\r\n\r\n%%\r\np = primes(1e5);\r\nq = p(randi(length(p)));\r\nassert(isequal(antisigma(q),polyval([1/2 -1/2 -1],q)))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2025-06-12T01:47:32.000Z","deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-12T01:47:03.000Z","updated_at":"2025-10-14T02:58:47.000Z","published_at":"2025-06-12T01:47:32.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe sum of divisors function, or \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, is the sum of the numbers that divide \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The antisigma function is the sum of numbers less than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that do not divide \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that computes the antisigma function. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42791,"title":"Number of divisors of a given number","description":"Given a Number n, return the number of his divisors without listing them\r\n\r\nexample: \r\n\r\nn=14\r\n; Divisors={1,7,2,14} ; y=4\r\n\r\nn=68\r\n; Divisors={1,2,34,17,4,68} ; y=6","description_html":"\u003cp\u003eGiven a Number n, return the number of his divisors without listing them\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003en=14\r\n; Divisors={1,7,2,14} ; y=4\u003c/p\u003e\u003cp\u003en=68\r\n; Divisors={1,2,34,17,4,68} ; y=6\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'sqrt')))\r\nassert(isempty(strfind(filetext, 'for')))\r\n\r\n%%\r\nn= 6880;\r\ny_correct = 24;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 5050;\r\ny_correct = 12;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 188325;\r\ny_correct = 36;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn= 76576500;\r\ny_correct = 576;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 74;\r\ny_correct = 4;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn=14^8 ;\r\ny_correct = 81;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn=314721 ;\r\ny_correct = 27;\r\nassert(isequal(your_fcn_name(n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":17228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2016-04-01T06:25:39.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-03-31T12:09:31.000Z","updated_at":"2025-12-03T20:02:50.000Z","published_at":"2016-03-31T12:09:31.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a Number n, return the number of his divisors without listing them\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample:\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\u003en=14 ; Divisors={1,7,2,14} ; y=4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en=68 ; Divisors={1,2,34,17,4,68} ; y=6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":59841,"title":"Count the ways to write 1/n as the sum of two unit fractions","description":"The number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \r\nWrite a function to count the ways  can be written as the sum of two unit fractions.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 374.208px 8px; transform-origin: 374.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 106.825px 8px; transform-origin: 106.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to count the ways \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAlCAYAAADvLtGsAAACvElEQVRYR+1YO0tcQRTWPoKYSgsttNAmCj4SSOsDRBErH4iV+CgsI5gihY2gP0ATUqXStLExveCjsdNCwcrOENFev0/myOy9rnuGPTOL4oWPfdy7Z853XvPNVle9oqv6FXGpeiNjlM152PkN/DOyV7HMNIPAGdADHL10MssgMA20WRGhnUr1zAnW/gWsVooMa/wbMFJmaXTj94dAC3CemoyQqHcLl1vn32GnHfhkSaRUmTGCM27BSby+MyJzCTsrwGZKMpw4UgZreP/FgEw/bOwC7wGzkSxB0Q4AKzLbbuEx66yUKjN/PSsyN650hZQpp5SZ4SBZB2pMGXjGUpJhr1wAc0XIsEeJXoDTrhH4Ayy551kdUwCn6inwOdt3qcjUYeEr4Lmxzj7qBBYAf3JyCO0B1w4cIryYZSH68EUqMpQvi0BDkaz4X+/jw0cX/SG87gCiFmQa8vmvQIGCSEUmRL7ceZFvwvv/gJQm+27D3c8piBRkRCFr5IsfeR4PSGYQkD2J6mHWZa0iPRMiX8RZBv8W6AB8/Ub1wAHww8vWY4mmyEyIfGE5tjrvsj0hGebtAeBvtv9ikwmRL76zB5nyot/SL8wYyy8nh2KT4U5f6yKZDWT2s9/cuUmFh7lPMTjMCDOTu2KTCZEv4myxyNMW9x8hynHPIfHYUzHJcBP8CWjlizj7VORpa8ulglOxDxgFJvxy05KRjYz2xgGNUGSkuUdoFLKcPmmfCiB71vGFLrPxAeCGWnBSfY4MG5JyYRiQU6bUKQ0eA8XO8Br54te87+xT+xF94XosM67NUssdubWZ8RfWvJejtka+aOypnolFhvuFr3hVzpT7UAwyIfKlXP8Lfh+DDOuffWb6B5+GdQwyIfJF46P6GWsyMmKj/PtSipU1GfZLF6DZh0r5FnzfmkywA5Y/eCNjGU1LW/eg9aImLPkVEgAAAABJRU5ErkJggg==\" width=\"25.5\" height=\"18.5\" alt=\"1/n\" style=\"width: 25.5px; height: 18.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: 145.842px 8px; transform-origin: 145.842px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can be written as the sum of two unit fractions.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = twoUnitFractions(n)\r\n  y = 1/n+1/n;\r\nend","test_suite":"%%\r\nn = 2;\r\ny = twoUnitFractions(n);\r\ny_correct = 2;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 9;\r\ny = twoUnitFractions(n);\r\ny_correct = 3;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 85;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 327;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 461;\r\ny = twoUnitFractions(n);\r\ny_correct = 2;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 824;\r\ny = twoUnitFractions(n);\r\ny_correct = 11;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 1989;\r\ny = twoUnitFractions(n);\r\ny_correct = 23;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 5460;\r\ny = twoUnitFractions(n);\r\ny_correct = 203;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 7011;\r\ny = twoUnitFractions(n);\r\ny_correct = 23;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 8610;\r\ny = twoUnitFractions(n);\r\ny_correct = 122;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 9438;\r\ny = twoUnitFractions(n);\r\ny_correct = 68;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 14332;\r\ny = twoUnitFractions(n);\r\ny_correct = 8;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 58110;\r\ny = twoUnitFractions(n);\r\ny_correct = 122;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 254000;\r\ny = twoUnitFractions(n);\r\ny_correct = 95;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 5563449;\r\ny = twoUnitFractions(n);\r\ny_correct = 8;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 77221133;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\np = primes(1000);\r\ny = arrayfun(@twoUnitFractions,p);\r\nassert(all(y==2))\r\n\r\n%%\r\np = primes(20);\r\nb = p(randi(length(p)));\r\ne = randi(5);\r\ny = twoUnitFractions(b^e);\r\nassert(isequal(y,e+1))\r\n\r\n%%\r\nfiletext = fileread('twoUnitFractions.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2024-04-05T01:09:45.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-04-05T01:09:23.000Z","updated_at":"2025-07-19T12:22:30.000Z","published_at":"2024-04-05T01:09:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to count the ways \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"1/n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e1/n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e can be written as the sum of two unit fractions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2664,"title":"Divisors for big integer","description":"Inspired by Problem 1025 and Project Euler 12.\r\n\r\nGiven n, return the number y of integers that divide N. \r\n\r\nFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\r\n\r\nIt's easy with normal integer but how to proceed with big number?\r\n\r\n","description_html":"\u003cp\u003eInspired by Problem 1025 and Project Euler 12.\u003c/p\u003e\u003cp\u003eGiven n, return the number y of integers that divide N.\u003c/p\u003e\u003cp\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/p\u003e\u003cp\u003eIt's easy with normal integer but how to proceed with big number?\u003c/p\u003e","function_template":"function y = divisors_Big(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 784;\r\ny_correct = 15;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 1452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 5452637;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 16452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 116452637;\r\ny_correct = 8;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 416452638;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 12250000;\r\ny_correct = 105;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 2031120;\r\ny_correct = 240;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 76576500;\r\ny_correct = 576;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 816452637;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 103672800;\r\ny_correct = 648;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 842161320;\r\ny_correct = 1024;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":240,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-11-12T02:00:29.000Z","updated_at":"2026-01-05T00:22:49.000Z","published_at":"2014-11-12T02:28:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 1025 and Project Euler 12.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven n, return the number y of integers that divide N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt's easy with normal integer but how to proceed with big number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":46898,"title":"Sum of all the divisors of n","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eOutput the sum of all the divisors of a number (n). For example n=10, divisors = 1, 2, 5, 10, output = 18.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sumDivisors(x)\r\n  y = sum(x);\r\nend","test_suite":"%%\r\nx=2.^(10:20);\r\ny=[2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151];\r\nassert(isequal(sumDivisors(x),y))\r\n%%\r\nx=2^32-1;\r\ny=7304603328;\r\nassert(isequal(sumDivisors(x),y))\r\n%%\r\nx =[   53394       10330       42975       46272       28754       18090       49236       55098       23047        4972\r\n       59362       63609        2341        2087       25006       44545       16718       16665       54450        3536\r\n        8323       62729       55649       18149       50169       42933       33159       53365       38356       34787\r\n       59860       31810       61211        3026       52115       10657       45815       15960       36027       51064\r\n       41443       52448       44482        6366       12247        7799       58387       60901       60110       61212\r\n        6393        9299       49660       53967       32098       32661       62869       22937       18733        8514\r\n       18252       27641       48702       45537       29202       62898       35863       12885       49624       37279\r\n       35841       60014       25705       20782       42357       22308        9085       16456       49397       30762\r\n       62752       51919       42958       62274       46489       38357        9785       40374       24933         781\r\n       63235       62882       11219        2258       49460       14668       16877       31018       37213       22094];\r\ny=[   116640       18612       77376      122936       47088       48960      125664      119418       24280        9576\r\n       90576      104832        2342        2088       37512       54720       27048       29376      160797        7812\r\n       10080       63300       60720       18150       76480       62496       50560       69048       68992       35640\r\n      130536       57276       61212        4860       71520       10658       73872       57600       52052      103320\r\n       41444      113400       69696       12744       12616        8520       70400       60902      108216      142856\r\n        8528        9864      112896       71960       52560       49920       62870       22938       22176       20592\r\n       51240       27984       97416       62304       60672      137376       35864       20640       93060       40680\r\n       51520       92568       31752       31176       64576       61488       11520       35910       50496       66690\r\n      129276       59344       65952      127008       46490       42294       12480       87516       33248         864\r\n       75888       98496       12096        3390      103908       27160       19296       50148       43200       33144];\r\nassert(isequal(sumDivisors(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":145982,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T03:07:30.000Z","updated_at":"2025-11-29T15:06:14.000Z","published_at":"2020-10-18T03:27:54.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\u003eOutput the sum of all the divisors of a number (n). For example n=10, divisors = 1, 2, 5, 10, output = 18.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":51715,"title":"Iterate the sum of divisors and totient","description":"","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 339px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 169.5px; transform-origin: 407px 169.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; 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 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/46898\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eCody Problem 46898\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: 160.25px 7.91667px; transform-origin: 160.25px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e deals with the sum of divisors function, denoted by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAmCAYAAAB3c5OxAAACSElEQVRoge1YW5GEMBBsDzjAAAZQsArWAQ5wsBbQgIT1gAU0YGHvI+ljNpeQyV5CcVfpKr4Set4zSYCKioqKimQ8AHSZuFrL12TiK4IJwD0zZw9gwUUNnwCMhbjvMIZfCgPKKzXBpPol0AJ4waRhSTQAthPkqDABeJ4k6wFgPUlWEIzy7Z/K8+JhlTgTC4A5F1kL48Hx4HPn74q01O6sDBmpBqY7j9BFMIujexjFX4pPzkqmWmxMDR5+zvIbTHOSazHD7/hl45wcgatVYrOKym9y/u3tP4NS1mL3b9iju1qem9AhNpZS5b5hFoI27B7Wko5I8/hq98/2nxV75lCmhq+DLsN+gHXB6LpHPGbAkeEpRrMUyMkIu1zMghjoPDWkV0PDXqZbyKgUo1mHdLLrTGad1pAXEs8Gso5D9dMr9qQYLUvJp6zMAg2SjZaNqw3skZEO1U6K0ezQG36OPengkD4S2qnxDTaBmKdkNoTuxnRMbMRIo9wJAOz9RXu8JJ/aaE3a8mAfUpLQdlHZNH0O5CijPrFo09nqOS27aMhoRtnX1V1siDcfGuWLpNSnt/KeOH55YVklPSrwdOS7/w5iTUM64TgtGxz3hgHv9bwg/vKy4IO7e4P3lOKJ6An/ODkCUy0UGTmqfOko1zXdm078+EnKvVx8+pi3Ilz7veAPYbDrms49QH+AKQpeGs5QJDUTi2LGcafPgREXexxknyj1otHBZJOmBE4Fu2+uh36CDs3Nmw2aOZvKN2fkK4pcTa3JyFVRUVHxd/AF1+TpTklxPxAAAAAASUVORK5CYII=\" alt=\"sigma(n)\" style=\"width: 30.5px; height: 19px;\" width=\"30.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.7833px 7.91667px; transform-origin: 21.7833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, while \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/656\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eCody Problem 656\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: 46.675px 7.91667px; transform-origin: 46.675px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e deals with the totient function, denoted by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAmCAYAAABzhkOMAAACkklEQVRoge1Z25GDMAzcHtIBDdAAFaQCOqCDdEAL1JAS6CEtUENa4D7svQifHzIxDHPjneHHEMmSVg87QEVFRUXF4ejtUwoTgKagvMPQw2y2JBoALwBtYblF0QOYD5LdAlhwUQa0AN44dnM9DAMuhwXA4wQ980l61Ohhon47QdcdwIoL0X8BMP5jfUEwEt2JOkcYphVBB5NHspU0AAa7HuvZE4zxWjRW3+Cs360ud92HIg4fYCj0wjaHRiucm1kRbjML0u2ts9+8rawVn1mgtfpX8aQo3Yj97QIj9nTWHx7Br8C3iKz7QKcyauzdA0yx5DtNO8vRuwENX7Ct0PSom0+zWJffd8iLAPVSzoItdWm8Rt4bOwYq0niFyR2JJ7aUJGbxm2+MX4T8Gdv8pixtLjON1Ljhk3cutRh1n3L+5pvIS/kL/lKWQdEaxICowXxe8beC851rYCt+49Isx3jJON9ARGO0eZxtPGnnUx4qanLTbhvKMZ4p5XM8Eu980HSZX0jaxSjvGigd5rY6VmjNtCUp7+Iu3mvHVh8Tg5AFxd2sjK4cdHqEnUJoqq40zieHLZBBuSF+TqDT1X1e5q5rPCkpo8JWlPLwE+kiJft7aFCSxkyI05+BdLtVFKzabl67Uxc3QMNjUSA7YnRlPfE5UQblbvWmboLozKxTpKQxvSYp2VuBE4yjNLlMCobSQtYTH03le221f2HnVVkHY9RsHzlXj1Y5naDFBH8hA4xxD/uE2MFDjWa4IVOKnCI1eZ1CA8OUM461E3bO9C5SlMwBT4hHokPBe8JQi9uLCcfdsLD7ZFX4GNjiit2KwKRPyT8sCNaiYsipsDlI9elcjIXlbarwEf+ElLzJvcxNbUVFRcXl8AOhCgwX4v7BgwAAAABJRU5ErkJggg==\" alt=\"phi(n)\" style=\"width: 31.5px; height: 19px;\" width=\"31.5\" height=\"19\"\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: 164.125px 7.91667px; transform-origin: 164.125px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The sum of divisors is straightforward: for example, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u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ehJet5zBpICWrpeVGKAa4QReA3Ekoco27xF+mWqHb2J4xrCCGwrjmfj69Ua+FR0J6MjGeFZRNWW4gi8jF3sepbVn0C74mgdMW691JIjjLK9mq0pVe3SeF9ScWMTvabys8TAM00TE8ZD4noU9C3fc/yfq1WvSAujZlekFFuII9OqVi+iWwtLjB6qVYF3Yzc3RuSao8X4bVEc90gLo3Z3KrJltSo1JyWMUms432JjKyubI/O0c0aKA1CzkMm1jFxyDbzGS6LnEWszf7fnhetexVET9Vt9e9NaHPl1ibm201G0ihoBF8cpZOZrzhDTflnVFbQmjpoIixmaHvaR1maTzsE5XIOO2XyOBXWmSpZXh8gdCTQCckbZGot8lURbkcRS5blDY5xu6P/Dxzl9V4r19TlI+Q26qYML6FavV1iKo9zcPmwfjZX1h1VdHKfh+J8q06d4LpFuXEocZX1H6jc41qY2aZHHA318gUgWzsTuh2n/8Jnyb+f2VmVfqeelbNAPRkNyEI3IGQR8sFojOuDvThaxbX5khZrmiKW0BtgZ3y3I7bsaLMVRrl9r1iwsBMZaHMP1GDpqdLaW8NBdHOPXpQDwC/CcG1fYzoklxfGA96rKG+Zt2NROMLGjtjhmacKK0tQxlQkY8LIvF4z9aTIWwk3GSw3hHbp0UqowYGrwWea7T+jnO2chJX1Xg5U4aopB5GElMkusOYbzxfoDuCFriiPXm3raPD3cdPyIZTIpS4ljbm1C7ppg63Yut4Yj9my5vrr0WMjmgD5EJzcq/p/h52Raf6ZzDNB9EqdluM7ZxCQv5BPu4QvLO0LOB3OBbTGCNd/of63RcRzH6YyWq6OYq3fPz3Ecx1mdHew/21MLRbulNjmO4zj/GQMqPhVizIC/33xzHMdxnM1ooZBjQBvtcBzHcRzHcRzHcRzHcRzHcRzHcRzHcRzHcRzHcRzH+Vz+Ad8nwVEOBsgFAAAAAElFTkSuQmCC\" alt=\"sigma(12) = 1+2+3+4+6+12 = 28\" style=\"width: 227.5px; height: 19px;\" width=\"227.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 7.91667px; transform-origin: 3.88333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The totient of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 95.2917px 7.91667px; transform-origin: 95.2917px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e counts the numbers less than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 84.4px 7.91667px; transform-origin: 84.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that are relatively prime to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 44.725px 7.91667px; transform-origin: 44.725px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAmCAYAAAAIjkMFAAADhUlEQVR4nO2bcZGzMBDFnwccYKAGUFAFOKiDOsACGioBD7VQDbVw3x/hTbf5CNksORp6+c0wN9NL0rB52ewuFKhUKpVKpVKpVAqkn68SGAG0n57EX6SHM76Wbr60nABcAFznK9a3BXCf+30jDXR22JUewKRs281tf+AWNkYr2vtXbKFPAB74Ts+QYsNdOAF4Im7spQWN3UQzj81Fn+AWVo7xwLoY+rnvN3GB3oa78YBzUWu0cBPmX+1N3OCE4C90B7e4HOcWGWdSzPEonJC2mXahh1uoJqFPB91NtHOb0G7n/38UczjP7Y5+RDR4bbyihPAAMCT20Qrhqhj7JsaKBYWWuZbGCOfdGhQkBO6y1KhVK4Qe8R0sd0ZMCAOc5zgqZ7zHYlmF0MEZUxqR5/gV6zWBcZ6I5Ttz3QSFoFlgq3BLoIW7R7keWWx4gXOVd7zvumEe/IpXUBdKvx7Qp4ySnELg0aBx+YwpLEFji1f9YstlFeGE/2s0m23InexH2txd0lD3QFusfB4jpxCYWmqDwBxz3nJZ7vcKt+n8YHiTDSkCf2DuFt/FTuJz2Z6GseyuXELoDXN4wubFcnmE1ConU8WlfmYbyvz97P2PLtZ3P7IAVJIQmEYxgtYy4TgBo0wVlzDZ0K/QSWQ+7p9h7FOaRxix7C5jUNhHgKliCJMNZZrlZwIy8paGlRUsf0KfFAKLWJbi0FGEwAxnQPiYkVVVdTDK+vxSBS4UEK6Vgj8lhC0iAOyZzt5Zg1zobMGodP1rx4I/iBSPb3hWtiyVOqsQtooAWPZuGvbOGljfWbukt1YFo/Im/IWTu14O0iM+eWsEbhFCh7gIWqwXwCjeT9YRcr4bkbyZ5FnvC4HZwkN8xmg1tnv4ZDCVVCHwMbef6UgaOG+31obfu9bmSJiOV0b/fhzAwWTayFpDLDWj10h11QyENDdBEdD7hK4n3sW8BKumqZlGqZiEIF09d4RckB7OQCOcUTVnP11tykTOeH+P4I5wAEURaM/fmMu/I+1VutIxZ14d3AJzF8kFGeC8BQWhhfm8htj56X9vr+iz1l/C4/GID5xCZIs7NHFADD4VK93AI2zPGL4emTZaomgJn2SWiibj+LOE0kYrI8p8+4cZ0LdkCtlh2pjzAcyEcn7cQhj3VALIOnVORpRj+AHlzKVIZJXsN34FVEqeXmOCSqVSqVQqlUolxD+nOt9IeLButwAAAABJRU5ErkJggg==\" alt=\"phi(12) = 4\" style=\"width: 65px; height: 19px;\" width=\"65\" height=\"19\"\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: 68.5083px 7.91667px; transform-origin: 68.5083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e because the greatest common divisor of 12 and four numbers (1, 5, 7, 11) is 1. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 7.91667px; transform-origin: 384px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhat happens if you repeatedly apply the two functions, starting with the sum of divisors and alternating? For example, start with 7. Then \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvMAAAAmCAYAAABJaRRiAAAQC0lEQVR4nO2d63HrOAyFTw/uwA24AVfgCtxBOnAHacE1pIT0kBZSQ1q4+0M+K4ThA3xZpIVvRrOzvo4skQRwCFIQYBiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRg75x3AqdG5jo/zHRqdz2jDAcAd7frlAuCt0bmMelraMLCMlWPD8xn1tLbhPfrqkcf09XGUcsDvvrwBOFddkTEarf18DRYjBuMOvwO5YnEGmsP9+zOAL7xOkDhjEa683wvmurcDgE/EncABy33Kfk0FghuW8fOqXLDc4+iEbDjGAfE+PmKx4VECRwnueE4dIxOzYfPVfk5YxM/n4xh54nJFvi+9PP6G9+cmVw4APlA3QRiVM/ImKif8juEzTnJy/XzvNnqFGBHjhKUdppiw3OEPYgcAPwD+KQ/fOa5YOnpmLgC+sThKGgbv6+fx76NzwHK9McO8Ybmfd6z3+fb4LGWs98ffvRpnLGP7Z+sLSRCy4RSfWO4vtrpywjL+p3BmHniPmuNzo2vUELNh89V/od/+h0XMji42rsgbf/TX7M+YfXLszBCrNJyh813kiLAfmEmI5vj5Z7bR7DEihPSrw4+RN4Qd+BXLTVDIhg52eKgjZxZ6bANftoQO8h/Gn+F/IN4H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Q2/of/WF1a7m3mv/FZsbf/Ac/x8DXuOETU6r/lF9DJw7sfacweXtq2mtrAWBqpe/fAGEwFbjfHeNkwhuVcRcEf5JFVb/1xD73G2Z1+9tQ0DdeNMA7dpGnmMYv+9/XwNe44RQ/ULH8hovT2CN7nXbRcXlAeHVjWR3esJVaup4QR9FaVX5Irt772XDQNLQJrxYcgWnFCXbWk5IQf62fDeffUINgwsfdvD1t4wdlZ3VEaz/55+voY9x4gandeFAxZH0mqQHLB08GiDbhZkScqWbXhCWzFwwtLPIwTCvdPahoElI7VXJ11L6RsYU7S2YfPVY3FHW5u7wjLyW9DL/nv4+RosRgxKywBhAq8cPmHe40G0lv0y1IzUAGD9OwqyokqPTHrLc5mvHguz4fnpaf/odM4SbHwZhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYxkz8B+9eXgSCQ2hrAAAAAElFTkSuQmCC\" alt=\"sigma(7) = 8, phi(8) = 4, sigma(4) = 7, phi(7) = 6, sigma(6) = 12, phi(12) = 4, \" style=\"width: 377.5px; height: 19px;\" width=\"377.5\" height=\"19\"\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: 13.2167px 7.91667px; transform-origin: 13.2167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e etc.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 117.458px 7.91667px; transform-origin: 117.458px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand the pattern 7, 6, 12, 4 will repeat. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 258.3px 7.91667px; transform-origin: 258.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOscillating behavior is plausible because the sum of divisors is always greater than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 120.45px 7.91667px; transform-origin: 120.45px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and the totient is always smaller than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 360.958px 7.91667px; transform-origin: 360.958px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Furthermore, because the totient has a minimum value and the sum of divisors has a maximum value, with enough iterations the sequence would have to hit a repeating pattern.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.4px 7.91667px; transform-origin: 383.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes an initial seed and returns the repeating pattern and the index of the sequence where the pattern begins. With an initial seed of 7, the sequence would be 7, 8, 4, 7, 6, 12, 4, 7, 6, 12,… Therefore, the repeating pattern is [7 6 12 4] and the start index is 3.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q,n0] = sigPhi(n)\r\n%  n  = initial seed\r\n%  q  = vector of repeating pattern\r\n%  n0 = index where the repeating pattern starts (counting the initial seed as index 1)\r\nend","test_suite":"%%\r\nn = 2;\r\nq_correct = [2 3];\r\nn0_correct = 1;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 3;\r\nq_correct = [2 3];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7;\r\nq_correct = [4 7 6 12];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 12;\r\nq_correct = [12 28];\r\nn0_correct = 1;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 28;\r\nq_correct = [24 60 16 31 30 72];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 101;\r\nq_correct = [72 195 96 252];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 127;\r\nq_correct = [96 252 72 195];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 256;\r\nq_correct = [432 1240 480 1512];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 777;\r\nq_correct = [576 1651 1512 4800 1280 3066 864 2520];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 1111;\r\nq_correct = [432 1240 480 1512];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 5555;\r\nq_correct = [10368 30855 14080 36792];\r\nn0_correct = 23;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7777;\r\nq_correct = [3024 9920 3840 12264 3456 10200 2560 6138 1800 6045 2880 9906];\r\nn0_correct = 11;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 11111;\r\nq_correct = [3024 9920 3840 12264 3456 10200 2560 6138 1800 6045 2880 9906];\r\nn0_correct = 11;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 77777;\r\nq_correct = [10368 30855 14080 36792];\r\nn0_correct = 27;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 123456;\r\nq_correct = [184320 638898 196560 833280];\r\nn0_correct = 21;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 666666;\r\nq_correct = [1658880 5946666 1801800 8124480];\r\nn0_correct = 39;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7777777;\r\nq_correct = [191102976000 715162215924 207622711296 859454668800 178362777600 757256331104 283740364800 1100946774480 233003796480 1053092362140 221908377600 1035248323200 204838502400 888208962000 214695936000 952677206208 237283098624 859638312960 185794560000 792731088600 178886400000 749337039360 150493593600 639777817224 152374763520 626874655824 202491394560 925865740800 167215104000 715161022368 219847799808 880002352320 161864220672 609720615224 247328774784 987821856000];\r\nn0_correct = 161;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":46909,"edited_by":46909,"edited_at":"2022-11-28T04:11:02.000Z","deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2021-05-10T14:27:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-09T19:28:03.000Z","updated_at":"2026-01-14T13:15:59.000Z","published_at":"2021-05-09T19:36:55.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/46898\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eCody Problem 46898\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e deals with the sum of divisors function, denoted by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, while \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/656\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eCody Problem 656\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e deals with the totient function, denoted by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"phi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\varphi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The sum of divisors is straightforward: for 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(12) = 1+2+3+4+6+12 = 28\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(12) = 1+2+3+4+6+12 = 28\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The totient of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e counts the numbers less than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that are relatively prime to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. For 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"phi(12) = 4\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\varphi(12) = 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e because the greatest common divisor of 12 and four numbers (1, 5, 7, 11) is 1. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat happens if you repeatedly apply the two functions, starting with the sum of divisors and alternating? For example, start with 7. Then \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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(7) = 8, phi(8) = 4, sigma(4) = 7, phi(7) = 6, sigma(6) = 12, phi(12) = 4, \\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(7) = 8, \\\\varphi(8) = 4, \\\\sigma(4) = 7, \\\\varphi(7) = 6, \\\\sigma(6) = 12, \\\\varphi(12) = 4,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e etc.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand the pattern 7, 6, 12, 4 will repeat. \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\u003eOscillating behavior is plausible because the sum of divisors is always greater than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and the totient is always smaller than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Furthermore, because the totient has a minimum value and the sum of divisors has a maximum value, with enough iterations the sequence would have to hit a repeating pattern.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that takes an initial seed and returns the repeating pattern and the index of the sequence where the pattern begins. With an initial seed of 7, the sequence would be 7, 8, 4, 7, 6, 12, 4, 7, 6, 12,… Therefore, the repeating pattern is [7 6 12 4] and the start index is 3.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":43755,"title":"Divide the Least Common Multiple by the Greatest Common Divisor of two numbers","description":"Divide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\r\n\r\n  223530915/3 =\r\n  74510305 (ANSWER)","description_html":"\u003cp\u003eDivide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e223530915/3 =\r\n74510305 (ANSWER)\r\n\u003c/pre\u003e","function_template":"function z = your_fcn_name(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12345;\r\ny = 54321;\r\ny_correct = 74510305;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 12;\r\ny = 54;\r\ny_correct = 18;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 1;\r\ny = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 987654321;\r\ny = x;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 800;\r\ny = 26000;\r\ny_correct = 130;\r\nassert(isequal(your_fcn_name(x,y),y_correct))\r\n%%\r\nx = 65536;\r\ny = 32768;\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(x,y),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T23:00:01.000Z","updated_at":"2026-03-19T18:26:49.000Z","published_at":"2016-12-07T23:00:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDivide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer would be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[223530915/3 =\\n74510305 (ANSWER)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":49327,"title":"Divisors","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the divisors of a given number. But don't return the number itself, neither 1.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = divisores(n)\r\n    y = n;\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = [2,4,5,10];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 30;\r\ny_correct = [2,3,5,6,10,15];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 77;\r\ny_correct = [7,11];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 101; %dalmatians\r\ny_correct = [];\r\nassert(isequal(divisores(x),y_correct))\r\n%%\r\nx = 777;\r\ny_correct = [3,7,21,37,111,259];\r\nassert(isequal(divisores(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":40,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-23T11:05:39.000Z","updated_at":"2026-02-28T08:27:11.000Z","published_at":"2020-12-31T01:21:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the divisors of a given number. But don't return the number itself, neither 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44748,"title":"Amicable numbers","description":"Test whether two numbers are \u003chttps://en.wikipedia.org/wiki/Amicable_numbers amicable\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\r\n\r\n\r\nExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.","description_html":"\u003cp\u003eTest whether two numbers are \u003ca href = \"https://en.wikipedia.org/wiki/Amicable_numbers\"\u003eamicable\u003c/a\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\u003c/p\u003e\u003cp\u003eExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.\u003c/p\u003e","function_template":"function y = amicable(m,n)\r\n  y = false;\r\nend","test_suite":"%%\r\nm = 220; n = 284;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 220; n = 504;\r\ny_correct = false;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 2620; n = 2924;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 5020; n = 5564;\r\ny_correct = true;\r\nassert(isequal(amicable(m,n),y_correct))\r\n\r\n%%\r\nm = 2924; n = 5020;\r\ny_correct = false;\r\nassert(isequal(amicable(m,n),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":254267,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":"2018-10-22T18:10:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-10-22T17:57:52.000Z","updated_at":"2026-03-16T15:34:17.000Z","published_at":"2018-10-22T18:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest whether two numbers are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Amicable_numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eamicable\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, meaning that the sum of the proper divisors of each number is equal to the other number.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: 220 and 284 are amicable numbers because the proper divisors of 220 are 1,2,4,5,10,11,20,22,44,55,110 and their sum is 284, while the proper divisors of 284 are 1,2,4,71,142 and their sum is 220.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45794,"title":"*Prime number check 2 (in construction)","description":"Another way to see if a number is prime is to count the number of factors. For example,\r\n\r\n  the number 4 has 2 factors, [ 2 4 ]\r\n  the number 16 has 4 factors, [ 2 4 8 16 ]\r\n  the number 7 has 1 factor, [ 7 ]\r\n\r\nThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial. \r\n\r\nYour function should create a vector containing all the factors of any number x.","description_html":"\u003cp\u003eAnother way to see if a number is prime is to count the number of factors. For example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ethe number 4 has 2 factors, [ 2 4 ]\r\nthe number 16 has 4 factors, [ 2 4 8 16 ]\r\nthe number 7 has 1 factor, [ 7 ]\r\n\u003c/pre\u003e\u003cp\u003eThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial.\u003c/p\u003e\u003cp\u003eYour function should create a vector containing all the factors of any number x.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 16;\r\ny_correct = [ 2 4 8 16 ];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 23;\r\ny_correct = [ 23 ];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = [ 2 4 5 10 20 25 50 100 ];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-07T20:00:06.000Z","updated_at":"2025-08-03T17:44:27.000Z","published_at":"2020-06-07T20:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAnother way to see if a number is prime is to count the number of factors. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[the number 4 has 2 factors, [ 2 4 ]\\nthe number 16 has 4 factors, [ 2 4 8 16 ]\\nthe number 7 has 1 factor, [ 7 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, if a number has only one factor, it is prime. We ignore the factor 1 as it is trivial.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should create a vector containing all the factors of any number x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1933,"title":"That's some divisor you've got there...","description":"Given a positive integer x, calculate the sum of all of the divisors of the number.  Please include the number itself in your final answer.  For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\r\n\r\nYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size.  Good luck!","description_html":"\u003cp\u003eGiven a positive integer x, calculate the sum of all of the divisors of the number.  Please include the number itself in your final answer.  For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\u003c/p\u003e\u003cp\u003eYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size.  Good luck!\u003c/p\u003e","function_template":"function y = sum_divisors(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nt_in=clock;\r\n\r\nx = 1; y_correct = 1; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 2; y_correct = 3; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 120; y_correct = 360; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\n% Perfect Number!\r\nx = 33550336; y_correct = 67100672; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 223092870; y_correct = 836075520; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx = 4294967295; y_correct = 7304603328; yours=sum_divisors(x);\r\nassert(isequal(yours,y_correct))\r\nt_out=etime(clock,t_in)*1000;\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx=arrayfun(@(y) sum_divisors(y),1:20000);assert(isequal(sum(x),329004151));\r\nt_out=etime(clock,t_in)*1000;\r\nassert(all(x\u003e0));\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\n\r\nx=arrayfun(@(p) sum_divisors(p),primes(200000));assert(isequal(sum(x),1709618797));\r\nt_out=etime(clock,t_in)*1000;\r\nassert(all(x\u003e0));\r\n\r\nudx=unique(diff(x));\r\nassert(isequal(numel(udx),39))\r\nassert(isequal(sum_divisors(max(udx)),132))\r\n\r\nt2=min(100000,t_out);\r\nfprintf('Actual Time = %.0f msec\\n',t_out)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2018-08-22T14:05:40.000Z","rescore_all_solutions":false,"group_id":38,"created_at":"2013-10-11T15:21:25.000Z","updated_at":"2025-03-08T05:05:07.000Z","published_at":"2013-10-11T15:21:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your final answer. For example, 1, 3, 5 and 15 are all the proper divisors of 15, so sum_divisors(15)=1+3+5+15, which is 24.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour score will be based on how quickly your script solves the problems in the test suite, rather than the typical Cody size. Good luck!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60935,"title":"Compute the antisigma function","description":"The sum of divisors function, or , is the sum of the numbers that divide . The antisigma function is the sum of numbers less than  that do not divide . For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \r\nWrite a function that computes the antisigma function. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 36px; transform-origin: 408px 36px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 99.175px 8px; transform-origin: 99.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe sum of divisors function, or \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAlCAYAAADx5+EfAAADs0lEQVRoQ+2YS8hNURTHv29OihEDBgwor/IsI+VRUpIByow8hgYUIyPESAYeGdyMUJKYMGAg5TGhFAMUA0ZeMef/0161Hft17j3n3K/uPfXvPs7Za63/eu21z+TECF6TI8h5Ykx6VKI+jEjvlHPfC88bcPJ8yVgpXK8jq2vSB2XcegHiTV1nJGheHZldkobwdmFzU2w9ORbpImd2RXqTDLzpIvK1BdKIfCL0hIs5+V2QnikjPghHSgzKGZy4v0r3HgjLhXcpOV2Qpub2CHMGIFS6lDSnvtcOk3RXUTaOlNE9YbUQ3R3ajvQxKT8pzBLaquVqUD/pj0dCtKm1Tfq1s2hRaX428BwpvkWYHpPVJmlS+4twWTjQAJlSEZZd0RQvJU2t7BWWCgsT2n1FVl9n9fzRxBqmKrBBWCbMFe54a6wRztZ/b4R1mVIxvYf0XHD7ypFmGzgvrClw82c9s9gzyDzOMHI/sZ7aWyFg5DT3HM5j23ks/HCADFfOiVlnp0jbQGGGPJXCnsAYSc3sE75VyPjkiBB7c460iWC4wLlEc6twV7gqnBKMCM8ed/9VVP/z87d+3RCCzSxG2jZ6I4x3Twt0YGr1lVPhR7ZqRF3SGMqFLvba74L1AkbYC+7+An0mhw/dRxZBCu7XIdJGihriCjUiS91qSvvE65D2I0mEIE022TZ3Sd/3CyU1jQ21SRshFuMtX7mRKkm3OqSNFPJ/CdVRkr2XIJTsBNldIxRpU4ABu4TQWdUnHTPEUrKkptnPbVeo1iyd/a3zdoms2o3MvISOVOr62RDbGrLKHRGfVCizzHlkAGmfm+xMbyxg/70jq9ZWbJSzyKQcY7UV7aKOtN+kQp2ZWRq72BlKzuJWVtGGV03vkrT1n4l60xHCYIaN1BhqpGKR/Kn17CLmELIMR8Y6OPKWCNFTXaimTUkoQnZq8o2w5hb6tCimthnTF4okmXbNCUbGRoG3L7sTaU7nTg4wIdJ+uvmnIyLccwYc1mfJyzhzEntsaBRlHnjmZIZ6g6UqjxAExmAGl1iUS5wcfe+Nh08IdFSaywzho3DLKc81Ez/qqZcIPqlQNtDkXghkFqRJ8dRgwlT3UkgecHKzt2/8IN9pfP4hYhBZsbUE6oqQ7fBdkSaNbwvbhCbed1eJWxnt0I3U4ebvuq5Io4uecE7IHQ37yYLiN6Fdk0afHVVDo20/ZFlDQ30oZF/9moIuI206aU6kYxNp3pesYZDuN6KNrRuTbsyVU1zQONJTPECNmfcHKjffJmCJuP8AAAAASUVORK5CYII=\" width=\"30.5\" height=\"18.5\" alt=\"sigma(n)\" style=\"width: 30.5px; height: 18.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: 120.175px 8px; transform-origin: 120.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is the sum of the numbers that divide \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 145.208px 8px; transform-origin: 145.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The antisigma function is the sum of numbers less than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 57.175px 8px; transform-origin: 57.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that do not divide \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.358px 8px; transform-origin: 219.358px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 168.283px 8px; transform-origin: 168.283px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the antisigma function. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = antisigma(n)\r\n  y = n-sum(n);\r\nend","test_suite":"%%\r\nassert(isequal(antisigma(0),0))\r\n\r\n%%\r\nassert(isequal(antisigma(1),0))\r\n\r\n%%\r\nassert(isequal(antisigma(15),96))\r\n\r\n%%\r\nassert(isequal(antisigma(66),2067))\r\n\r\n%%\r\nassert(isequal(antisigma(214),22681))\r\n\r\n%%\r\nassert(isequal(antisigma(651),211202))\r\n\r\n%%\r\nassert(isequal(antisigma(2030),2057145))\r\n\r\n%%\r\nassert(isequal(antisigma(4306),9266509))\r\n\r\n%%\r\nassert(isequal(antisigma(6771),22917182))\r\n\r\n%%\r\nassert(isequal(antisigma(8888),39484356))\r\n\r\n%%\r\nassert(isequal(antisigma(9999),49979088))\r\n\r\n%%\r\nassert(isequal(antisigma(45364),1028882242))\r\n\r\n%%\r\nassert(isequal(antisigma(351433),61752399801))\r\n\r\n%%\r\nassert(isequal(antisigma(7665534),29380192820025))\r\n\r\n%%\r\nassert(isequal(antisigma(88432534),3910156446398041))\r\n\r\n%%\r\np = primes(1e5);\r\nq = p(randi(length(p)));\r\nassert(isequal(antisigma(q),polyval([1/2 -1/2 -1],q)))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2025-06-12T01:47:32.000Z","deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-12T01:47:03.000Z","updated_at":"2025-10-14T02:58:47.000Z","published_at":"2025-06-12T01:47:32.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe sum of divisors function, or \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, is the sum of the numbers that divide \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The antisigma function is the sum of numbers less than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that do not divide \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. For example, antisigma(15) = 2+4+6+7+8+9+10+11+12+13+14 = 96. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that computes the antisigma function. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42791,"title":"Number of divisors of a given number","description":"Given a Number n, return the number of his divisors without listing them\r\n\r\nexample: \r\n\r\nn=14\r\n; Divisors={1,7,2,14} ; y=4\r\n\r\nn=68\r\n; Divisors={1,2,34,17,4,68} ; y=6","description_html":"\u003cp\u003eGiven a Number n, return the number of his divisors without listing them\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003en=14\r\n; Divisors={1,7,2,14} ; y=4\u003c/p\u003e\u003cp\u003en=68\r\n; Divisors={1,2,34,17,4,68} ; y=6\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'sqrt')))\r\nassert(isempty(strfind(filetext, 'for')))\r\n\r\n%%\r\nn= 6880;\r\ny_correct = 24;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 5050;\r\ny_correct = 12;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 188325;\r\ny_correct = 36;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn= 76576500;\r\ny_correct = 576;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn= 74;\r\ny_correct = 4;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn=14^8 ;\r\ny_correct = 81;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n\r\n%%\r\nn=314721 ;\r\ny_correct = 27;\r\nassert(isequal(your_fcn_name(n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":17228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2016-04-01T06:25:39.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-03-31T12:09:31.000Z","updated_at":"2025-12-03T20:02:50.000Z","published_at":"2016-03-31T12:09:31.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a Number n, return the number of his divisors without listing them\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample:\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\u003en=14 ; Divisors={1,7,2,14} ; y=4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en=68 ; Divisors={1,2,34,17,4,68} ; y=6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":59841,"title":"Count the ways to write 1/n as the sum of two unit fractions","description":"The number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \r\nWrite a function to count the ways  can be written as the sum of two unit fractions.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 374.208px 8px; transform-origin: 374.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 106.825px 8px; transform-origin: 106.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to count the ways \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAlCAYAAADvLtGsAAACvElEQVRYR+1YO0tcQRTWPoKYSgsttNAmCj4SSOsDRBErH4iV+CgsI5gihY2gP0ATUqXStLExveCjsdNCwcrOENFev0/myOy9rnuGPTOL4oWPfdy7Z853XvPNVle9oqv6FXGpeiNjlM152PkN/DOyV7HMNIPAGdADHL10MssgMA20WRGhnUr1zAnW/gWsVooMa/wbMFJmaXTj94dAC3CemoyQqHcLl1vn32GnHfhkSaRUmTGCM27BSby+MyJzCTsrwGZKMpw4UgZreP/FgEw/bOwC7wGzkSxB0Q4AKzLbbuEx66yUKjN/PSsyN650hZQpp5SZ4SBZB2pMGXjGUpJhr1wAc0XIsEeJXoDTrhH4Ayy551kdUwCn6inwOdt3qcjUYeEr4Lmxzj7qBBYAf3JyCO0B1w4cIryYZSH68EUqMpQvi0BDkaz4X+/jw0cX/SG87gCiFmQa8vmvQIGCSEUmRL7ceZFvwvv/gJQm+27D3c8piBRkRCFr5IsfeR4PSGYQkD2J6mHWZa0iPRMiX8RZBv8W6AB8/Ub1wAHww8vWY4mmyEyIfGE5tjrvsj0hGebtAeBvtv9ikwmRL76zB5nyot/SL8wYyy8nh2KT4U5f6yKZDWT2s9/cuUmFh7lPMTjMCDOTu2KTCZEv4myxyNMW9x8hynHPIfHYUzHJcBP8CWjlizj7VORpa8ulglOxDxgFJvxy05KRjYz2xgGNUGSkuUdoFLKcPmmfCiB71vGFLrPxAeCGWnBSfY4MG5JyYRiQU6bUKQ0eA8XO8Br54te87+xT+xF94XosM67NUssdubWZ8RfWvJejtka+aOypnolFhvuFr3hVzpT7UAwyIfKlXP8Lfh+DDOuffWb6B5+GdQwyIfJF46P6GWsyMmKj/PtSipU1GfZLF6DZh0r5FnzfmkywA5Y/eCNjGU1LW/eg9aImLPkVEgAAAABJRU5ErkJggg==\" width=\"25.5\" height=\"18.5\" alt=\"1/n\" style=\"width: 25.5px; height: 18.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: 145.842px 8px; transform-origin: 145.842px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can be written as the sum of two unit fractions.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = twoUnitFractions(n)\r\n  y = 1/n+1/n;\r\nend","test_suite":"%%\r\nn = 2;\r\ny = twoUnitFractions(n);\r\ny_correct = 2;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 9;\r\ny = twoUnitFractions(n);\r\ny_correct = 3;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 85;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 327;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 461;\r\ny = twoUnitFractions(n);\r\ny_correct = 2;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 824;\r\ny = twoUnitFractions(n);\r\ny_correct = 11;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 1989;\r\ny = twoUnitFractions(n);\r\ny_correct = 23;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 5460;\r\ny = twoUnitFractions(n);\r\ny_correct = 203;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 7011;\r\ny = twoUnitFractions(n);\r\ny_correct = 23;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 8610;\r\ny = twoUnitFractions(n);\r\ny_correct = 122;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 9438;\r\ny = twoUnitFractions(n);\r\ny_correct = 68;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 14332;\r\ny = twoUnitFractions(n);\r\ny_correct = 8;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 58110;\r\ny = twoUnitFractions(n);\r\ny_correct = 122;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 254000;\r\ny = twoUnitFractions(n);\r\ny_correct = 95;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 5563449;\r\ny = twoUnitFractions(n);\r\ny_correct = 8;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\nn = 77221133;\r\ny = twoUnitFractions(n);\r\ny_correct = 5;\r\nassert(isequal(y,y_correct))\r\n\r\n%%\r\np = primes(1000);\r\ny = arrayfun(@twoUnitFractions,p);\r\nassert(all(y==2))\r\n\r\n%%\r\np = primes(20);\r\nb = p(randi(length(p)));\r\ne = randi(5);\r\ny = twoUnitFractions(b^e);\r\nassert(isequal(y,e+1))\r\n\r\n%%\r\nfiletext = fileread('twoUnitFractions.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2024-04-05T01:09:45.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-04-05T01:09:23.000Z","updated_at":"2025-07-19T12:22:30.000Z","published_at":"2024-04-05T01:09:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. That is, 1/2 can be written as the sum of two unit fractions (those with a numerator of 1) in two ways, and 1/9 can be written as the sum of two unit fractions in three ways. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to count the ways \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"1/n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e1/n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e can be written as the sum of two unit fractions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2664,"title":"Divisors for big integer","description":"Inspired by Problem 1025 and Project Euler 12.\r\n\r\nGiven n, return the number y of integers that divide N. \r\n\r\nFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\r\n\r\nIt's easy with normal integer but how to proceed with big number?\r\n\r\n","description_html":"\u003cp\u003eInspired by Problem 1025 and Project Euler 12.\u003c/p\u003e\u003cp\u003eGiven n, return the number y of integers that divide N.\u003c/p\u003e\u003cp\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/p\u003e\u003cp\u003eIt's easy with normal integer but how to proceed with big number?\u003c/p\u003e","function_template":"function y = divisors_Big(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 28;\r\ny_correct = 6;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 784;\r\ny_correct = 15;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 1452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 5452637;\r\ny_correct = 4;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 16452637;\r\ny_correct = 2;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 116452637;\r\ny_correct = 8;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 416452638;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 12250000;\r\ny_correct = 105;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 2031120;\r\ny_correct = 240;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 76576500;\r\ny_correct = 576;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 816452637;\r\ny_correct = 32;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 103672800;\r\ny_correct = 648;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n%%\r\nx = 842161320;\r\ny_correct = 1024;\r\nassert(isequal(divisors_Big(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":240,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-11-12T02:00:29.000Z","updated_at":"2026-01-05T00:22:49.000Z","published_at":"2014-11-12T02:28:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by Problem 1025 and Project Euler 12.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven n, return the number y of integers that divide N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, with n = 10, the divisors are [1 2 5 10], so y = 4.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt's easy with normal integer but how to proceed with big number?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":46898,"title":"Sum of all the divisors of n","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eOutput the sum of all the divisors of a number (n). For example n=10, divisors = 1, 2, 5, 10, output = 18.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sumDivisors(x)\r\n  y = sum(x);\r\nend","test_suite":"%%\r\nx=2.^(10:20);\r\ny=[2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151];\r\nassert(isequal(sumDivisors(x),y))\r\n%%\r\nx=2^32-1;\r\ny=7304603328;\r\nassert(isequal(sumDivisors(x),y))\r\n%%\r\nx =[   53394       10330       42975       46272       28754       18090       49236       55098       23047        4972\r\n       59362       63609        2341        2087       25006       44545       16718       16665       54450        3536\r\n        8323       62729       55649       18149       50169       42933       33159       53365       38356       34787\r\n       59860       31810       61211        3026       52115       10657       45815       15960       36027       51064\r\n       41443       52448       44482        6366       12247        7799       58387       60901       60110       61212\r\n        6393        9299       49660       53967       32098       32661       62869       22937       18733        8514\r\n       18252       27641       48702       45537       29202       62898       35863       12885       49624       37279\r\n       35841       60014       25705       20782       42357       22308        9085       16456       49397       30762\r\n       62752       51919       42958       62274       46489       38357        9785       40374       24933         781\r\n       63235       62882       11219        2258       49460       14668       16877       31018       37213       22094];\r\ny=[   116640       18612       77376      122936       47088       48960      125664      119418       24280        9576\r\n       90576      104832        2342        2088       37512       54720       27048       29376      160797        7812\r\n       10080       63300       60720       18150       76480       62496       50560       69048       68992       35640\r\n      130536       57276       61212        4860       71520       10658       73872       57600       52052      103320\r\n       41444      113400       69696       12744       12616        8520       70400       60902      108216      142856\r\n        8528        9864      112896       71960       52560       49920       62870       22938       22176       20592\r\n       51240       27984       97416       62304       60672      137376       35864       20640       93060       40680\r\n       51520       92568       31752       31176       64576       61488       11520       35910       50496       66690\r\n      129276       59344       65952      127008       46490       42294       12480       87516       33248         864\r\n       75888       98496       12096        3390      103908       27160       19296       50148       43200       33144];\r\nassert(isequal(sumDivisors(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":145982,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T03:07:30.000Z","updated_at":"2025-11-29T15:06:14.000Z","published_at":"2020-10-18T03:27:54.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\u003eOutput the sum of all the divisors of a number (n). For example n=10, divisors = 1, 2, 5, 10, output = 18.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":51715,"title":"Iterate the sum of divisors and totient","description":"","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 339px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 169.5px; transform-origin: 407px 169.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; 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 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/46898\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eCody Problem 46898\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: 160.25px 7.91667px; transform-origin: 160.25px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e deals with the sum of divisors function, denoted by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAmCAYAAAB3c5OxAAACSElEQVRoge1YW5GEMBBsDzjAAAZQsArWAQ5wsBbQgIT1gAU0YGHvI+ljNpeQyV5CcVfpKr4Set4zSYCKioqKimQ8AHSZuFrL12TiK4IJwD0zZw9gwUUNnwCMhbjvMIZfCgPKKzXBpPol0AJ4waRhSTQAthPkqDABeJ4k6wFgPUlWEIzy7Z/K8+JhlTgTC4A5F1kL48Hx4HPn74q01O6sDBmpBqY7j9BFMIujexjFX4pPzkqmWmxMDR5+zvIbTHOSazHD7/hl45wcgatVYrOKym9y/u3tP4NS1mL3b9iju1qem9AhNpZS5b5hFoI27B7Wko5I8/hq98/2nxV75lCmhq+DLsN+gHXB6LpHPGbAkeEpRrMUyMkIu1zMghjoPDWkV0PDXqZbyKgUo1mHdLLrTGad1pAXEs8Gso5D9dMr9qQYLUvJp6zMAg2SjZaNqw3skZEO1U6K0ezQG36OPengkD4S2qnxDTaBmKdkNoTuxnRMbMRIo9wJAOz9RXu8JJ/aaE3a8mAfUpLQdlHZNH0O5CijPrFo09nqOS27aMhoRtnX1V1siDcfGuWLpNSnt/KeOH55YVklPSrwdOS7/w5iTUM64TgtGxz3hgHv9bwg/vKy4IO7e4P3lOKJ6An/ODkCUy0UGTmqfOko1zXdm078+EnKvVx8+pi3Ilz7veAPYbDrms49QH+AKQpeGs5QJDUTi2LGcafPgREXexxknyj1otHBZJOmBE4Fu2+uh36CDs3Nmw2aOZvKN2fkK4pcTa3JyFVRUVHxd/AF1+TpTklxPxAAAAAASUVORK5CYII=\" alt=\"sigma(n)\" style=\"width: 30.5px; height: 19px;\" width=\"30.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.7833px 7.91667px; transform-origin: 21.7833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, while \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/656\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration: underline; text-decoration-line: underline; \"\u003eCody Problem 656\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: 46.675px 7.91667px; transform-origin: 46.675px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e deals with the totient function, denoted by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAmCAYAAABzhkOMAAACkklEQVRoge1Z25GDMAzcHtIBDdAAFaQCOqCDdEAL1JAS6CEtUENa4D7svQifHzIxDHPjneHHEMmSVg87QEVFRUXF4ejtUwoTgKagvMPQw2y2JBoALwBtYblF0QOYD5LdAlhwUQa0AN44dnM9DAMuhwXA4wQ980l61Ohhon47QdcdwIoL0X8BMP5jfUEwEt2JOkcYphVBB5NHspU0AAa7HuvZE4zxWjRW3+Cs360ud92HIg4fYCj0wjaHRiucm1kRbjML0u2ts9+8rawVn1mgtfpX8aQo3Yj97QIj9nTWHx7Br8C3iKz7QKcyauzdA0yx5DtNO8vRuwENX7Ct0PSom0+zWJffd8iLAPVSzoItdWm8Rt4bOwYq0niFyR2JJ7aUJGbxm2+MX4T8Gdv8pixtLjON1Ljhk3cutRh1n3L+5pvIS/kL/lKWQdEaxICowXxe8beC851rYCt+49Isx3jJON9ARGO0eZxtPGnnUx4qanLTbhvKMZ4p5XM8Eu980HSZX0jaxSjvGigd5rY6VmjNtCUp7+Iu3mvHVh8Tg5AFxd2sjK4cdHqEnUJoqq40zieHLZBBuSF+TqDT1X1e5q5rPCkpo8JWlPLwE+kiJft7aFCSxkyI05+BdLtVFKzabl67Uxc3QMNjUSA7YnRlPfE5UQblbvWmboLozKxTpKQxvSYp2VuBE4yjNLlMCobSQtYTH03le221f2HnVVkHY9RsHzlXj1Y5naDFBH8hA4xxD/uE2MFDjWa4IVOKnCI1eZ1CA8OUM461E3bO9C5SlMwBT4hHokPBe8JQi9uLCcfdsLD7ZFX4GNjiit2KwKRPyT8sCNaiYsipsDlI9elcjIXlbarwEf+ElLzJvcxNbUVFRcXl8AOhCgwX4v7BgwAAAABJRU5ErkJggg==\" alt=\"phi(n)\" style=\"width: 31.5px; height: 19px;\" width=\"31.5\" height=\"19\"\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: 164.125px 7.91667px; transform-origin: 164.125px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The sum of divisors is straightforward: for example, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAccAAAAmCAYAAACxk1AhAAAI+klEQVR4nO2d4ZHqOgyFTw/pgAa2ASqgAjqgg+1gW6AGSqAHWqAGWtj7I5xBeBNbtpXE5uqbybw787LBcWwdSVYcwHEcx3Ecx3Ecx3Ecx3Ecx3Ecx3Ecx3Ecx3GcrvkB8LV1IwDsMLZl2LohjuOszgCf+05DnAEcM84/YhQxLXsA38/jhLQI7wHc8JmTJLfvWmAAcMDrGfZ4D8D7ODzgM8bXCXlztzUOGO3P9Xmctm1ONvvnoeUL4z1yHOb8bYvsMI6/knm1w7td0WjDqpwxNkzDEcAdwC90N7EX54fHBfFOPGIUyE8ht+9a4QTggelnqB03W3PE9D08ME7OXvnGay71xjdez+Qb/Tlbe4xi/g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06d4LpFuXEocZX1H6jc41qY2aZHHA318gUgWzsTuh2n/8Jnyb+f2VmVfqeelbNAPRkNyEI3IGQR8sFojOuDvThaxbX5khZrmiKW0BtgZ3y3I7bsaLMVRrl9r1iwsBMZaHMP1GDpqdLaW8NBdHOPXpQDwC/CcG1fYzoklxfGA96rKG+Zt2NROMLGjtjhmacKK0tQxlQkY8LIvF4z9aTIWwk3GSw3hHbp0UqowYGrwWea7T+jnO2chJX1Xg5U4aopB5GElMkusOYbzxfoDuCFriiPXm3raPD3cdPyIZTIpS4ljbm1C7ppg63Yut4Yj9my5vrr0WMjmgD5EJzcq/p/h52Raf6ZzDNB9EqdluM7ZxCQv5BPu4QvLO0LOB3OBbTGCNd/of63RcRzH6YyWq6OYq3fPz3Ecx1mdHew/21MLRbulNjmO4zj/GQMqPhVizIC/33xzHMdxnM1ooZBjQBvtcBzHcRzHcRzHcRzHcRzHcRzHcRzHcRzHcRzHcRzH+Vz+Ad8nwVEOBsgFAAAAAElFTkSuQmCC\" alt=\"sigma(12) = 1+2+3+4+6+12 = 28\" style=\"width: 227.5px; height: 19px;\" width=\"227.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 7.91667px; transform-origin: 3.88333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The totient of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 95.2917px 7.91667px; transform-origin: 95.2917px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e counts the numbers less than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 84.4px 7.91667px; transform-origin: 84.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that are relatively prime to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 44.725px 7.91667px; transform-origin: 44.725px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. For example \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAmCAYAAAAIjkMFAAADhUlEQVR4nO2bcZGzMBDFnwccYKAGUFAFOKiDOsACGioBD7VQDbVw3x/hTbf5CNksORp6+c0wN9NL0rB52ewuFKhUKpVKpVKpVAqkn68SGAG0n57EX6SHM76Wbr60nABcAFznK9a3BXCf+30jDXR22JUewKRs281tf+AWNkYr2vtXbKFPAB74Ts+QYsNdOAF4Im7spQWN3UQzj81Fn+AWVo7xwLoY+rnvN3GB3oa78YBz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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: 68.5083px 7.91667px; transform-origin: 68.5083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e because the greatest common divisor of 12 and four numbers (1, 5, 7, 11) is 1. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 7.91667px; transform-origin: 384px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhat happens if you repeatedly apply the two functions, starting with the sum of divisors and alternating? For example, start with 7. Then \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvMAAAAmCAYAAABJaRRiAAAQC0lEQVR4nO2d63Hr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hmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYxkz8B+9eXgSCQ2hrAAAAAElFTkSuQmCC\" alt=\"sigma(7) = 8, phi(8) = 4, sigma(4) = 7, phi(7) = 6, sigma(6) = 12, phi(12) = 4, \" style=\"width: 377.5px; height: 19px;\" width=\"377.5\" height=\"19\"\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: 13.2167px 7.91667px; transform-origin: 13.2167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e etc.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 117.458px 7.91667px; transform-origin: 117.458px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand the pattern 7, 6, 12, 4 will repeat. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 258.3px 7.91667px; transform-origin: 258.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOscillating behavior is plausible because the sum of divisors is always greater than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 120.45px 7.91667px; transform-origin: 120.45px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and the totient is always smaller than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 360.958px 7.91667px; transform-origin: 360.958px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Furthermore, because the totient has a minimum value and the sum of divisors has a maximum value, with enough iterations the sequence would have to hit a repeating pattern.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.4px 7.91667px; transform-origin: 383.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes an initial seed and returns the repeating pattern and the index of the sequence where the pattern begins. With an initial seed of 7, the sequence would be 7, 8, 4, 7, 6, 12, 4, 7, 6, 12,… Therefore, the repeating pattern is [7 6 12 4] and the start index is 3.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q,n0] = sigPhi(n)\r\n%  n  = initial seed\r\n%  q  = vector of repeating pattern\r\n%  n0 = index where the repeating pattern starts (counting the initial seed as index 1)\r\nend","test_suite":"%%\r\nn = 2;\r\nq_correct = [2 3];\r\nn0_correct = 1;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 3;\r\nq_correct = [2 3];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7;\r\nq_correct = [4 7 6 12];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 12;\r\nq_correct = [12 28];\r\nn0_correct = 1;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 28;\r\nq_correct = [24 60 16 31 30 72];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 101;\r\nq_correct = [72 195 96 252];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 127;\r\nq_correct = [96 252 72 195];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 256;\r\nq_correct = [432 1240 480 1512];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 777;\r\nq_correct = [576 1651 1512 4800 1280 3066 864 2520];\r\nn0_correct = 3;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 1111;\r\nq_correct = [432 1240 480 1512];\r\nn0_correct = 7;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 5555;\r\nq_correct = [10368 30855 14080 36792];\r\nn0_correct = 23;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7777;\r\nq_correct = [3024 9920 3840 12264 3456 10200 2560 6138 1800 6045 2880 9906];\r\nn0_correct = 11;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 11111;\r\nq_correct = [3024 9920 3840 12264 3456 10200 2560 6138 1800 6045 2880 9906];\r\nn0_correct = 11;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 77777;\r\nq_correct = [10368 30855 14080 36792];\r\nn0_correct = 27;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 123456;\r\nq_correct = [184320 638898 196560 833280];\r\nn0_correct = 21;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 666666;\r\nq_correct = [1658880 5946666 1801800 8124480];\r\nn0_correct = 39;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))\r\n\r\n%%\r\nn = 7777777;\r\nq_correct = [191102976000 715162215924 207622711296 859454668800 178362777600 757256331104 283740364800 1100946774480 233003796480 1053092362140 221908377600 1035248323200 204838502400 888208962000 214695936000 952677206208 237283098624 859638312960 185794560000 792731088600 178886400000 749337039360 150493593600 639777817224 152374763520 626874655824 202491394560 925865740800 167215104000 715161022368 219847799808 880002352320 161864220672 609720615224 247328774784 987821856000];\r\nn0_correct = 161;\r\n[q,n0] = sigPhi(n);\r\nassert(isequal(q,q_correct) \u0026\u0026 isequal(n0,n0_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":46909,"edited_by":46909,"edited_at":"2022-11-28T04:11:02.000Z","deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2021-05-10T14:27:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-09T19:28:03.000Z","updated_at":"2026-01-14T13:15:59.000Z","published_at":"2021-05-09T19:36:55.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/46898\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eCody Problem 46898\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e deals with the sum of divisors function, denoted by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, while \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/656\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eCody Problem 656\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e deals with the totient function, denoted by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"phi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\varphi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The sum of divisors is straightforward: for 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(12) = 1+2+3+4+6+12 = 28\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(12) = 1+2+3+4+6+12 = 28\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The totient of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e counts the numbers less than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that are relatively prime to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. For 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"phi(12) = 4\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\varphi(12) = 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e because the greatest common divisor of 12 and four numbers (1, 5, 7, 11) is 1. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhat happens if you repeatedly apply the two functions, starting with the sum of divisors and alternating? For example, start with 7. Then \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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"sigma(7) = 8, phi(8) = 4, sigma(4) = 7, phi(7) = 6, sigma(6) = 12, phi(12) = 4, \\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\sigma(7) = 8, \\\\varphi(8) = 4, \\\\sigma(4) = 7, \\\\varphi(7) = 6, \\\\sigma(6) = 12, \\\\varphi(12) = 4,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e etc.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand the pattern 7, 6, 12, 4 will repeat. \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\u003eOscillating behavior is plausible because the sum of divisors is always greater than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and the totient is always smaller than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Furthermore, because the totient has a minimum value and the sum of divisors has a maximum value, with enough iterations the sequence would have to hit a repeating pattern.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that takes an initial seed and returns the repeating pattern and the index of the sequence where the pattern begins. With an initial seed of 7, the sequence would be 7, 8, 4, 7, 6, 12, 4, 7, 6, 12,… Therefore, the repeating pattern is [7 6 12 4] and the start index is 3.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"divisors\"","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:\"divisors\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"divisors\"","","\"","divisors","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7727d03fe0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7727d03900\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7727d021e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7727d04440\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7727d043a0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7727d04300\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7727d04080\u003e":"tag:\"divisors\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7727d04080\u003e":"tag:\"divisors\""},"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:\"divisors\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"divisors\"","","\"","divisors","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7727d03fe0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7727d03900\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7727d021e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7727d04440\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7727d043a0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7727d04300\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7727d04080\u003e":"tag:\"divisors\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7727d04080\u003e":"tag:\"divisors\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":43755,"difficulty_rating":"easy"},{"id":49327,"difficulty_rating":"easy"},{"id":44748,"difficulty_rating":"easy-medium"},{"id":45794,"difficulty_rating":"easy-medium"},{"id":1933,"difficulty_rating":"easy-medium"},{"id":60935,"difficulty_rating":"easy-medium"},{"id":42791,"difficulty_rating":"easy-medium"},{"id":59841,"difficulty_rating":"medium"},{"id":2664,"difficulty_rating":"medium"},{"id":46898,"difficulty_rating":"medium"},{"id":51715,"difficulty_rating":"medium"}]}}