{"group":{"group":{"id":10568,"name":"Special Functions","lockable":false,"created_at":"2020-11-26T09:42:42.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"MATLAB provides some special functions sunch as gamma. But some special function such as zeta are not given directly as a function. Can you finish them? ","is_default":false,"created_by":3668,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":3645,"published":true,"community_created":true,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB provides some special functions sunch as gamma. But some special function such as zeta are not given directly as a function. Can you finish them? \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 289.5px 21px; transform-origin: 289.5px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 266.5px 21px; text-align: left; transform-origin: 266.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMATLAB provides some special functions sunch as gamma. But some special function such as zeta are not given directly as a function. Can you finish them? \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2020-11-26T10:23:44.000Z"},"current_player":null},"problems":[{"id":46025,"title":"Evaluate the gamma function","description":"The gamma function is a generalization of the factorial, and it appears in many applications such as evaluating certain integrals, working with probability distributions, and evaluating fractional derivatives. MATLAB includes the function gamma, but it accepts only real arguments.\r\nWrite a function that evaluates the gamma function for complex arguments.","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: 93.3333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 46.6667px; transform-origin: 407.5px 46.6667px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63.3333px; 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: 384.5px 31.6667px; text-align: left; transform-origin: 384.5px 31.6667px; 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: 12.0583px 7.66667px; transform-origin: 12.0583px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 7.66667px; transform-origin: 1.94167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://mathworld.wolfram.com/GammaFunction.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003egamma function\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: 302.642px 7.66667px; transform-origin: 302.642px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a generalization of the factorial, and it appears in many applications such as evaluating certain integrals, working with probability distributions, and evaluating fractional derivatives. MATLAB includes the function\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 7.66667px; transform-origin: 1.94167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 19.25px 7.66667px; transform-origin: 19.25px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 19.25px 8px; transform-origin: 19.25px 8px; \"\u003egamma\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 7.66667px; transform-origin: 3.88333px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, but it accepts only real arguments.\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: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 232.467px 7.66667px; transform-origin: 232.467px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that evaluates the gamma function for complex arguments.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = gamma2(z)\r\n  y = f(z);\r\nend","test_suite":"%%\r\nz = 3+2i;\r\ny = gamma2(z);\r\ny_correct = -0.4226372863112003 + 0.871814255696503i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = 1+i;\r\ny = gamma2(z);\r\ny_correct = 0.4980156681183556 -0.1549498283018104i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = (1+i)/2;\r\ny = gamma2(z);\r\ny_correct = 0.818163995 - 0.7633138287i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = i;\r\ny = gamma2(z);\r\ny_correct = -0.154949828301810 - 0.4980156681183566i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = 5i;\r\ny = gamma2(z);\r\ny_correct = -0.00027170388350615125 + 0.0003399328988721375i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = 1/2 + 14.1i;\r\ny = gamma2(z);\r\ny_correct = -2.0555298837259187e-10 - 5.667644214210669e-10i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = -1+i;\r\ny = gamma2(z);\r\ny_correct = -0.1715329199082727 + 0.3264827482100833i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = -2-3i;\r\ny = gamma2(z);\r\ny_correct = -0.0001631724182726072 - 0.001128495917017955i;\r\nassert(abs((real(y)-real(y_correct))/real(y_correct)) \u003c 1e-6)\r\nassert(abs((imag(y)-imag(y_correct))/imag(y_correct)) \u003c 1e-6)\r\n\r\n%%\r\nz = 10*(rand+0.02);\r\ny_correct = gamma(z);\r\nassert(abs(gamma2(z)-y_correct)/y_correct \u003c 1e-6)\r\n\r\n%%\r\nfiletext = fileread('gamma2.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || contains(filetext, 'system'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":9,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2022-01-30T20:31:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-07-04T16:14:47.000Z","updated_at":"2026-01-09T11:39:54.000Z","published_at":"2020-07-05T04:43:57.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\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://mathworld.wolfram.com/GammaFunction.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003egamma function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a generalization of the factorial, and it appears in many applications such as evaluating certain integrals, working with probability distributions, and evaluating fractional derivatives. MATLAB includes the function\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003egamma\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, but it accepts only real arguments.\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 evaluates the gamma function for complex arguments.\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":46111,"title":"Evaluate the prime zeta function","description":null,"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: 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: 126.417px 7.79167px; transform-origin: 126.417px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn its original definition, the zeta function \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAAlCAYAAAATO/pmAAACVklEQVRoge2YUbGDMBBFjwccYAADVYCCOqgDHNRCNSABD7WABizwPpZb0j6g2ST948y8eR0mhN3k7mazcHJycvJOBTSZ79eFbNnlkvl+BQzkO9oD10xbNmmBJ3DfeN4Rt8IlnAx5UtjZFpiX/+GzcXk+A7dIw2LGxVItNpRaOAbMmXqZ/MHq4IzJ6Bv3ZZ7SaMGrEpN1mEMDtitycCROOvUyPje+9xj4H1LJXIEJc+6GTy4PfrOb4sqquGwexEn0E+3mTzJkwIQpL4s7JtkUbhRc7QN6TG3JtNhqpQb7kGBAgy1QhymhXuw4ChflkaQFrTEn228DD1ASi0UZfcCSlxz4PN4+uUSM2aUnLS6F4jM2I8rYmXcF3Tee7b3rjlO9mHMYez8e7l743Ybv4VPhW9QXA3m7CX5HVYHNmIRDYrK2N0xeksuJTUiTU1hWeo8kt6M38jKtSHE0jNMJXzW1pYRDVOrl0pCWIMJYfRK34EnJaKSMoxBf9H+ii0SshOWoS+6STYkbwZPvi6YzMySUcEwmVQXmOiXC61fuXU9n4BEj25Lz3HUf2Oa46IOPhImhXwzyOK84PcrguvKFClLmn4gr6yaciUjGTfx3NvzzdArGAyPkkBTUsrZtYrNuVnFTYYHdsZaC+r21A0fovrg1XgU7i6EdazEfO//P7rsqvD3JqmgXIECh8ZNrYIf/+NFNqFgja6FYw63mvZ2pzlvK5A0FG1mYQtwJaA8lJbUqcouJCybjXGevFHQS3rt+KppzjWzI6yHVlO0PA+aU2hql4+vk5OTkxR+y5cyLRnUL3QAAAABJRU5ErkJggg==\" alt=\"zeta(s)\" style=\"width: 29px; height: 18.5px;\" width=\"29\" height=\"18.5\"\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: 226.233px 7.79167px; transform-origin: 226.233px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which is important in number theory, is the sum of the reciprocals of the positive integers raised to the power \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);\"\u003es\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: 17.8833px 7.79167px; transform-origin: 17.8833px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 61.0667px 7.79167px; transform-origin: 61.0667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eprime zeta function \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAAlCAYAAAD8+ZFYAAACTUlEQVRoge2YbZGEMAyGHw84wAAGUICCdYADHKyF1YCE9YAFNGDh7gfNkPZo6Rf3i2eGuTm2tEmbpG8LDw8PD3F0QFPwfVv4/b/xAj6FfXTA1/ytQg9MEU+f0GcNR4UWWKnocAcswI96vuxOvoHNvNvM/yEGY1zN8Otq9zlxOLo6vzXYk+FbtZZ9QlKiIJY3MNfq7EPYmQF75c/C6sMeEXfQsE/kUKOzlcORl6eNdtYdtDXv71hV4cPfqEtGDJWn9bTTbcY7DLmgo8KEvvDnqya0shv1KnCI4nFmDid81Vbn7IZdGXvC4e9Db3uD6XMkXHW/FEaQbC1nKyboajw5v0kljw0vXd3f5js94SFnp4g2XmRVfAM1jiFn5V8qeawBYvDivF9O3vm+zcpbvb9u2Kpp5lj1lb9FSfiaNrFIe1cojFxvXZJOWVuQKxZcmTjgr85CqrNvNabO85brFZNIdFPpkgY7hHNLeqqzeqvbSNO92c66FTaXVGfBTp+F6+gRciu/JRFLdKcUsFRkkkJ62yW7QMVIxBQDUo9honevlNvZWLGRABzSK2UgH7EV0hUjYIdzTIWVHSKJUQ1Sqmml0IWKhu+goPf5mMhYyUg5nS9XB/IYZsKCQJxyDRVdfiUm4IjGpJTTqyoDlV57iNG+dNCHDZGIL/aQjL2FmEgM4Vr3TGes+KOk55jQAVu0pPSfvL/eRc8+8yXFzsfI/eflZKreFRnkbqvaDWNNZvyHhhwWynTArTTsiqiGgbX6uZ2JsrvegXsv8B4eHh7+j1+w0exGXMhTLwAAAABJRU5ErkJggg==\" alt=\"P(s)\" style=\"width: 29.5px; height: 18.5px;\" width=\"29.5\" height=\"18.5\"\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: 110.45px 7.79167px; transform-origin: 110.45px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the sum of the reciprocals of the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.0083px 7.79167px; transform-origin: 21.0083px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eprimes\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 30.725px 7.79167px; transform-origin: 30.725px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e raised to the power \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);\"\u003es\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.79167px; transform-origin: 3.88333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. \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: 183.2px 7.79167px; transform-origin: 183.2px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEvaluate the prime zeta function for the specified values 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);\"\u003es\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: 128.367px 7.79167px; transform-origin: 128.367px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which are positive and greater than one.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function P = PrimeZeta(s)\r\n  P = f(s);\r\nend","test_suite":"%%\r\ns = 1.39943332872633;\r\nP_rounded = 1;\r\nassert(isequal(round(PrimeZeta(s),4),P_rounded))\r\n\r\n%%\r\ns = 2;\r\nP_correct = 0.4522474200410654985065;\r\nassert(abs(PrimeZeta(s)-P_correct) \u003c 2e-10)\r\n\r\n%%\r\ns = 3;\r\nP_correct = 0.1747626392994435364;\r\nassert(abs(PrimeZeta(s)-P_correct) \u003c 1e-12)\r\n\r\n%%\r\ns = 4;\r\nP_correct = 0.07699313976424684494;\r\nassert(abs(PrimeZeta(s)-P_correct) \u003c 1e-13)\r\n\r\n%%\r\ns = 5;\r\nP_correct = 0.0357550174839242571;\r\nassert(abs(PrimeZeta(s)-P_correct) \u003c 1e-15)\r\n\r\n%%\r\ns = 9;\r\nP_correct = 0.002004467574962450;\r\nassert(abs(PrimeZeta(s)-P_correct) \u003c 1e-15)\r\n\r\n%%\r\ns = 6;\r\nstr = num2str(PrimeZeta(s));\r\nP_correct = 0.007878441974176;\r\nassert(abs(PrimeZeta(str2num(str(end-2:end))/100)-P_correct) \u003c 1e-12)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2020-12-31T19:12:56.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-08-06T19:51:40.000Z","updated_at":"2026-01-09T11:53:30.000Z","published_at":"2020-08-06T21:33:21.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\u003eIn its original definition, the zeta function \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=\\\"zeta(s)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\zeta(s)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, which is important in number theory, is the sum of the reciprocals of the positive integers raised to the power \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=\\\"s\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprime zeta function \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=\\\"P(s)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eP(s)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is the sum of the reciprocals of the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprimes\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e raised to the power \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=\\\"s\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEvaluate the prime zeta function for the specified values 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=\\\"s\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, which are positive and greater than one.\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":46117,"title":"Test approximations of the prime counting function","description":null,"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: 162.817px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 81.4083px; transform-origin: 407px 81.4083px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 90px; 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 45px; text-align: left; transform-origin: 384px 45px; 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/241\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 241\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: 61.4583px 7.79167px; transform-origin: 61.4583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which is based on \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://projecteuler.net/problem=7\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 7\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: 73.1083px 7.79167px; transform-origin: 73.1083px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, asks us to identify the \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: 91px 7.79167px; transform-origin: 91px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eth prime number. That is, the problem seeks the inverse of the prime counting function \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAlCAYAAAAa0FocAAACX0lEQVRoge2YXZGDMBSFPw84wAAGUFAFdYADHNRCNSChHmoBDVjoPoSzvaVJubCkywNnhtmZpHv/cnJuEjhw4MCBPKiAYiNb5Ya2suIMXDe0VwG38e9usXXSQgn07DT5EyG4XLSsMttfhRIYgDqznwvQZfaxCFfCPsyNglDg0xd8zaIEHuRfbeFKoPy/49uBVHy30EkM5FHyrD5LQgtqHV+sldSE6p8X+KzH31t7JdB88DPFjZUsKwgVeyz4yoidFh/trsA9Ya+djA8JXzG/i1pbMQbREyonh7fxU4C9GUvRSsXzBFBMfOn/b4REL2Z+TrW9BX/BjUAreAqFbUXNONY6bT2cfqX+D560tj1ZyQzMF/KEr0C/KHjdQ1qxxoz145h3r3kTP/NM/Mz7KUy2POcBaYtncd5gqac9JQZ4hWNJ4iryMNqf0nTgfRFS+FPiorStsPbZxWljSeJKLBZwbeY8TFvTTX4hStsgFJxXNDp8iYtJKTa1H+ZiWCVuEK+wBMMjLtMA5lbJtqzYKqmTeA8lsjfX9t4git7NWBcZu8wY96qrEhsic1ZrZGcuoS5hK4mSZ4LT6ov6olvDaxFiUNCfRMYmFltRqb2YVjn89iy4nlp6T1eWyZw+zx7qZgIVK1L2LNP02PBp60gv3MJm++gQMW6Z4G0r1m6KnraNxbTDHp09jxktC2kOofpNIsiC54lqqWj0pFugLkGpFSrG+QafqPas7N85UOO7XPwVDTt5hLDI/R6md71dvrR2+LVhKe6sPKl9A7rnbx1gDptZ0LLd+/eJHbyvHThw4MC/4wdzuO6gMG8oWgAAAABJRU5ErkJggg==\" alt=\"pi(n)\" style=\"width: 31px; height: 18.5px;\" width=\"31\" height=\"18.5\"\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: 185.15px 7.79167px; transform-origin: 185.15px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which provides the number of primes less than or equal 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: 17.8833px 7.79167px; transform-origin: 17.8833px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://mathworld.wolfram.com/PrimeNumberTheorem.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime Number Theorem\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: 87.9px 7.79167px; transform-origin: 87.9px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e gives approximate forms of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAlCAYAAAAa0FocAAACX0lEQVRoge2YXZGDMBSFPw84wAAGUFAFdYADHNRCNSChHmoBDVjoPoSzvaVJubCkywNnhtmZpHv/cnJuEjhw4MCBPKiAYiNb5Ya2suIMXDe0VwG38e9usXXSQgn07DT5EyG4XLSsMttfhRIYgDqznwvQZfaxCFfCPsyNglDg0xd8zaIEHuRfbeFKoPy/49uBVHy30EkM5FHyrD5LQgtqHV+sldSE6p8X+KzH31t7JdB88DPFjZUsKwgVeyz4yoidFh/trsA9Ya+djA8JXzG/i1pbMQbREyonh7fxU4C9GUvRSsXzBFBMfOn/b4REL2Z+TrW9BX/BjUAreAqFbUXNONY6bT2cfqX+D560tj1ZyQzMF/KEr0C/KHjdQ1qxxoz145h3r3kTP/NM/Mz7KUy2POcBaYtncd5gqac9JQZ4hWNJ4iryMNqf0nTgfRFS+FPiorStsPbZxWljSeJKLBZwbeY8TFvTTX4hStsgFJxXNDp8iYtJKTa1H+ZiWCVuEK+wBMMjLtMA5lbJtqzYKqmTeA8lsjfX9t4git7NWBcZu8wY96qrEhsic1ZrZGcuoS5hK4mSZ4LT6ov6olvDaxFiUNCfRMYmFltRqb2YVjn89iy4nlp6T1eWyZw+zx7qZgIVK1L2LNP02PBp60gv3MJm++gQMW6Z4G0r1m6KnraNxbTDHp09jxktC2kOofpNIsiC54lqqWj0pFugLkGpFSrG+QafqPas7N85UOO7XPwVDTt5hLDI/R6md71dvrR2+LVhKe6sPKl9A7rnbx1gDptZ0LLd+/eJHbyvHThw4MC/4wdzuO6gMG8oWgAAAABJRU5ErkJggg==\" alt=\"pi(n)\" style=\"width: 31px; height: 18.5px;\" width=\"31\" height=\"18.5\"\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: 29.5583px 7.79167px; transform-origin: 29.5583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for large \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: 96.8583px 7.79167px; transform-origin: 96.8583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Two such approximations are \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAlCAYAAACu2qwTAAADf0lEQVRoge1a0ZGDIBTcHuyABmzAClJBOkgHdpAWrCElXA9pwRpsIfeBO3lHEB6oaObYmcxczggP9rHsQ4GKioqKih3QHh1AxTIaABOA7uhAFNgyRgM79tPjCmA8OggFBthYt0IL4AdfoB4PAHflb1sANwDP+b5S2JocwsAm52lJMgBeiAdoYAkZ59+/UI6g+859tbDjOqXc3ZAmbyS0FEEX2P1x78nbOwmy8YQlKQUlCRoB9AX6oVG6FOhLDa4Gk3hfKYKuKLN6iAEnM0t3WBeTilIEjbCTVgot7LhOU26MyHNGMYKaud3O+d7DyqlmxXKy9nBuIUxYkRQtrEZKnZSDT9HPDnYCcuTDR1ADO/kPcf2Gt0y9xEdja3uky2839yfbNnMcvaJPwCpKkszd5pvkAJlVdDjympakAfmZskSQgZVNSYQsBDtxLSatHHMMA6zRkXNAUnvn/xPihPOe5MRlENw0Wf13sKQwCG3BucaxhCROkjDgc6BcYbHNf4QdswYNPokf5r/dpImNmQQl70MsEB/zzbKwkpOiaZiykwstQT77LrM6JDmaVUbI2oxyJmNjnxpHyGRPSl43AK6cnACAtKMdH85G0FW0SWWR80C51LTH+JNqLxnAiM+BUzY0tpdysObs6WwEDXgnqJu8wHuf1hTkWQRJZ+QLOjQhLlKPdnw4G0HSKLkTK+PRJCV/n2TvGcDk6UQGoLGkOUc7LkoQNEFHEOslqstSf9qkTDYJrityQYeiCSD3aMdFCYJ+oDMysj1f1tP9akuK5PpLWkTfgBgAN/1Qw3forWsIJQjiuGOmR5YfLqT9piuLTfxjoa1oAL4VIt1dNwcUekKYe7TjogRBtLshqZEE+FYIzRXdbYt4go5IOGOUAfhcxU1cN3PnSwRQq9eeDMuYcgiKKYLEhHA5IAt0H5E0V0+8H8qF+kw+/5P22heAvB5zcQPWnz4bvC0tM9M9F5SO84m/ktLhr+PynTS4MYf2Vmmvfe24scY2/h6J8tbNN4U8OSvnmLaufRhlRCzuh4mxdL0N3B9KKkr4Utw8JF7K+Eb0oVGOUg8HP8BD1W9Ej22MTQxb1IfZeKDsg6+tsUXtFoKBv8Ysgi2Odo5Gg31fjQqZq93xLS8lxmCwz0uGe71vp8YTB218O4Cb/la44OD3D7Y62qnYCS3WPfepqKioqPg/+AVFtJvsMIygjwAAAABJRU5ErkJggg==\" alt=\"n/ln(n)\" style=\"width: 52px; height: 18.5px;\" width=\"52\" height=\"18.5\"\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: 27.225px 7.79167px; transform-origin: 27.225px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Logarithmic_integral_function#Offset_logarithmic_integral\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"perspective-origin: 77.675px 7.79167px; transform-origin: 77.675px 7.79167px; \"\u003eoffset logarithmic integral\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAAlCAYAAABm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NAZjha+W/GV5j+hSbba/B8LRLNdZ7ZngPWpnUkvyC4WNGLI0RPnZr+LcNv4NsD/0SKRoDKGd4Sux9w/Cx8yOixiy99HyM3oCu4VuJqLYaPlbj+f9NNTtQOGlHrwEulRNalpOEXTkMn7JmWWuWXnIeiAtztQ3fQkS11fBURuxUYqvZgQ0apxh+6aUUieGl2XJNw1MvnGK6lrP0QNzqhKbhXyvl1IaG4WNXgDrIzB6KGpI1jjU89U7zCkkMT0sJITQNn5oU+TYahpfqDegZvhf+rgY0DB+jcQfXOYTW7a+B3yRrHPs+PN/iOp+XSgxPo23oOqEGxnfihYxMHztoDXpXeovhpXoD/ufHd+JJXuxISiYVpoOO4aUak9kpn7R20GYfn35JGu8w3hA/1irCf8N3uHWYjrihcCX0al+H6V76+c4veh+Yzi/txONlvdDGaEPQ+wTzHAC/x0PgPEfyKuX8+fHOvMf0Qw1LO/E4d9QfztOWcF+b1dSYm11ySD6kEaWx5Jt2kuUP3xx3zWQUYq+J55sHr13Pd61WXtUkfLp3gvNzQnqvtQV6xjHXKvmxjVQkbVZbY/o2nkbOpwWNP7gj/5dlaS90a2/J5aCE3oAbdVJWQ34B09hDie/NXVB/aFmKEnofEP480y9jGgegd65zVL7FzybnJqfe9Aptaysh2pjGAfZwoZCmQJSMNLN/kkPvnN+7bxHTOMAOuvPstcSK4dDWO+ZzY/8F09gwDMMwDMMwDMMwDMMwjCl/+3GdfYQc30QAAAAASUVORK5CYII=\" alt=\"Li(n) = li(n) - li(2)\" style=\"width: 126px; height: 18.5px;\" width=\"126\" height=\"18.5\"\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: 24.8917px 7.79167px; transform-origin: 24.8917px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u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igtPakb3kXbYspHDi1ZpbYlsCzVE4j3Z2CK1ciLUxkE3j/3/DQOcyLNrQe+p4oNOnQRt9gT3aOeBIwSUNDs1DJpIzTKlBjRaoArHXvcBntD2VRdTqmqiQu1WP+8rzPS5yJ7gYJmQ0rXcM5t/IY62PNxUqUFyB1sVUHXZg14MmINa7UlcQX6nwS9NNXz0xQ5rRNTILjKNu1Q3tIwGPNtYgamwAn5L4LmIfp7h/EfbXswL6Lq9jyh7Hw65eTR2jngbxCJAr04r0sR9N6p0sVUwiBiLgzoVS1m4y/yT7tKUTNq7Qqdy3huQzPCX+NBCDmUSvU0jI8gR1Yp3tB6OtdE3fml/FM3e6bF90TqjX8K1255DBPXPn3uFg2A68Zx9465aIZRAScMo2uHeHSXf4uKyyLMId5zVNgw/jVM6O8QzswyDMMwDMMwDMMwDMMwDMMwDMMwDMPYml8KELv7nlwFLgAAAABJRU5ErkJggg==\" alt=\"li(x) = integral of 1/ln(t) from t = 0 to t = infinity\" style=\"width: 122px; height: 27px;\" width=\"122\" height=\"27\"\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: 18.6667px 7.79167px; transform-origin: 18.6667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (See \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/46066-evaluate-the-logarithmic-integral\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 46066\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: 4.275px 7.79167px; transform-origin: 4.275px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63.8167px; 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.9083px; text-align: left; transform-origin: 384px 31.9083px; 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: 160.642px 7.79167px; transform-origin: 160.642px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTest these approximations by computing two ratios: \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAAoCAYAAAAR+iSJAAAGTElEQVR4nO2d8ZGyMBDFXw90YAM2YAVWYAd2YAe2YA2WYA/XgjXYgt8f+D4XJGQ3gRB0fzPM3A0HJJvNyyZZOMBxHMdxHMdxHOenaADsAkezQFk2hZ+5JuZqq03m9c6K2QF4Bo5d4bKcANwKPzOFDaYTKovozdVWN7S2L81SdnQEdKoauAM4LF2ICFu0HWaqEbMBcEVevXMEYPO6vnTnqdGOP0ktArBFWw6NQzQA9gAuAB6va0swtdNK/pDuvDkCcHw9uyS12vEnqUUALmgVPMYRrfPI8LeEAGwwr9g0aCOglPvnCMAdrU1LUbMdf5JaBOABm3JfUFYA/jD/PHmP1nmtI2OqADDqKhn+12zHn6QGAdijFQALJ5QTgAPa8pVwqBuAs/GaVAE4Qxd1TUXtdvxJahCAy+uwUFIA7ii3Sn6AfVROFYDSi6612/EnWVoAG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PCA8wqem/vYpIQDAe9879jchf5Gr2ju8k6rGnJL771o0AmCJuhp07Suvk3kwzJTVLJKvwY4fD7LOHb5VAKjMoa0XholnxDu4NgklRmy0GBOAWEQj4SgSalN5ryF/kSPmBrov1jxgn3rGBECb+ivD/v7oDwynVGv6yRrsCKC7DWF9weJbBYDbfyEF76cIh+qvTUKJ0U8LvaDrpHIu2Z97NuiOYg+MtzPLHHK2mL/I85Z5sHXqOVYH7lBpkAPgUL2PvfPaRcU12BFA96UHK98qALRHyMn4IlBMkaf4/hxfBhk6tgivpRwj18dCyVC55fNC8OUxzcr1BfZ965gAWKMutmfIJrRhyhuINdsxm28VgKlISUKpAevbc6mkfqJrTAAYWtfwjbza7ZiNC0CYxRplIkp8Zy5VIMcEgOm0tVCzHbNxAQhT+vtzc3DEfHU4Iz03YkwAaoy6arVjNi4AYaxJKLVyxPQONrZtqiEkAEv90w8NNdoxC7nyXMN8S0t/xVwe1kWeEKW/Pzc3e0xnmw30I7S1rc6o+1+tLWXHyRn6XNJUFZubEv8cdIrUX8feVt8SdTkr54x1RUXfwhXfE3U5juM4juM4juM4juM4juM4juMY+Afhj6HXww+3bQAAAABJRU5ErkJggg==\" alt=\"r1 = [n/ln(n)]/pi(n)\" style=\"width: 128px; height: 20px;\" width=\"128\" height=\"20\"\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: 15.5583px 7.79167px; transform-origin: 15.5583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAAAoCAYAAABU3t4iAAAFz0lEQVR4nO1cbZHjMAx9HMKgBEqgCIKgDMqgDJZCMRTCciiFYAiF3g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FLDkGIr0epwbE39L95wJfw6ySBIj/jVxL4aixF0qTsqinBH3MtxgS8nx06pbJ/w7vxxJ+CxNCJBSgl7c1xoFbdhTcgxFJskEq0uWihrL3trnrRkJejCtNyzpz7yUz1JKd0K6KWQhyadVt75hJwmtdG5dJAlihOL+sFrVIT1vWl4NOR8K+SR4SHA5r+VnHfJKy3nl9lCWmmPycO0Y5uWU/74ylkqI0uMTJMknnK4sIQlDyqV7zpEEmPsFKUgjFdtgWZoH8i8nUd6cl7UeQznhtanH78nw64aZIFrjkAp7JAlipONcZQM8V/qOFUaSkBMsTb61bnMPkDlUrjvbIV1/15CEeUnKWlLxYmSS8XgP3Wu12vNiF+h7KcvwWBLgtLhnyU1GpMkkvWyMTAz1H5ibrynjUHRerDTxJkiyT/AiPV4rctzM78i1PAYhFViSh2OszT93dD1npOT9HCEp2whdqMVuvgby5EWMgLL6NMLWQE0RetlgTcmlee4VBQZd9jtK8CmNx3dzH9kwW/ufNYW7Yd1iy/HWvBr3SKN42vcztMdQiA7pl8w4D+vJjJyRPU/jrhkZGiztc1u+2wNgPgXrSKPVG3Es0WtCiT29ynrFe29TanFB49cW/MV6GxjqbbleFsUf0f49jhQeqPMjFmto8UMcL2AFYbnhPK7iiOOC7ax3j/ierP3v3got9IJbKbE8sLs56EGW8THLfv5aZBoX1M/hrL/npamQ/QQO2OaH5HIl86og29e63/6CvQ496hoTS1OVfYe9GjMm4rVQe61VD0xVgPa68I4ZrX8NxeH4OLCM63A4HA6Hw+FwOBwOh8PhcDh+Hf4AMC7RQCoQmHQAAAAASUVORK5CYII=\" alt=\"r2 = Li(n)/pi(n)\" style=\"width: 100.5px; height: 20px;\" width=\"100.5\" height=\"20\"\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: 57.95px 7.79167px; transform-origin: 57.95px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Do not round the approximations to integers. For \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGcAAAAkCAYAAACUjSQ7AAACLklEQVRoge2ZfZGDMBDFnwccxEANoAAFOKgDHNQCGiqhHmoBDVjo/UH2sqX52BCuR4b9zWRu5rIvJVk2eQCgKIqiKIqiKEeltU1KA6ADMNjWfUl7KloADwAvAFehZgAwAxitvgPwtC210CXa02DgkkJNkpzRxo6r/zdYFv2F8CKXaE+DwZII+itNTsdiG09/b/smT3+J9rS0kCdnsnGPQH/DxrrtqD0t0uTwO3+IxD3hKmAP7amRJmdkcbFzgcdddtCKuNiB+eANlr2yZjsoTQ43D7GFGzzjlWiDXPHpaHrb18E5DMldscbA+fySlvNs4kOaHD5P6QKTKyvRJqG9cIarlgnOp285yPiilDTps4nkOqTJMZE47v7uO2iTkNO4Y5kMt3t8cjl38V6Vk7U3e8hNzpwx3jo5W7RRDN4vniqGoFKkqqqNLcmJ3f094snJ1UbhggmfE7jnDHZApMnh52vuuVGijUKLH3qA2mvv/y+qdWuAy/rsGZhPLFauPmpzazcWF/tNX1yJVnThvjKjwbY80dbm1jphHFUJP4NLtEF4Jn3lSBabLHRO9dTm1oCDvVuLvevhLq61gz9QvljfJic5VAEh19UjfOeXaD/gmfS9rOMPTAZLIntP3NGRbjlE7JsMVceW7zkp7RvcQvsOJ95fq1ujr5A0hydkBoO2+/XXzBnpxS3R/tLC7eshrrY/16kdgdRZltpaDNxL31zXWKJVFEVRFEVRFEVRlL/lB90inPH0D2r4AAAAAElFTkSuQmCC\" alt=\"n = 100\" style=\"width: 51.5px; height: 18px;\" width=\"51.5\" height=\"18\"\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: 257.5px 7.79167px; transform-origin: 257.5px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, you will find that the first approximation is about 13% low and the second is about 16% high. However, for \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAAAmCAYAAAA/bE50AAACk0lEQVRoge2abZGDMBCGHw9xgIEaqIIqwME5wAEWqgEJeKiFasBC70eyw14INCnctRz7zDA3kyYk7JvsR+bAMAzDMIx3cgLO4a/xBi7ADajxQnRAD1TvXNTRqIAH01PQh8f9+YoOSoMXIjb4XPuhcZS7CYd3M2eWjSkGv0TtV2AonPPf4vCGGoCvzDFnvEu5hbFtGN+SFlNc0xDGgndTj4I5/zUiwIN8o9Shb+zbxbADaTFk3AMfqO+MohyWCr97a7x7yBXipPqm0k9xQbeZ8V9q/MDUVR2aM/lC9CwbWlxQ6l0nvPEb9R5zTYpcIfRpaBf63ZmK5UJ7r9paxpNhxR35QrSqX73Qr1P9JFZIfIjHSd+mdNGOqXoV/mP2WiHmCqHdydIObpgKNpe+ytxLJwzCQPFpkl3IYqtocaVHTOfga561GyBXCJ1d5QohBr6Q3vnSvnTCgHG3i9+T46YDT2riHLQB1jxrg12uEHrOXCE61X7F21HGOnwc6Sjgxpg7V/zc/fpDniqrODHetax51qaApUI8q4T1+2IjS7osRWCJvXDRQuUGUdC58R7vTF4RYuk7L8wLsQr94h6vqOaqftsjf+WaVqMrz3vidwlixSnYh/CbWdOmxZoO1LE/flbyL7G3rElvyFwhNrvC0IZOHTOJD69c5e4ta6oz+8nJmbv8ewkdiFPqyqRx3Mhhb1mTY3TDS98rfTaND1rd1MLitLVjf/cmJZd+4nbmMied2GxqB3lpagfoo+pCn5KC7lMoEQLGmirVVzbupomLVjd1/LXbKq4QPwTHz0u6jue1kFTE2hPIRiy9XciiZvTDcwuSfwkpqhA/BLlDi58u/PZMEKmSZVzD/tyyYRiGYRiGYRiGsSXfQQpnPGbnc4wAAAAASUVORK5CYII=\" alt=\"n = 10^8\" style=\"width: 49px; height: 19px;\" width=\"49\" 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: 216.658px 7.79167px; transform-origin: 216.658px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, the first approximation is 6% low and the second is only 0.01% high. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [r1,r2] = primeCount(n)\r\n  r1 = (n/ln(n))/primepi(n);\r\n  r2 = Li(n)/primepi(n);\r\nend","test_suite":"%%\r\nn = 1e2;\r\nr1_correct = 0.86859;\r\nr2_correct = 1.16324;\r\n[r1,r2] = primeCount(n);\r\nassert(isequal(round(r1,5),r1_correct) \u0026\u0026 isequal(round(r2,5),r2_correct))\r\n\r\n%%\r\nn = 1e4;\r\nr1_correct = 0.88343;\r\nr2_correct = 1.01309;\r\n[r1,r2] = primeCount(n);\r\nassert(isequal(round(r1,5),r1_correct) \u0026\u0026 isequal(round(r2,5),r2_correct))\r\n\r\n%%\r\nn = 1e6;\r\nr1_correct = 0.92209;\r\nr2_correct = 1.00164;\r\n[r1,r2] = primeCount(n);\r\nassert(isequal(round(r1,5),r1_correct) \u0026\u0026 isequal(round(r2,5),r2_correct))\r\n\r\n%%\r\nn = 1e8;\r\nr1_correct = 0.94224;\r\nr2_correct = 1.00013;\r\n[r1,r2] = primeCount(n);\r\nassert(isequal(round(r1,5),r1_correct) \u0026\u0026 isequal(round(r2,5),r2_correct))\r\n\r\n%%\r\nn = 1e5;\r\n[r1,r2] = primeCount(n);\r\ns1 = floor(1e5*round(r1,5));\r\ns2 = floor(1e5*round(r2,5));\r\nbxo_correct = 59814;\r\nassert(isequal(bitxor(s1,s2),bxo_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2021-01-03T15:27:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-08-07T15:57:52.000Z","updated_at":"2025-08-18T01:32:16.000Z","published_at":"2020-08-07T16:33:15.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:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/241\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 241\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, which is based on \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://projecteuler.net/problem=7\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, asks us to identify the \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\u003eth prime number. That is, the problem seeks the inverse of the prime counting function \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=\\\"pi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, which provides the number of primes less than or equal 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. The \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://mathworld.wolfram.com/PrimeNumberTheorem.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime Number Theorem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e gives approximate forms 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=\\\"pi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e for large \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\u003e n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Two such approximations are \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/ln(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en/\\\\ln(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Logarithmic_integral_function#Offset_logarithmic_integral\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eoffset logarithmic integral\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\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=\\\"Li(n) = li(n) - li(2)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\rm Li(n)} ={\\\\rm li(n)} - {\\\\rm li(2)}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \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=\\\"li(x) = integral of 1/ln(t) from t = 0 to t = infinity\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\rm li}(x) = \\\\int_0^\\\\infty dt/\\\\ln(t)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e (See \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/46066-evaluate-the-logarithmic-integral\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 46066\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest these approximations by computing two ratios: \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=\\\"r1 = [n/ln(n)]/pi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er_1 =[n/\\\\ln(n)]/ \\\\pi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \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=\\\"r2 = Li(n)/pi(n)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003er_2 = {\\\\rm Li}(n)/\\\\pi(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Do not round the approximations to integers. For \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 = 100\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 100\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, you will find that the first approximation is about 13% low and the second is about 16% high. However, for \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 = 10^8\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 10^8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, the first approximation is 6% low and the second is only 0.01% high. \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":46066,"title":"Evaluate the logarithmic integral","description":"The \u003chttps://en.wikipedia.org/wiki/Logarithmic_integral_function logarithmic integral\u003e li(x) plays a role in number theory because the related function Li(x) = li(x) - li(2) provides an estimate for the number of primes less than x. MATLAB's Symbolic Toolbox has the function \u003chttps://www.mathworks.com/help/symbolic/sym.logint.html |logint|\u003e, but it is not available in basic MATLAB or Cody. \r\n\r\nWrite a function to evaluate the logarithmic integral.","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: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 61.5px; transform-origin: 407px 61.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: 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: 12.0667px 7.91667px; transform-origin: 12.0667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Logarithmic_integral_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003elogarithmic integral\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: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAmCAYAAAB3c5OxAAACGklEQVRoge2YUbGsMAyGPw84wAAGUHAU1AEO1gEW0IAEPKwFNGCB8xAylD1QSNvdvXeGb4anQJq/NElbuLm5ubkx45YnFx1Q5nBUAQ3wBPqDd9zyTmHw65Agc1IicVYpDnpgBObl2RPtPHt70bcDhtjATqiQmJP+eEle0RUwpQZ1gkP+eBIh0TqI49ryHoFHakAXGFLHORN9FYf8ZUvux/KDxBy9onKJHrme9zlIGi+HaJ35OsGHlRZZWVFcyek+YAdpT7Nx3AKZrAd/J6tA2mQob5Mmek90iQiZDuyvjFxvU9ouB8//yFoLKrbjHm1wtPNEFbSQqOrE7vuISY+H579GhI+sf3kgXKyi0/JM1Jm9Jn7G/UltEJGN4fuJyI3QN0XDupQn7FtXTREz3xbde2NY++6AvYAC3xfdeGNYNzb/rWhtd6FKfYSla2xIFV1gO4X5OCRwzWtrTs98STTEVVE9JtaseT0avtfJzt6nr9hZbJYqWiDHQ13Ofl5rMeuRXdcRmlahdw4HzyFaz92h6tuy9uEn23Tw+3WLLPOzpd4SUfx0q6mDTWxnrWC7Y3q18/KubjCOmAlP4NktzitPjDWgRATtPc0F+x4d4Zysl+9De+mQ3UdXxidPdbuUyGr4RCAd6ef/bDTYKnAMNe+/hzPT8b4bFD2FmSv2JxjIe9Gv9G/ym42OvAG2mf29jZw3o/9UDt/c3Nx8hF8hL++a4KwTZwAAAABJRU5ErkJggg==\" alt=\"li(x)\" 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: 184px 7.91667px; transform-origin: 184px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e plays a role in number theory because the related function \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAAmCAYAAADgDvYuAAAFLElEQVR4nO2dXbXrIBCFt4c4iIEYiIIqqIM6qINaiIZKqIdaqIZaOOeBzuq0DTDAQH7WfGvlpbmHJDtsmAHCBQzDMAzDMAzDMAzDMAzDMIQcX4cWE4Besby9YXrX5wJgUCqrf5XXlRRyBHCOHDllnhJv7AhXYTTpAdyhJ/gSDHBa3gFcPf/G9C5jhDPSA07Hb7rX76mN4yT4mxFvn50Q126E0zjb9AOAw6uQP3Y8X7+PieUdWRmXhL+5JV5HygD3IrfW8/RwBn/greec4U3vfEY4HZ54azhn+ImdPwjLnhDuLEd8vlt+XBE29BHOr0X0XxeVPtjczaRUwAFO8JoVREWgheDvRcPwpvcvXEMNw1NE5mNk5d3w2+jQ7yHTT5A38F74BUvCMsoNJWHHA3lpQyq3RtepQcjwgOldCjdgKKSXmJ0aaF9k3MG9gxt+G90j4tEGL+cZuI4ILcNLoQcsGoQQcoB7ri2Emt/EDC/F9J4nZvgUJoTTpSOc4X3vgEcbsbSL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X1E9l5mbHNsOEejuj0Nddax8pbonpXRea4ailQYuNSKtzg+5/ikBcK5W7dUzvutTao58ak63t/T/LBN3KclEub2+Y3nWhVaha5uzgGtRdmJ3QHOzYdMjTCNO7Pload4plGYZhGIZhGIZhGIZhGIaxFP/Ka2gIYQHNwgAAAABJRU5ErkJggg==\" alt=\"Li(x) = li(x) - li(2)\" style=\"width: 126px; height: 19px;\" width=\"126\" 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: 40.0667px 7.91667px; transform-origin: 40.0667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e provides an estimate for the number of primes less than x. MATLAB's Symbolic Toolbox has the function\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/symbolic/sym.logint.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003elogint\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: 75px 7.91667px; transform-origin: 75px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, but it is not available in basic MATLAB or Cody.\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: 158.967px 7.91667px; transform-origin: 158.967px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to evaluate the logarithmic integral.\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: 29.1833px 7.91667px; transform-origin: 29.1833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee also \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/46081-set-soldner-s-constant\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 46081 \"Set Soldner's constant\"\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: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = logarithmicIntegral(x)\r\n  y = f(x);\r\nend","test_suite":"%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 0.2;\r\ny_correct = -0.085126486728794;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 0.5;\r\ny_correct = -0.378671043061088;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 1;\r\ny = logarithmicIntegral(x);\r\nassert(isinf(y) \u0026\u0026 sign(y) == -1)\r\n\r\n%%\r\nx = 2;\r\ny_correct = 1.045163780117493;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 5;\r\ny_correct = 3.634588310032652;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 8;\r\ny_correct = 5.253718299558931;\r\nassert(abs(logarithmicIntegral(x)-y_correct)\u003c1e-8)\r\n\r\n%%\r\nx = 3+2i;\r\ny_correct = 2.558790740400258 + 1.594445119241119i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)\r\n\r\n%%\r\nx = 3-0.2i;\r\ny_correct = 2.169086896211800 - 0.181703645882027i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)\r\n\r\n%%\r\nx = -0.3-2i;\r\ny_correct = 0.999726888286245 - 3.238096925989443i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)\r\n\r\n%%\r\nx = -5-3i;\r\ny_correct = 0.500720609942772 - 5.020802115037742i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)\r\n\r\n%%\r\nx = 0.3i;\r\ny_correct = 0.074754684076440 + 3.053886180297906i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)\r\n \r\n%%\r\nx = 0.4-2i;\r\ny_correct = 1.171012435933119 - 2.861745062394908i;\r\ny = logarithmicIntegral(x);\r\nassert(abs(real(y)-real(y_correct))\u003c1e-8 \u0026\u0026 abs(imag(y)-imag(y_correct))\u003c1e-8)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-07-28T15:11:20.000Z","updated_at":"2026-01-29T16:19:49.000Z","published_at":"2020-07-29T01:46:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe\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/Logarithmic_integral_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003elogarithmic integral\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\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=\\\"li(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\rm li}(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e plays a role in number theory because the related function \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=\\\"Li(x) = li(x) - li(2)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\rm Li}(x) = {\\\\rm li}(x) - {\\\\rm li}(2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e provides an estimate for the number of primes less than x. MATLAB's Symbolic Toolbox has the function\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://www.mathworks.com/help/symbolic/sym.logint.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elogint\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, but it is not available in basic MATLAB or Cody.\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 evaluate the logarithmic integral.\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\u003eSee also \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/46081-set-soldner-s-constant\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 46081 \\\"Set Soldner's constant\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45982,"title":"Evaluate the incomplete elliptic integrals","description":"Elliptic integrals can be used to evaluate integrals whose integrands have the form R(x,sqrt(P(x))), where R(x,y) is a rational function in x and y and P(x) is a polynomial of degree 4 or less. They appear in calculations of arclength (as in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45979-compute-the-perimeter-of-an-ellipse Cody Problem 45979\u003e) and analysis of the motion of a pendulum. \r\n\r\nMATLAB provides a function to compute the complete elliptic integrals of the first and second kinds but not the \u003chttps://en.wikipedia.org/wiki/Elliptic_integral _incomplete_ elliptic integrals\u003e of the first, second, and third kinds.\r\n\r\nWrite a function to evaluate the three incomplete elliptic integrals. Follow MATLAB's convention of using the parameter m, which is related to the modulus k through m = k^2.\r\n ","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: 165.05px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 82.525px; transform-origin: 407px 82.525px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63.05px; 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.525px; text-align: left; transform-origin: 384px 31.525px; 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: 256.742px 7.79167px; transform-origin: 256.742px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eElliptic integrals can be used to evaluate integrals whose integrands have the form \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ4AAAApCAYAAADESpC2AAAFVklEQVR4nO1by7XiSgysHMiABLyaHYu3JgIyIAMyIAW2b0sI5EAKRPAWpPB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ASDvL2lQGJuKUEk/2EZfuX6VUb4dytbLs/FjAtKMEch/YS4qnFhe5CiuU/6UMKYl0PiHBiXtGx573pR3H4soLT5DmQAJ4N+LZgpJz6rGD41p/UywSOhkODSiVKFfBlFQ5dNYe8zxv6d0PmWIwwmvUTif1NfBWl8QJY+DLtMWTL5/xM92KgWMUKbtlm0y2IHJRyGXbA/koechhe8xzlS1GlWJvrgZUhrP4f21V3iJVoCB4bNEFkW6Ws3+Ywg32FYvcKXo8Sne0LeelElYSJ0UINoT5NKseVzZA9/gZEDIIPNtfMVsk0UvVTgdni+KIOxEx8NF1PmCqfSH7eSRliiScO6tCnlGo7HJpyPV89IZ2yrE3pCNe5oyh/qB+Qld/LxP42iReX69E7VaY20wFrX1imEERCyz90K4uCHaZ70PXsy6zDDS371PvA8QYbz2PNxxz/BrTewehc1aY8r3YPidtaKEunm20lC2hozZPvSG+wtBPqXE8D1h4iqqa1WFRcCldEsyDam+e0bu0vSXwPk1TilBKE8MKZbs6T8Eiz+UrMLdpAe87ps+E532IEnjnaml7quF9e8mDE95ToZbCIm92PXCFXb22SD9W9TbYYFx2Wxo64LteJLKABUzr5c1zTVbRb086YsCb5gMfiAPaTfwWvgBuOXZHR0dHR0dHR0dHR4cdfwGlCMZI4WYYjwAAAABJRU5ErkJggg==\" alt=\"R(x,sqrt(P(x)))\" style=\"width: 79px; height: 20.5px;\" width=\"79\" height=\"20.5\"\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: 24.8917px 7.79167px; transform-origin: 24.8917px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAAlCAYAAADPwo5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DquWSyq6ioqKi4Fn4BIWFfml+61wIAAAAASUVORK5CYII=\" alt=\"R(x,y)\" style=\"width: 46px; height: 18.5px;\" width=\"46\" height=\"18.5\"\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: 39.675px 7.79167px; transform-origin: 39.675px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a rational function in \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);\"\u003ex\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: 15.5583px 7.79167px; transform-origin: 15.5583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \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);\"\u003ey\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: 15.5583px 7.79167px; transform-origin: 15.5583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAlCAYAAAD1EjEiAAACXUlEQVRoge2Y7Y2jMBRFTw90QAM0QAVUQAfpgA6mBWqghPQwLVBDWtj9Ya6wndhgY2e1EkdCoyHJs59934cNNzc3N9+hA5pCttqCtqozAnNBex3w3P4WowemE0+fYLO046IFVgovQAf8An+s54lx+gd4be9e2/8xhm2CtSTa1bA/sTu+ep81uIsT2tUWs0ApKsnhB1hKGpyJOzfgKuOT9GaMYmrTYBZ5KGVwZXdsDHzHdt4fuN3e1951MfOu0Cw0cT1t4Hv2dx61JnOSjkKLPRKOd5vYzr+ok+FjFBlzYXcqlM3tmH/hZtueeLiEaLffTLyrrd3ex2w+KaA2lbJPOyrsbD95n6lSnJXggFnwp2XTzt62EmNhqHGzy552TY9vqMFVxqcSo0qRMwktgNTUY3Zz2OzGSlrqogcNaAJ2V7ewq2LlPcn5DuTwsMaX4ykKiqn1EL958dvagbDsxBXnlbW1+Cl5Q6r1w/AUDa7kc+VzxXlw1ZXCJef9DJ7LVeeVU34Tf5dbZQC3pb3SK2vyOfjnhqMQs7mU8M60tCmTyDlqzrjOp8xD46YsGOAmmiwDFrlZd2Q/niruUzo2VaNk7BJztUtS4kxJPDqXSy0KHc1F4RDblJXMcLW7q6MLijMsxBOWmqUFs/D+kdTejHGzFQuBjsxwtQdSlr16NaSWNLRTfifpN0z+yTLUUImJDMmXuqf7xEpcRTrEhMbpDz73x8qq77XoMbtxJXme4cF37w5OU/x+zUP3hEVvcEuipFaDo0T4z2kw9br0JGvYrMZEufv1ge9djt7c3Nz8f/wFtf/1FBNp7n8AAAAASUVORK5CYII=\" alt=\"P(x)\" style=\"width: 31.5px; height: 18.5px;\" width=\"31.5\" height=\"18.5\"\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: 254.792px 7.79167px; transform-origin: 254.792px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a polynomial of degree 4 or less. They appear in calculations of arclength (as in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45979-compute-the-perimeter-of-an-ellipse\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 45979\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: 133.808px 7.79167px; transform-origin: 133.808px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e) and analysis of the motion of a pendulum.\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: 342.542px 7.79167px; transform-origin: 342.542px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eMATLAB provides a function to compute the complete elliptic integrals of the first and second kinds but not the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Elliptic_integral\"\u003e\u003cspan style=\"perspective-origin: 33.85px 7.79167px; transform-origin: 33.85px 7.79167px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eincomplete\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"perspective-origin: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; \"\u003e\u003cspan style=\"\"\u003e elliptic integrals\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: 110.45px 7.79167px; transform-origin: 110.45px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of the first, second, and third kinds.\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: 367.883px 7.79167px; transform-origin: 367.883px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to evaluate the three incomplete elliptic integrals. Follow MATLAB's convention of using the parameter \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);\"\u003em\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.79167px; transform-origin: 3.88333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which is related to the modulus \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);\"\u003ek\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: 27.6167px 7.79167px; transform-origin: 27.6167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e through \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAAAmCAYAAACvfze7AAACZ0lEQVRoge2abXGDQBCGXw84wEAMRAEKcIADHMRCNUQCHrAQDbGQ/lh2eNnsNb1rEiDdZ+ZmOne9dtnvJQGCIAiC4DOoABynFTyZCsAA4EbrAqBZU6hPYwTQQ5RdA/iCKPoK4LCiXB9DA+Ds7I8QRffvFWdfaH7tIEqsEr/XQrzX0kOUfHqJdDungoS7euJt+jkXVXL7PNE+jxqzkku88TzdTUVAAEkVquTclqyCFL3Ixw/QcL8V3i1JMf8O7XuHzHsHSI8caeIXqBfnhLymCa/byEJbG6ae9rw//tPZVmmQn48rSIrwho+HA8kRYs0BYiW2boW5iuqEU9PZCcs2KEfRapy/rpKwVbmvtNdi+aw9ZuWpgr12rUvs32GVqcKPk0BcJBo6G5yz38L3/rJKxlrtke0k10PyrXUWdcDBrBFLQz1ElXzFrMRuOuPwqn84y3ng1hG6ZOWmqYrk7WhfPTlXzs65k+SC2br2snrdBeLZ3Lx7obdlWtw7RYc39Lw8/QyQsZPRdmfEfX+ooWfvbBV+g6Yj9luGCrau1wNyDuTw5NDbywzPEasOkhXypXDRs8WLc66d8W2uzmGN7uKApcNoN/WW4YL/mYXbNCuInnn3HrFGd9HRvSOWz/bSTznYG72wSbU7fFbyFmuN7kIjVp3C1qKXwda0ArMQNudyPubeecszvUYsF2lOlTx8PLWQayHwLMnhZZV3NGdnbLv4sbxNYn/AC56FPdVLFWpl77Ue59RL4v6WYHlTtUWfxUuNxTSYc5sX5nrmWfUwnZ2xj+8hnCDypuqHvr+JF/FBEARBEARBEOyTbyAnNFcNOJDEAAAAAElFTkSuQmCC\" alt=\"m = k^2\" style=\"width: 44.5px; height: 19px;\" width=\"44.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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [F,E,Pi] = ellipticIntegrals(varargin)\r\n%  m = 1st argument, phi = 2nd argument, n = 3rd argument (if it's specified)\r\n  F  = f1(m,phi);\r\n  E  = f2(m,phi);\r\n  Pi = f3(m,phi,n);\r\nend","test_suite":"%%\r\nm = 16/25; phi = pi/7; n = 0.2;\r\nF_correct = 0.458608414805464; E_correct = 0.439360453883539; Pi_correct = 0.464765785383336;    \r\n[F,E,Pi] = ellipticIntegrals(m,phi,n);\r\nerrorF  = abs(F-F_correct)/F_correct;\r\nerrorE  = abs(E-E_correct)/E_correct;\r\nerrorPi = abs(Pi-Pi_correct)/Pi_correct;\r\nassert(all([errorF errorE errorPi] \u003c 1e-8))\r\n\r\n%%\r\nm = 16/25; phi = pi/2; n = 0.2;\r\nF_correct = 1.995302777664729; E_correct = 1.276349943169906; Pi_correct = 2.262478943418680;    \r\n[F,E,Pi] = ellipticIntegrals(m,phi,n);\r\nerrorF  = abs(F-F_correct)/F_correct;\r\nerrorE  = abs(E-E_correct)/E_correct;\r\nerrorPi = abs(Pi-Pi_correct)/Pi_correct;\r\nassert(all([errorF errorE errorPi] \u003c 1e-8))\r\n\r\n%%\r\nm = 1/64; phi = pi/3; n = 0.4;\r\nF_correct = 1.049610464554263; E_correct = 1.044793820490869; Pi_correct = 1.203999963286716;    \r\n[F,E,Pi] = ellipticIntegrals(m,phi,n);\r\nerrorF  = abs(F-F_correct)/F_correct;\r\nerrorE  = abs(E-E_correct)/E_correct;\r\nerrorPi = abs(Pi-Pi_correct)/Pi_correct;\r\nassert(all([errorF errorE errorPi] \u003c 1e-8))\r\n\r\n%%\r\nm = 1/40; phi = pi/3; n = 0.35;\r\nF_correct = 1.051071572767161; E_correct = 1.043347162655471; Pi_correct = 1.182205359771783;    \r\n[F,E,Pi] = ellipticIntegrals(m,phi,n);\r\nerrorF  = abs(F-F_correct)/F_correct;\r\nerrorE  = abs(E-E_correct)/E_correct;\r\nerrorPi = abs(Pi-Pi_correct)/Pi_correct;\r\nassert(all([errorF errorE errorPi] \u003c 1e-8))\r\n\r\n%%\r\nm = 0; phi = rand(1); n = 0.4;\r\nF_correct = phi; E_correct = phi;     \r\n[F,E,~] = ellipticIntegrals(m,phi,n);\r\nerrorF  = abs(F-F_correct)/F_correct;\r\nerrorE  = abs(E-E_correct)/E_correct;\r\nassert(all([errorF errorE] \u003c 1e-8))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-06-01T22:25:14.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":"2020-12-25T06:02:12.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-22T22:58:33.000Z","updated_at":"2026-01-09T12:16:35.000Z","published_at":"2020-06-23T04:29:36.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\u003eElliptic integrals can be used to evaluate integrals whose integrands have the form \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=\\\"R(x,sqrt(P(x)))\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eR(x,\\\\sqrt{P(x)})\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \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=\\\"R(x,y)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eR(x,y)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a rational function in \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=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \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=\\\"y\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \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=\\\"P(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eP(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a polynomial of degree 4 or less. They appear in calculations of arclength (as in\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://www.mathworks.com/matlabcentral/cody/problems/45979-compute-the-perimeter-of-an-ellipse\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 45979\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) and analysis of the motion of a pendulum.\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\u003eMATLAB provides a function to compute the complete elliptic integrals of the first and second kinds but not the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Elliptic_integral\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eincomplete\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e elliptic integrals\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e of the first, second, and third kinds.\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 evaluate the three incomplete elliptic integrals. Follow MATLAB's convention of using the parameter \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=\\\"m\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, which is related to the modulus \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=\\\"k\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e through \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=\\\"m = k^2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em = k^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45988,"title":"Evaluate the zeta function for real arguments \u003e 1","description":"The \u003chttps://en.wikipedia.org/wiki/Riemann_zeta_function Riemann zeta function\u003e is important in number theory. In particular, the \u003chttps://en.wikipedia.org/wiki/Riemann_hypothesis Riemann hypothesis\u003e, one of the seven \u003chttps://en.wikipedia.org/wiki/Millennium_Prize_Problems Millenium Prize Problems\u003e, states that the non-trivial zeros of the zeta function all have real part equal to 1/2. The truth of the Riemann hypothesis has consequences for the distribution of prime numbers. \r\n\r\nThis problem deals only with values of the zeta function for real arguments greater than 1. For a positive integer argument x, the zeta function is the sum of the reciprocals of integers raised to the power of x. Euler showed that when x is an even integer, the value of the zeta function is proportional to pi^x, and \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function Cody Problem 45939\u003e uses this fact to estimate pi. Less is known about the zeta function for odd integer arguments, but Apery provided that zeta(3), now known as \u003chttps://en.wikipedia.org/wiki/Apéry's_constant Apery's constant\u003e, is irrational. \r\n\r\nEvaluate the zeta function for real arguments greater than 1. ","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: 207px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 103.5px; transform-origin: 407px 103.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: 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: 12.0667px 7.8px; transform-origin: 12.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Riemann_zeta_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eRiemann zeta function\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: 145.733px 7.8px; transform-origin: 145.733px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is important in number theory. In particular, the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Riemann_hypothesis\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eRiemann hypothesis\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: 55.6167px 7.8px; transform-origin: 55.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, one of the seven\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Millennium_Prize_Problems\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMillenium Prize Problems\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: 335.65px 7.8px; transform-origin: 335.65px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, states that the non-trivial zeros of the zeta function all have real part equal to 1/2. The truth of the Riemann hypothesis has consequences for the distribution of prime numbers.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 105px; 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 52.5px; text-align: left; transform-origin: 384px 52.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: 378.467px 7.8px; transform-origin: 378.467px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem deals only with values of the zeta function for real arguments greater than 1. For a positive integer argument \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAkCAYAAACaJFpUAAAA60lEQVRIie2U0Q2DIBBA3w5s4AIu4ASdgA3cwA1cgRkcwR26gjOwgv3gLhKi0kT0o+UlJuIFH3B3QKVSqVR+kgawwCDvaWyQ+GVewATMwCrPFMVt9H3dWcwlVOoBA3TAIotyyUKK0LPtRGVdaUlMGwk9hXKWw4tweUIGIU8r8H5CZkR0S0Xu4RLhrTm0hLwZtjy6u2StyFoZax61cPSom2jsCH07yvgUIz+dCL3nCc2txP1oRWYP4qtIT+mSCX0SbzLx9LrzOaFOGji+SbpMXOfPPNRCysgXR1oKLbZs0ZSU3X45KJaHdlb5Ez4sHUr70Yy5uAAAAABJRU5ErkJggg==\" alt=\"x\" style=\"width: 14px; height: 18px;\" width=\"14\" height=\"18\"\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: 248.15px 7.8px; transform-origin: 248.15px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e the zeta function is the sum of the reciprocals of integers raised to the power 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);\"\u003ex\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: 80.5167px 7.8px; transform-origin: 80.5167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Euler showed that when \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);\"\u003ex\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: 35.7833px 7.8px; transform-origin: 35.7833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an even integer, the value of the zeta function is proportional to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAmCAYAAACh1knUAAABLklEQVRYhe2WXa3EIBBGjwccYAADq6AK6qAO6mAtVMNKqIdauBqwwH1gJkAvm93tpjQ34SQ80D8+5psZCp1Op9P5CAfcsrmRuWklwAITsAFBFnfAj8znVkKUSRa+A6sIvAQnQgIwXCVCCURLLsWQ8uIrWywx0V6NZ4s8SAk7HhEwknbyznCVbwwi5CbPLMQIvV0xywcC9v5bYnXMxEgYGQHw8u28rzzlLruwMvYLjaRyrGHk/YXSrokUnZcYeUGZ+dt8VlKDaoan9F8j5FuKUAtyW7RLLi2FqAV5LmgVHSrDI6gFeS7krbrZyanl6yvXtuzawImHmOZBoKwg7Y4qxHFS0lrKTuopLcgbmObPKbmSR6J2ZG+7+48zREDcvXbV2n+Dk3srDaum0+l0/hW/ktdyQqlGSvEAAAAASUVORK5CYII=\" alt=\"pi^x\" style=\"width: 17px; height: 19px;\" width=\"17\" 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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 45939\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: 80.8833px 7.8px; transform-origin: 80.8833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e uses this fact to estimate \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);\"\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: 27.6167px 7.8px; transform-origin: 27.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Less is known about the zeta function for odd integer arguments, but Apery proved that \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAlCAYAAADx5+EfAAACb0lEQVRoge2Z0XGDMAyGvx3YgAVYIBNkgmyQDdggKzADI7BDVsgMWYE+oP8gKcWS7b7x3XHpJUaWZEuWVTg5OTkpowG6ivJqytrlUvh+A0zUVfRhT3WuwHNH+BXogdYhw2twC9xM7t0xHtNrcIxzcwVm+9x+97LvZ1MuxTMxTk6Zd57Rfj9idOrhQoq0NvGwo1CKh8n5i4bFKS+WVb7Y59YJqXla4E2l0Olt0skUkxJSMEVr44/ywcDimL3VHO39N+kw6k3HKtxs0hf+OBMDx6vcJn5XeM2OeeVgz2IkGfBt4xwlWo5X8MK60qm4hkXPIye6eJC/Ze6s+SAXyfAeS8VzXvF7eI+JJSRyaez9KaCDdkbWFlc2vKYGHqAEmDu/Mnp01SI744ORvDgWiufo5K298+bzaOwDMrKcrS1ScuZJRkTZ1sb3LA7PNfxJRh6aKFtlyDP6m4Zl1WW056yGtahxo21ZEstQx2ihAsWrV9joO2UZW9Q0uiNW54dPDZWbpUjRGkbDarTnKAonshf16lfvhcQry1t0zASvmpGSL0VWFt1Bu8azehobumZur3Kl1zRl3hSXxFxKZJ5VvpFx3G4z5faoGFniMyJMXj/KuKqV5ehvwwZileFIRunb8bso+H4iW+fFcXwpy2+fiTUDP/CXoY3pntVBaVj7VCpH9bcaCN6Y13Y7Gt+aoqrG1D2Jont/jXz0gdpFEcET/9Sx3KAbWZUGwjc5LZmq/as/eFDpeNQFQDElb+bETEcsLCKoRV1FthLam8X40sLlQqwh4KGrLXPb/VRWLRXeUTfueirvnoY1q/77/4xOTk5OcvgB1Ovi8l4suQ0AAAAASUVORK5CYII=\" alt=\"zeta(3)\" style=\"width: 30.5px; height: 18.5px;\" width=\"30.5\" height=\"18.5\"\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: 48.2333px 7.8px; transform-origin: 48.2333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, now known as\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Ap%C3%A9ry's_constant\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eApery's constant\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: 10.8833px 7.8px; transform-origin: 10.8833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is irrational.\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: 186.7px 7.8px; transform-origin: 186.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEvaluate the zeta function for real arguments greater than 1.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = zeta1(x)\r\n  z = f(x);\r\nend","test_suite":"%%\r\nx = 3/2;\r\nz_correct = 2.612375348685488;\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%  \r\nx = 2;\r\nz_correct = pi^2/6;\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%\r\nx = 3;\r\nz_correct = 1.202056903159594;\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%\r\nx = 4;\r\nz_correct = pi^4/90;\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%\r\nx = 5;\r\nz_correct = 1.036927755143370;\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%\r\nB = [1/6 -1/30 1/42 -1/30 5/66 -691/2730 7/6 -3617/510 43867/798 -174611/330];\r\nn = randi(10);\r\nx = 2*n;\r\nz_correct = (-1)^(n+1)*B(n)*(2*pi)^(2*n)/(2*factorial(2*n));\r\nassert(abs(zeta1(x)-z_correct)/z_correct \u003c 1e-8)","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-24T20:47:20.000Z","updated_at":"2026-01-09T12:24:36.000Z","published_at":"2020-06-24T21:36:21.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\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/Riemann_zeta_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRiemann zeta function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is important in number theory. In particular, the\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/Riemann_hypothesis\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRiemann hypothesis\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, one of the seven\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/Millennium_Prize_Problems\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMillenium Prize Problems\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, states that the non-trivial zeros of the zeta function all have real part equal to 1/2. The truth of the Riemann hypothesis has consequences for the distribution of prime numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem deals only with values of the zeta function for real arguments greater than 1. For a positive integer argument \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=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e the zeta function is the sum of the reciprocals of integers raised to the power 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=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Euler showed that when \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=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an even integer, the value of the zeta function is proportional 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=\\\"pi^x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi^x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and\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://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 45939\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e uses this fact to estimate \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Less is known about the zeta function for odd integer arguments, but Apery proved that \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=\\\"zeta(3)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\zeta(3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, now known as\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/Apéry's_constant\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eApery's constant\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, is irrational.\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\u003eEvaluate the zeta function for real arguments greater than 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":45979,"title":"Compute the perimeter of an ellipse","description":"While the area of an ellipse is straightforward to compute, the perimeter (or circumference) is more complicated. The perimeter can be expressed in terms of elliptic integrals, and several approximate formulas are available as well. \r\n\r\nCompute the perimeter of an ellipse given the lengths of the semi-major and semi-minor axes--in any order.","description_html":"\u003cp\u003eWhile the area of an ellipse is straightforward to compute, the perimeter (or circumference) is more complicated. The perimeter can be expressed in terms of elliptic integrals, and several approximate formulas are available as well.\u003c/p\u003e\u003cp\u003eCompute the perimeter of an ellipse given the lengths of the semi-major and semi-minor axes--in any order.\u003c/p\u003e","function_template":"function P = ellipsePerim(a,b)\r\n  y = f(a,b);\r\nend","test_suite":"%%\r\na = 3; \r\nb = 4;\r\nP_correct = 22.103492160709504;\r\nassert(abs(ellipsePerim(a,b)-P_correct)/P_correct\u003c1e-8)\r\n\r\n%%\r\na = 4; \r\nb = 3;\r\nP_correct = 22.103492160709504;\r\nassert(abs(ellipsePerim(a,b)-P_correct)/P_correct\u003c1e-8)\r\n\r\n%%\r\na = 1;\r\nb = 8;\r\nP_correct = 32.744956600195508;\r\nassert(abs(ellipsePerim(a,b)-P_correct)/P_correct\u003c1e-8)\r\n\r\n%% \r\na = 1;\r\nb = 0.974062207869516;\r\nP_correct = 6.201967;\r\nassert(abs(ellipsePerim(a,b)-P_correct)/P_correct\u003c1e-8)\r\n\r\n%%\r\na = 4*rand(1);\r\nb = a;\r\nP_correct = 2*pi*a;\r\nassert(abs(ellipsePerim(a,b)-P_correct)/P_correct\u003c1e-8)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"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-06-22T14:29:06.000Z","updated_at":"2026-01-02T12:52:12.000Z","published_at":"2020-06-22T16:17:57.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\u003eWhile the area of an ellipse is straightforward to compute, the perimeter (or circumference) is more complicated. The perimeter can be expressed in terms of elliptic integrals, and several approximate formulas are available as well.\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\u003eCompute the perimeter of an ellipse given the lengths of the semi-major and semi-minor axes--in any order.\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":45997,"title":"Evaluate the zeta function for complex arguments","description":"\u003chttps://www.mathworks.com/matlabcentral/cody/problems/45988 Cody Problem 45988\u003e involved computing the Riemann zeta function for real arguments greater than 1. Code that works for that problem can reveal the connection between pi and the values of the zeta function evaluated at positive even integers; this connection is explored in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function Cody Problem 45939\u003e. However, to test the Riemann hypothesis--that all non-trivial zeros of the zeta function have a real part of 1/2, one needs to compute the zeta function for complex arguments.\r\n\r\nWrite a function to evaluate the zeta function for complex arguments.","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: 114px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 57px; transform-origin: 407px 57px; 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/45988\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 45988\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: 315.85px 7.8px; transform-origin: 315.85px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e involved computing the Riemann zeta function for real arguments greater than 1. Code that works for that problem can reveal the connection between \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);\"\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: 222.1px 7.8px; transform-origin: 222.1px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and the values of the zeta function evaluated at positive even integers; this connection is explored in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 45939\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: 217.433px 7.8px; transform-origin: 217.433px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. However, to test the Riemann hypothesis--that all non-trivial zeros of the zeta function have a real part of 1/2, one needs to compute the zeta function for complex arguments.\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: 213.017px 7.8px; transform-origin: 213.017px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to evaluate the zeta function for complex arguments.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = zeta2(s)\r\n  z = f(s);\r\nend","test_suite":"%%\r\ns = 2;\r\nz_correct = pi^2/6;\r\nassert(abs(zeta2(s)-z_correct)/z_correct \u003c 1e-8)\r\n\r\n%%\r\ns = 1;\r\nassert(isinf(zeta2(s)))\r\n\r\n%%\r\ns = 1/2;\r\nz_correct = -1.460354508809587;\r\nassert(abs((zeta2(s)-z_correct)/z_correct) \u003c 1e-8)\r\n\r\n%%\r\ns = 0;\r\nz_correct = -0.5;\r\nassert(abs((zeta2(s)-z_correct)/z_correct) \u003c 1e-8)\r\n\r\n%%\r\ns = -1;\r\nz_correct = -1/12;\r\nassert(abs((zeta2(s)-z_correct)/z_correct) \u003c 1e-8)\r\n\r\n%%\r\ns = -2;\r\nz_correct = 0;\r\nassert(abs(zeta2(s)) \u003c 1e-12)\r\n\r\n%%\r\ns = 3+2*i;\r\nz_correct = 0.973041960418942 - 0.147695593000454i;\r\nassert(abs(real(zeta2(s))-real(z_correct))/real(z_correct) \u003c 1e-8) \r\nassert(abs((imag(zeta2(s))-imag(z_correct))/imag(z_correct)) \u003c 1e-8)\r\n\r\n%%\r\ns = -1+2*i;\r\nz_correct = 0.168915669770846 - 0.070515988908259i;\r\nassert(abs((real(zeta2(s))-real(z_correct))/real(z_correct)) \u003c 1e-8) \r\nassert(abs((imag(zeta2(s))-imag(z_correct))/imag(z_correct)) \u003c 1e-8)\r\n\r\n%%\r\ns = 0.75-3*i;\r\nz_correct = 0.580900396083837 + 0.095281202690117i;\r\nassert(abs(real(zeta2(s))-real(z_correct))/real(z_correct) \u003c 1e-8) \r\nassert(abs((imag(zeta2(s))-imag(z_correct))/imag(z_correct)) \u003c 1e-8)\r\n\r\n%%\r\ns = 5+2*i;\r\nz_correct = 1.001916538615071 - 0.034217062736354i;\r\nassert(abs((real(zeta2(s))-real(z_correct))/real(z_correct)) \u003c 1e-8) \r\nassert(abs((imag(zeta2(s))-imag(z_correct))/imag(z_correct)) \u003c 1e-8)\r\n\r\n%%\r\ns = 0.5+14.13472514173469379*i;\r\nassert(abs(real(zeta2(s))) \u003c 1e-12) \r\nassert(abs(imag(zeta2(s))) \u003c 1e-12)\r\n\r\n%%\r\ns = 0.5+21*i;\r\nz_correct = -0.005162064638102 - 0.024546964575122i;\r\nassert(abs((real(zeta2(s))-real(z_correct))/real(z_correct)) \u003c 1e-8) \r\nassert(abs((imag(zeta2(s))-imag(z_correct))/imag(z_correct)) \u003c 1e-8)\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":12,"test_suite_updated_at":"2020-06-29T02:07:46.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-28T04:41:50.000Z","updated_at":"2026-01-09T13:36:37.000Z","published_at":"2020-06-28T05:14:18.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:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45988\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 45988\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e involved computing the Riemann zeta function for real arguments greater than 1. Code that works for that problem can reveal the connection between \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=\\\"pi\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and the values of the zeta function evaluated at positive even integers; this connection is explored in\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://www.mathworks.com/matlabcentral/cody/problems/45939-estimate-pi-from-certain-values-of-the-zeta-function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 45939\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. However, to test the Riemann hypothesis--that all non-trivial zeros of the zeta function have a real part of 1/2, one needs to compute the zeta function for complex arguments.\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 evaluate the zeta function for complex arguments.\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":45976,"title":"Evaluate the Struve function","description":"The \u003chttps://en.wikipedia.org/wiki/Struve_function Struve function\u003e *H*_a(x) is a solution to an inhomogeneous form of Bessel's equation:\r\n\r\n\u003c\u003chttps://wikimedia.org/api/rest_v1/media/math/render/svg/246a7bab900d24f188a7edcec59042852728d747\u003e\u003e\r\n\r\nThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference). \r\n\r\nEvaluate the Struve function *H*_p(x) for given values of the order p and argument x. ","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: 151.583px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 75.7917px; transform-origin: 407px 75.7917px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 12.0583px 7.79167px; transform-origin: 12.0583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Struve_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eStruve function\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 190.383px 7.79167px; transform-origin: 190.383px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 38.95px; 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 19.475px; text-align: left; transform-origin: 384px 19.475px; 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: 15.5333px 7.79167px; transform-origin: 15.5333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e        \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-17px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAh8AAABOCAYAAACAEHSqAAAVKklEQVR4nO2dy20zPZOFTw7KQNtZKAFF4AiUgYBZ/1AE4xQUwT+AMxjvZ+kUHMEsnMI3i/ZBl2jeyb6fB2i8eK1Lq9ls8rCqWAUIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCiCU5/x5iRi4A7gAeAG4L/xYhhBBiLk4A3gH8A+Bt4d9yKJ4AfgB8Ymj8fwB8YRAkQgghjsMNwMfSP2JGuOj+gcTHrDzw2tFOGITHPxjEiBBCiPm5YVgYzs0XhnmhF++dvy+H6+85TwWf4eJb4mNirr//fuGvj+uC0QJScvNEPvIrCnEMThjG25KxdCnhccYw7qfGpzOGa8q9rgfmvZ4HyucviY8JOGHozLRyWGUbamiJj75cMKrxJxRXI8RRoCU51419+/3MEjwS534D8I1xfuDxibRgeWI+C4jEx0qg8v7A2Fmu0U+McR+iHYoO+hQl6oQ4BpwEc8XHBcM4sVS83TeGGAgfDMgMHT+IC5DT73tScw8wWn6+MYiCx++/P8iLR5T4WBm8IT+I35Tr7/tCnVDUwc4tUSfE/uE4WiI+PrGMuwUY3e2+uYHX8sQoMGhRt5aQ1NjG9+e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FMZugjJ6X6UWhNp96CEkkKIYTYFSeEE0valOpHX3W31PppPa+EhxBCiF1id3uc8ZqfhLtBjprDqSX/SwtvC5xTCCGEWIQzxmBP9zgitenUhRBCCCGquEGuDyGEEEIIIYQQQgghhBBCiKPx/2Ec84wu4SWMAAAAAElFTkSuQmCC\" alt=\"Differential equation from the Wikipedia link\" style=\"width: 271.5px; height: 39px;\" width=\"271.5\" height=\"39\"\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: 370.333px 7.79167px; transform-origin: 370.333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 87.5167px 7.79167px; transform-origin: 87.5167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEvaluate the Struve function\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 90.625px 7.79167px; transform-origin: 90.625px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for given values of the order \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);\"\u003ep\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: 47.0667px 7.79167px; transform-origin: 47.0667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and argument \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);\"\u003ex\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Hp = StruveFn(p,x)\r\n  Hp = f(x,p);\r\nend","test_suite":"%%\r\nx = 0;\r\np = randi(8,1);\r\nHp_correct = 0;\r\nassert(isequal(StruveFn(p,x),Hp_correct))\r\n\r\n%%\r\nx = 0.4;\r\np = 0;\r\nHp_correct = 0.2501497138634162;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 10;\r\np = 0;\r\nHp_correct = 0.1187436836875042;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = rand(1);\r\np = 1/2;\r\nHp_correct = sqrt(2/(pi*x))*(1-cos(x));\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 4.2;\r\np = 1;\r\nHp_correct = 1.036818631956923;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = pi^2;\r\np = 3;\r\nHp_correct = 4.10841348624688;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%%\r\nx = rand(1);\r\np = 1;\r\nHp_approx = 2/pi - besselj(0,x) + (16/pi-5)*sin(x)/x + (12-36/pi)*(1-cos(x))/x^2;\r\nassert(abs(StruveFn(p,x)-Hp_approx)/Hp_approx\u003c0.002)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2021-01-02T18:43:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-21T16:48:35.000Z","updated_at":"2026-01-09T13:52:55.000Z","published_at":"2020-06-21T17:11:15.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\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/Struve_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eStruve function\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\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=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"Differential equation from the Wikipedia link\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^2\\\\frac{d^2y}{dx^2}+x\\\\frac{dy}{dx}+(x^2-p^2)y=\\\\frac{4(x/2)^{p+1}}{\\\\sqrt{\\\\pi}\\\\Gamma(p+1/2)}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\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\u003eEvaluate the Struve function\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \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=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e for given values of the order \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=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and argument \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=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46081,"title":"Set Soldner's constant","description":null,"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: 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\u003ca target='_blank' href = \"https://mathworld.wolfram.com/SoldnersConstantDigits.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eSoldner's constant\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: 1.94167px 7.91667px; transform-origin: 1.94167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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);\"\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: 199.375px 7.91667px; transform-origin: 199.375px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e= 1.451369234883381... is connected to the logarithmic integral \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAmCAYAAAB3c5OxAAACGklEQVRoge2YUbGsMAyGPw84wAAGUHAU1AEO1gEW0IAEPKwFNGCB8xAylD1QSNvdvXeGb4anQJq/NElbuLm5ubkx45YnFx1Q5nBUAQ3wBPqDd9zyTmHw65Agc1IicVYpDnpgBObl2RPtPHt70bcDhtjATqiQmJP+eEle0RUwpQZ1gkP+eBIh0TqI49ryHoFHakAXGFLHORN9FYf8ZUvux/KDxBy9onKJHrme9zlIGi+HaJ35OsGHlRZZWVFcyek+YAdpT7Nx3AKZrAd/J6tA2mQob5Mmek90iQiZDuyvjFxvU9ouB8//yFoLKrbjHm1wtPNEFbSQqOrE7vuISY+H579GhI+sf3kgXKyi0/JM1Jm9Jn7G/UltEJGN4fuJyI3QN0XDupQn7FtXTREz3xbde2NY++6AvYAC3xfdeGNYNzb/rWhtd6FKfYSla2xIFV1gO4X5OCRwzWtrTs98STTEVVE9JtaseT0avtfJzt6nr9hZbJYqWiDHQ13Ofl5rMeuRXdcRmlahdw4HzyFaz92h6tuy9uEn23Tw+3WLLPOzpd4SUfx0q6mDTWxnrWC7Y3q18/KubjCOmAlP4NktzitPjDWgRATtPc0F+x4d4Zysl+9De+mQ3UdXxidPdbuUyGr4RCAd6ef/bDTYKnAMNe+/hzPT8b4bFD2FmSv2JxjIe9Gv9G/ym42OvAG2mf29jZw3o/9UDt/c3Nx8hF8hL++a4KwTZwAAAABJRU5ErkJggg==\" alt=\"li(x)\" 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: 74.2833px 7.91667px; transform-origin: 74.2833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, which is the subject of \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/46066\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCody Problem 46066\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: 3.88333px 7.91667px; transform-origin: 3.88333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. \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: 358.017px 7.91667px; transform-origin: 358.017px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSet Soldner's constant. The test suite puts up minor resistance against directly entering the number or using simple arithmetic. Of course, you can thwart the tests easily, but I encourage you to learn about the definition 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);\"\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: 1.94167px 7.91667px; transform-origin: 1.94167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mu = SoldnersConstant\r\n   mu = ...;\r\nend","test_suite":"%%\r\nmu_correct = 1.451369234883381;\r\nassert(abs(SoldnersConstant-mu_correct) \u003c 1e-14)\r\n\r\n%%\r\nfiletext = fileread('SoldnersConstant.m');\r\nassert(isempty(strfind(filetext,'45136923488')), 'Please do not set the constant directly')\r\nbanfns = ~isempty(strfind(filetext, 'sum')) || ~isempty(strfind(filetext, 'plus')) ||...\r\n          ~isempty(strfind(filetext, '+'))   || ~isempty(strfind(filetext, 'minus')) || ...\r\n          ~isempty(strfind(filetext, '-'))   || ~isempty(strfind(filetext, 'diff')) || ...\r\n          ~isempty(strfind(filetext, 'str2num'));\r\nassert(~banfns, 'Please do not set the constant indirectly with arithmetic')\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":7,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-07-30T02:45:56.000Z","updated_at":"2026-02-01T10:54:44.000Z","published_at":"2020-07-30T02:56:47.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:hyperlink w:docLocation=\\\"https://mathworld.wolfram.com/SoldnersConstantDigits.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSoldner's constant\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\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=\\\"mu\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e= 1.451369234883381... is connected to the logarithmic integral \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=\\\"li(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\rm li}(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, which is the subject of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/46066\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Problem 46066\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSet Soldner's constant. The test suite puts up minor resistance against directly entering the number or using simple arithmetic. Of course, you can thwart the tests easily, but I encourage you to learn about the definition 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=\\\"mu\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"no_progress_badge":{"id":53,"name":"Unknown","symbol":"unknown","description":"Partially completed groups","description_html":null,"image_location":"/images/responsive/supporting/matlabcentral/cody/badges/problem_groups_unknown_2.png","bonus":null,"players_count":0,"active":false,"created_by":null,"updated_by":null,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"created_at":"2018-01-10T23:20:29.000Z","updated_at":"2018-01-10T23:20:29.000Z","community_badge_id":null,"award_multiples":false}}