{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-05-26T00:16:20.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":"2026-05-26T00: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":8071,"title":"summation of the reciprocals ","description":"Determine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers. \r\n\r\nreference:( \u003chttp://en.wikipedia.org/wiki/Kempner_series\u003e )\r\n\r\nFor example:\r\n\r\nif N = 2 and K = 7 \r\n\r\nthe matrix are as following:\r\n\r\n    10    20    30    40    50    60    80    90\r\n    11    21    31    41    51    61    81    91\r\n    12    22    32    42    52    62    82    92\r\n    13    23    33    43    53    63    83    93\r\n    14    24    34    44    54    64    84    94\r\n    15    25    35    45    55    65    85    95\r\n    16    26    36    46    56    66    86    96\r\n    18    28    38    48    58    68    88    98\r\n    19    29    39    49    59    69    89    99\r\n\r\nouput then can be the summation of the reciprocals of above matrix\r\n\r\noutput = 2.01554407485017\r\n\r\nSo, give the input N and K, determine the output as mentioned above  \r\n\r\n\r\n\r\n\r\n\r\n ","description_html":"\u003cp\u003eDetermine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers.\u003c/p\u003e\u003cp\u003ereference:( \u003ca href = \"http://en.wikipedia.org/wiki/Kempner_series\"\u003ehttp://en.wikipedia.org/wiki/Kempner_series\u003c/a\u003e )\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cp\u003eif N = 2 and K = 7\u003c/p\u003e\u003cp\u003ethe matrix are as following:\u003c/p\u003e\u003cpre\u003e    10    20    30    40    50    60    80    90\r\n    11    21    31    41    51    61    81    91\r\n    12    22    32    42    52    62    82    92\r\n    13    23    33    43    53    63    83    93\r\n    14    24    34    44    54    64    84    94\r\n    15    25    35    45    55    65    85    95\r\n    16    26    36    46    56    66    86    96\r\n    18    28    38    48    58    68    88    98\r\n    19    29    39    49    59    69    89    99\u003c/pre\u003e\u003cp\u003eouput then can be the summation of the reciprocals of above matrix\u003c/p\u003e\u003cp\u003eoutput = 2.01554407485017\u003c/p\u003e\u003cp\u003eSo, give the input N and K, determine the output as mentioned above\u003c/p\u003e","function_template":"function output = sum_reciprocals(N,K)\r\n  output  = [];\r\nend","test_suite":"%%\r\nN = 2;\r\nK = 7;\r\nassert(abs(sum_reciprocals(N,K)-2.01554407485016762)\u003c1e-8)\r\n%%\r\nN = 5;\r\nK = 7;\r\nassert(abs(sum_reciprocals(N,K)-1.440856832360981609753)\u003c1e-8)\r\n%%\r\nN = 8;\r\nK = 9;\r\nassert(abs(sum_reciprocals(N,K)-1.0714523172876426748)\u003c1e-8)\r\n%%\r\nN = 2:8;\r\nK = 9;\r\nM = arrayfun(@(x)sum_reciprocals(x,K),N);\r\nR = spline(N,M,[3.3 5.93]);\r\nassert(all(abs(R-[1.7588093884770861, 1.3325666476222477463])\u003c1e-8))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":13709,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":"2015-04-08T14:05:58.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-04-08T11:21:46.000Z","updated_at":"2026-05-28T04:49:03.000Z","published_at":"2015-04-08T11:21:54.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\u003eDetermine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ereference:(\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Kempner_series\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Kempner_series\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eif N = 2 and K = 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethe matrix are as following:\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[    10    20    30    40    50    60    80    90\\n    11    21    31    41    51    61    81    91\\n    12    22    32    42    52    62    82    92\\n    13    23    33    43    53    63    83    93\\n    14    24    34    44    54    64    84    94\\n    15    25    35    45    55    65    85    95\\n    16    26    36    46    56    66    86    96\\n    18    28    38    48    58    68    88    98\\n    19    29    39    49    59    69    89    99]]\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\u003eouput then can be the summation of the reciprocals of above matrix\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\u003eoutput = 2.01554407485017\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, give the input N and K, determine the output as mentioned above\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"problems":[{"id":8071,"title":"summation of the reciprocals ","description":"Determine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers. \r\n\r\nreference:( \u003chttp://en.wikipedia.org/wiki/Kempner_series\u003e )\r\n\r\nFor example:\r\n\r\nif N = 2 and K = 7 \r\n\r\nthe matrix are as following:\r\n\r\n    10    20    30    40    50    60    80    90\r\n    11    21    31    41    51    61    81    91\r\n    12    22    32    42    52    62    82    92\r\n    13    23    33    43    53    63    83    93\r\n    14    24    34    44    54    64    84    94\r\n    15    25    35    45    55    65    85    95\r\n    16    26    36    46    56    66    86    96\r\n    18    28    38    48    58    68    88    98\r\n    19    29    39    49    59    69    89    99\r\n\r\nouput then can be the summation of the reciprocals of above matrix\r\n\r\noutput = 2.01554407485017\r\n\r\nSo, give the input N and K, determine the output as mentioned above  \r\n\r\n\r\n\r\n\r\n\r\n ","description_html":"\u003cp\u003eDetermine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers.\u003c/p\u003e\u003cp\u003ereference:( \u003ca href = \"http://en.wikipedia.org/wiki/Kempner_series\"\u003ehttp://en.wikipedia.org/wiki/Kempner_series\u003c/a\u003e )\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cp\u003eif N = 2 and K = 7\u003c/p\u003e\u003cp\u003ethe matrix are as following:\u003c/p\u003e\u003cpre\u003e    10    20    30    40    50    60    80    90\r\n    11    21    31    41    51    61    81    91\r\n    12    22    32    42    52    62    82    92\r\n    13    23    33    43    53    63    83    93\r\n    14    24    34    44    54    64    84    94\r\n    15    25    35    45    55    65    85    95\r\n    16    26    36    46    56    66    86    96\r\n    18    28    38    48    58    68    88    98\r\n    19    29    39    49    59    69    89    99\u003c/pre\u003e\u003cp\u003eouput then can be the summation of the reciprocals of above matrix\u003c/p\u003e\u003cp\u003eoutput = 2.01554407485017\u003c/p\u003e\u003cp\u003eSo, give the input N and K, determine the output as mentioned above\u003c/p\u003e","function_template":"function output = sum_reciprocals(N,K)\r\n  output  = [];\r\nend","test_suite":"%%\r\nN = 2;\r\nK = 7;\r\nassert(abs(sum_reciprocals(N,K)-2.01554407485016762)\u003c1e-8)\r\n%%\r\nN = 5;\r\nK = 7;\r\nassert(abs(sum_reciprocals(N,K)-1.440856832360981609753)\u003c1e-8)\r\n%%\r\nN = 8;\r\nK = 9;\r\nassert(abs(sum_reciprocals(N,K)-1.0714523172876426748)\u003c1e-8)\r\n%%\r\nN = 2:8;\r\nK = 9;\r\nM = arrayfun(@(x)sum_reciprocals(x,K),N);\r\nR = spline(N,M,[3.3 5.93]);\r\nassert(all(abs(R-[1.7588093884770861, 1.3325666476222477463])\u003c1e-8))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":13709,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":"2015-04-08T14:05:58.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-04-08T11:21:46.000Z","updated_at":"2026-05-28T04:49:03.000Z","published_at":"2015-04-08T11:21:54.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\u003eDetermine the summation of the reciprocals of numbers with length equal to N,in the meanwhile there is a digit K excluded from the numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ereference:(\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Kempner_series\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Kempner_series\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eif N = 2 and K = 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethe matrix are as following:\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[    10    20    30    40    50    60    80    90\\n    11    21    31    41    51    61    81    91\\n    12    22    32    42    52    62    82    92\\n    13    23    33    43    53    63    83    93\\n    14    24    34    44    54    64    84    94\\n    15    25    35    45    55    65    85    95\\n    16    26    36    46    56    66    86    96\\n    18    28    38    48    58    68    88    98\\n    19    29    39    49    59    69    89    99]]\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\u003eouput then can be the summation of the reciprocals of above matrix\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\u003eoutput = 2.01554407485017\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, give the input N and K, determine the output as mentioned above\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\"}]}"}],"errors":[],"facets":[[],[{"value":"medium","count":1,"selected":false}]],"term":"tag:\"reciprocal\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}