{"group":{"group":{"id":33144,"name":"Easy Sequences Volume I","lockable":false,"created_at":"2021-11-15T17:34:35.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Collection of math challenges. Not necessarily easy and not necessarily about sequences...","is_default":false,"created_by":255988,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":4,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":2614,"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\u003eCollection of math challenges. Not necessarily easy and not necessarily about sequences...\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.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eCollection of math challenges. Not necessarily easy and not necessarily about sequences...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2021-11-15T17:48:44.000Z"},"current_player":null},"problems":[{"id":52462,"title":"Easy Sequences 1: Find the index of an element","description":"The nth element of a series  is defined by: . Obviously, the first element . Given the nth element , find the value of the corresponding index .","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: 66px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 33px; transform-origin: 407px 33px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 33px; text-align: left; transform-origin: 384px 33px; 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: 88.5px 8px; transform-origin: 88.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe nth element of a series \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);\"\u003eA\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: 46px 8px; transform-origin: 46px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is defined by: \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-17px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATcAAABaCAYAAADdPxECAAAJ6klEQVR4nO2da5HjMBCEm4MZhEAIBEEQhMEyCIOlEAwLIRxCIRhC4e6H0uWJ1w/JetrbX5Xr7nK7sWWPW9JoZgQIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIMcYJwDeAO4AngAOA8/vv/95/F0KITXKCE7I7gAuA6/vPfwBuFa9LCCGi+IITsp/3AfTidq11UUIIEcsPnJA94KalgBux/QNwrHVRQggRy7/3cTGfPd9HV+WKhBAiEvrbHuiF7IB+miqEEJvkCidkX+Yz+tsucKulGr0JITbHHb99a/TBneF8bxI3IcSm6NBPSS3f6Kelh+EvCSGEEEIIIYQQQgghhBBiexzgYtVaOZTR8De5oi+2oLQ9kQTGqbV0KHTkb8GqMuf38YAETiTgiN/i8oIzspQjsjOcsV7hDPk1cl712n+PA1zIUDf4bCzESIhgWNXDHiVSpw7vc7On5vEscG7RBgeMx0IqfU8kg1kF9via/Y20nNBnOwyT8MXf4gQ3spf/VSShw/hUsbSBcRR5L3xe0QYHuJG8OjeRFFb4sIet9lGKI9Rz/zU6uIUF28FK4ERSxlZPa5QKv1Q6r6gLFxhoe0Ikxfq+avaidygsZOsc4WYEV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hKWtpbavBOU7YnhiHsrk2XpDegLawke4aaod8sDR1CB3SVpwoTQ77TM3WN772YbNtTJmexLpve4MhHzV8DRSotavO3IF8q5RKn1tLK5WDc/IX2vgnGVZMLYktGlqrdLkQYocw5KN0niBDcmz84h6n+kKICjDzI7cT9YTPfSvGEv/3unuYEKIwNkvkiTTJ+zzWVDVp3akuhNgANuSjlWOPizRCiMKkKrOU6tBCghBCCCGEEEIIIYTYKzZkI1edszPc6qwiwoUQxTihL/2eWtxO+NzQWeImhCgKxS11aAa/j3FwEjchRFFeWN6EJwaJmxCiOEzHypktIHETQhSHm+Nc4EZuF7jFhQvSVeWVuAkhikN/G4Xsin4LPCA8b3Ruw2uJmxCiGEyiB/pRm+UIt+rpe4yN9iRuQoii2E2yb8gnPhI3IURR7Ca9OcuNS9yEEEV5wIWBnPE5PbXI5yaE2BQdPkuNU4BY9pu+M/nchBCbgqO17/e/6X97ok+bSgWLZErchBDZYc7neeSzG9JkKxzxmVv6eJ+v5S3thBBCCCGEEEIIIYQQQgghhBBCCCGEEPvnP4Qr6te2xhX3AAAAAElFTkSuQmCC\" style=\"width: 155.5px; height: 45px;\" width=\"155.5\" height=\"45\"\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: 91px 8px; transform-origin: 91px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Obviously, the first element \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAlCAYAAACXvR1IAAACl0lEQVR4nO2aXbHDIBCFj4c4wEAMREEUxEEdxEEtREMlxEMtXA210PsAe0N707KwQH5mvxlm+lAg4cBylgAoiqIoinJmLgCaTG0ZAH2mthQBE4Ahc5uja1cR0iFtxU2wqzUGw+xrwjnFbWt1NAB4woobwwhgjvi/gRXqCf7LzcgfDbaig32fR43OGgA/sIMdM4Cdq2OYfZCgVLjCtrADwelnr7SwgtK7VxF29Dq8RtSbwQuTveujB3BHvLBw/cREhj1xwfL+D1QS1uB1Fd2Z9WJWq48/iWKEpf6q7U2FoFVbXNgZSxh+ut8cU3MDfxL4pAoL2Gc7upGqIqy/6vxVGxK2QXzYJiTCTqi0NxWkirA/WMTx977QwUDP/N8aEmEvifX2RHFhR9c4rc4blgEP5aQkTmxq5NdNEYgiTErqY1x9aZGerBUVtnEN+wLGOGOaBCnkEHYU9isp0mhRVNgJ/40PhVeOM6aHS0EiLFy9FAM1wD63tEhz6WLC0qx/3x9b8J3x1sIeNZ8FCgo7w67Itf2D64xV2HSKCEvnwZ/CDJ2KhBzvVsJK0qy9kF1YMkzfBoXrjOnMN4WtzNNpXTEN6LcH4zrjrdMdaf58GldMJ0uhEEahOuSMJfmkRFiqm+JMT+mKKcSGwohvoELOOBTWPyER9uae68hkE5bE4uR+fsoTWhkT0gZZImzq/ronsghLH6i5wvqHFKFBpAkTs88avH5JihGJtokjf2x/TylTPMrfFQy/jFgfmA7LFRduHYD/od3Ahu219rn3pWYcN83psFwUeC9X7PA2poGNCEkzLwK6eZDraqvCYIB10KUGnfLv0pNHWaHk/d8z3VA8JAPyi1viErqSQI4jN8Lg2DclFEVRFEVRlNr8AmdhZHBxYd9KAAAAAElFTkSuQmCC\" style=\"width: 59px; height: 18.5px;\" width=\"59\" 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: 36.5px 8px; transform-origin: 36.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Given the nth element \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAlCAYAAAD2pT8KAAACZklEQVRoge2ZYZGDMBCFPw84wEANoKAKcFAHODgLaEACHmqhGmqB+wFv2NKUbHoJcz94M525uZZs9mX3vSTAiRMnTvx/3IAq01g1cM001qHogTbzmN0y7uFo+G5Fe+ZqKIGeg8logYmZjBR0wJh/Oi8YyV9tQVTAg5mIlIDN8kxdYlIGF+B5QBw65oQm4CfhuZHjyrancOXVrCRMwN353FHVsI13KRVgZG2LafnbI5gDftJy4UGhCrSraqsiRkRFehvlQM+sFdnxYE3mzkpEbCNzdf5ui4r30q6ZF8TTYjcKtEfHzK5Wf2AlIrYnkLjGrPbKaq/Pzdj18n/FfBJPUBWczUqrJbBNOMU5RFoMWm2rQTWrHXaJcUVE54jtQs+70KncPc6hlfRCbTcyE2FXX8l5V3oik2Aq8La/L2ZCMedIIULCqra485rwzXzvcSsR+meMy2SawMfrHClE2EoLbcB60pLLQoTOE+OHjwQt5ggpRChRVdoWiunp+yy2LYHcG8TrHErOAyuUe+3oscQsYil13it5r4J77dMmOgS+lz54N0mf9M0N7RxjJaXWiTmH18+tEIYmrxbzuoAW4OvzjUo+pspWMGPOEWszWBMNrbh1ExE6sN8iA2GdcUHJeVi3pRxjvndMSuOEYtvqq5bfxIj9Wh+0g/MSYa0uFlQEf9IJO1aoLWzb3AlriIWIS26Lhnd77D4M1LCeCbzPwP7FTGvGCKFiTt57DTdy/GnXDW2XU+85U3Hl9YD4L9Eyl3apSWr/U5rsLCj5/uGwG+xcaMlPRomXRofg2xdEIeje4sSJEydO5MYvnSP5KzErv3UAAAAASUVORK5CYII=\" style=\"width: 33px; height: 18.5px;\" width=\"33\" 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: 134.5px 8px; transform-origin: 134.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, find the value of the corresponding index \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: 2px 8px; transform-origin: 2px 8px; 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 n = index(a)\r\n  n = a;\r\nend","test_suite":"%%\r\na = 1;\r\nn = index(a);\r\nassert(isequal(1,n))\r\n%%\r\na = 25;\r\nn = index(a);\r\nbs = arrayfun(@(x) sum(arrayfun(@(k) k*(-1)^(k^3+1),1:x)),1:n);\r\nb = bs(end);\r\nassert(isequal(a,b))\r\n%%\r\na = 100;\r\nn = index(a);\r\nbs = arrayfun(@(x) sum(arrayfun(@(k) k*(-1)^(k^3+1),1:x)),1:n);\r\nb = bs(end);\r\nassert(isequal(a,b))\r\n%%\r\na = randi([1000,ceil(exp(log(double(intmax)/2)))]);\r\nn = index(a);\r\nassert(isequal(index(-a+(1-(-1)^(n+1))/2),n+1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":9,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":"2021-08-11T04:47:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-10T10:31:40.000Z","updated_at":"2026-04-01T20:40:04.000Z","published_at":"2021-08-10T10:34:24.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 nth element of a series \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\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is defined by: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA(n) = \\\\displaystyle\\\\sum\\\\limits_{k=1}^n (k\\\\cdot(-1)^{k^3+1})\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Obviously, the first element \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\u003eA(1) = 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Given the nth element \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\u003eA(n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, find the value of the corresponding index \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\u003en\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":52467,"title":"Easy Sequences 2: Trigonometric function with integral input and output","description":"The function 'F', defined as: \r\n\r\n                ,\r\n\r\nwill always return an integer if the input is a natural number (in radians). Furthermore, since the cosine and sine of 0, are 1 and 0 respectively, therefore F(0) = 0.  For a given natural number 'n'  your task is to find the value of F(n).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 163px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eThe function 'F', defined as: \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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 22px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003e                \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAycAAAAqCAYAAACp3yTq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NU9B70Fw5OhkGvlA9ltsSs6j5WPbGeUXFHN8L3fakVkHlCl/HLdzE+7t1B9fEY2XugW6rb55L/6lQTbWyj7H2TGDfJ9ZSO+BYzXE55bH4H15MInW+9GaQ+uVsn5Ap8mNJOKjpFW+dnMmJStq+45WLbdjSoXcq18ZLstdkXnsfKR7ZySvvdbzY7Mx1QhL/QubnLF5r9jbHK1La2u2+aTlgY7VB4i0E4ReF3O3NJODjl8qYufDvcDu0YRCLlWvrNC7MrHLpSsRwSOlpscTjavh7u19jLMJ7XuvuB8iED5COypoquUL960knXxs2kBCRU1LAIh18qHNsSufOxCyXpEoL/cHFkPV2vvZZhPat+FoQEhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiECIQIhAiEC3iLw/0kYYgTelEniAAAAAElFTkSuQmCC\" width=\"403.5\" height=\"21\" style=\"width: 403.5px; height: 21px;\"\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; \"\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; text-align: left; 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; \"\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003ewill always return an integer if the input is a natural number (in radians). Furthermore, since the cosine and sine of 0, are 1 and 0 respectively, therefore F(0) = 0.  \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; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eFor a given natural number 'n'  your task is to find the value of F(n).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = F(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 0;\r\nassert(isequal(F(x),0))\r\n%%\r\nx = 10;\r\nassert(isequal(F(x),round(-cos(2*pi*x/3)/9+(2*x*sqrt(3)/9+1/sqrt(3))*sin(2*pi*x/3)+1/9)))\r\n%%\r\nx = 20;\r\nassert(isequal(F(x),round(-cos(2*pi*x/3)/9+(2*x*sqrt(3)/9+1/sqrt(3))*sin(2*pi*x/3)+1/9)))\r\n%%\r\nx = intmax-4\r\nassert(isequal(F(x),F(1234567891011)))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":"2021-08-11T12:47:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-10T11:56:54.000Z","updated_at":"2026-04-01T20:57:52.000Z","published_at":"2021-08-11T07:18: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:r\u003e\u003cw:t\u003eThe function 'F', defined as: \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\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=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eF(x) = -\\\\cos(2\\\\pi x/3)/9+(2x\\\\sqrt{3}/9+1/\\\\sqrt{3})\\\\cdot\\\\sin(2\\\\pi x/3)+1/9\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\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\u003ewill always return an integer if the input is a natural number (in radians). Furthermore, since the cosine and sine of 0, are 1 and 0 respectively, therefore F(0) = 0.  \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFor a given natural number 'n'  your task is to find the value of F(n).\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":52497,"title":"Easy Sequences 3: Prime 44-number Squares","description":"The positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd and 10th positive integers, respectively, that have this property. We will call a positive number whose square ends in '44' as a \"44-number\".\r\nIf 'x' is the nth 44-number, we define the function 'S(n)' to be the sum of the digits of 'x^2' but excluding the ending '44'. So in the cases above, S(3) = 11 and S(10) = 17. We noticed that both of these sums are primes.We define 'P(n)' as the number of prime S(n)'s among the first 'n' 44-numbers. Write a function that returns P(n), given that P(3) = 2 and P(10) = 5.","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: 156px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 78px; transform-origin: 407px 78px; 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: 377.5px 8px; transform-origin: 377.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd and 10th positive integers, respectively, that have this property. We will call a positive number whose square ends in '44' as a \"44-number\".\u003c/span\u003e\u003c/span\u003e\u003c/div\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\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: 382.5px 8px; transform-origin: 382.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf 'x' is the nth 44-number, we define the function 'S(n)' to be the sum of the digits of 'x^2' but excluding the ending '44'. So in the cases above, S(3) = 11 and S(10) = 17. We noticed that both of these sums are primes.We define 'P(n)' as the number of prime S(n)'s among the first 'n' 44-numbers. \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: 117px 8px; transform-origin: 117px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eWrite a function that returns P(n),\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: 76.5px 8px; transform-origin: 76.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e given that P(3) = 2 and P(10) = 5.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function prime_count = P(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 3 10 15 20];\r\ny_correct = [0 2 5 8 11];\r\nassert(isequal(arrayfun(@(i) P(i),x),y_correct))\r\n%%\r\nx = 1:20;\r\ny_correct = 108;\r\nassert(isequal(sum(arrayfun(@(i) P(i),x)),y_correct))\r\n%%\r\nx = arrayfun(@(i) P(i),15:30);\r\ny_correct = 118;\r\nassert(isequal(sum(arrayfun(@(i) P(i),x)),y_correct))\r\n%%\r\nx = 25:100;\r\ny_correct = 3077;\r\nassert(isequal(sum(arrayfun(@(i) P(i),x)),y_correct))\r\n%%\r\nx = floor(sqrt(double(intmax)));\r\ny_correct = 17862;\r\nassert(isequal(P(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":32,"test_suite_updated_at":"2021-08-12T04:00:36.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2021-08-11T10:45:05.000Z","updated_at":"2025-11-30T19:35:26.000Z","published_at":"2021-08-11T19:07:08.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 positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd and 10th positive integers, respectively, that have this property. We will call a positive number whose square ends in '44' as a \\\"44-number\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf 'x' is the nth 44-number, we define the function 'S(n)' to be the sum of the digits of 'x^2' but excluding the ending '44'. So in the cases above, S(3) = 11 and S(10) = 17. We noticed that both of these sums are primes.We define 'P(n)' as the number of prime S(n)'s among the first 'n' 44-numbers. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a function that returns P(n),\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e given that P(3) = 2 and P(10) = 5.\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":52522,"title":"Easy Sequences 4: Eliminate the Days of Confusion","description":"If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\r\nWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\r\nTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\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; text-align: left; 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; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\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; \"\u003e\u003cspan style=\"\"\u003e on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function d = noneConfusingDays(minD,maxD)\r\n    d = maxD - minD;\r\nend","test_suite":"%%\r\nminD = '2021-05-21';\r\nmaxD = '2021-08-10';\r\nd_correct = 51;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1999-01-01';\r\nmaxD = '2000-12-20';\r\nd_correct = 456;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1963-11-22';\r\nmaxD = '2021-06-04';\r\nd_correct = 13421;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '2004-07-07';\r\nmaxD = '2005-10-11';\r\nd_correct = 293;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1945-02-14';\r\nmaxD = '2020-05-25';\r\nd_correct = 17562;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2021-08-13T06:44:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-11T19:22:07.000Z","updated_at":"2025-11-30T19:35:08.000Z","published_at":"2021-08-13T06:44:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \\\"05-02-1998\\\", may mean either \\\"May 02, 1998\\\" or \\\"February 05, 1998\\\". However, since there are only 12 months in a year, not all dates are confusing. \\\"23-10-1969\\\" is clearly \\\"October 23, 1969\\\".\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e on either \\\"dd-mm-yyyy\\\" or \\\"mm-dd-yyyy\\\" formats.\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\u003eTo avoid further confusion you are given the input in \\\"yyyy-mm-dd\\\" date format.\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":52532,"title":"Easy Sequences 5: Project Euler Problem 1 - Again!","description":"We are all familiar with Project Euler Problem 1. This time let's try it on bigger multiples and larger range.\r\nFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 72.5px 8px; transform-origin: 72.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWe are all familiar with \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/230\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProject Euler Problem 1\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: 181px 8px; transform-origin: 181px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. This time let's try it on bigger multiples and larger range.\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: 354px 8px; transform-origin: 354px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function sumMults = euler(mult1,mult2,limit)\r\n    sumMults = mult1 * mult2 / limit;\r\nend","test_suite":"%%\r\nx = '3';\r\ny = '5';\r\nz = '1000';\r\ns = '233168';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '333';\r\ny = '555';\r\nz = '1000000000000000000';\r\ns = '2102102102102102397897897897898053';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '1234567';\r\ny = '67891011';\r\nz = '10000000000000000000000000000';\r\ns = '41236503492327959372976875681892749947271207402890';\r\nassert(isequal(euler(x,y,z),s))\r\n%%\r\nx = '123456789101112';\r\ny = '1234567891011121314151617181920';\r\nz = '10000000000000000000000000000000000000000000';\r\ns = '405000003353802152272811475598036987756535154447670107236880553924296912';\r\nassert(isequal(euler(x,y,z),s))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-14T04:00:48.000Z","updated_at":"2025-11-30T19:42:11.000Z","published_at":"2021-08-14T18:07:20.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\u003eWe are all familiar with \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/230\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProject Euler Problem 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This time let's try it on bigger multiples and larger range.\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\u003eFind the sum of all the multiples of the first input or the second input for all positive integers below the third input.\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":52562,"title":"Easy Sequences 6: Coefficient sums of derivatives","description":"Consider the polynomial function  and its first-order derivative . The sums of the coefficients of P and P', are  and , respectively. If we keep summing up coefficients for all higher derivatives the sums sequence will be as follows:  etc.  The total sum of this sequence converge to .\r\nFor this exercise, you are given an array corresponding to the coefficients of a polynomial function. In the example above, the coefficient array is therefore, . Your task is to find the total of the sum of the coefficients of the given polynomial function plus the sum of the coefficients of its first derivative plus the sum of cefficients of all its higher degree derivatives.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 191px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 98px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eConsider the polynomial function \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUYAAAAoCAYAAACCXlNuAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABRqADAAQAAAABAAAAKAAAAACndX/VAAAOG0lEQVR4Ae2aC9BVVRXHFQUEDCQFAdFASaLMRxoIgg3YgGJGJUoDyowYmqEzmRr2IAIsRBQNwYxGexgWalS+NRQQUxuMxvejFJQ3qKgoIij1/8He4/Z8+5x7zr3nXu752Gvmz9lnr7XXXvt/91n78bHbbkECA4GBwEBgIDAQGAgMBAYCA4GBwEBgIDAQGAgMBAYCA4GBwEBgIDAQGAgMBAZyY2D33DwFR0Vm4FQFP0TYT1gi3CAsFYJ8xMChKo4WPiesEhYIs4X/CUECA4GBRsbAJI1nm/Bv4W2BD321cKAQZAcDg/TYJMCNixv13k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CdWBg12HgKg11o3BkFYbcST5fFW6rgu/gMjAQGAgMVI0BjtGLBI5XnXPsZW/5WiK8JNTVNjnHMQZXgYHAQCNmgD+VPyI8IeT1hwD+AvWi0E0IEhgIDAQGCslAM0U9VIj+BbXcwXB/2brcxqFdYCAwEBgIDAQGAgOBgcBAYCAwEBgIDAQGAgOBgcBAYCAwEBgIDAQGAgOBgcBAYCAwEBgIDFSJgf8D3Giv49mFrO8AAAAASUVORK5CYII=\" width=\"163\" height=\"20\" style=\"width: 163px; height: 20px;\"\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; \"\u003e\u003cspan style=\"\"\u003e and its first-order derivative \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-15px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQMAAABGCAYAAADIM/GgAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABA6ADAAQAAAABAAAARgAAAAAonz+BAAAO1UlEQVR4Ae2cCdBe0xnHI0IiQiJBkEqkQshYUmslGFuTCKlWWntM0jZlxla0ZrpqO0iQKNVRlCS2zsQSWwkxIkQliiilVEUSJUQRFcSWtL9/3Odzet173/377n2/55n5f2d5nnvuOf97z3OWe763QwcXZ8AZcAacAWfAGXAGnAFnwBlwBpwBZ8AZcAacAWfAGXAGnAFnwBlwBrIYWCtLmaFbB91uoC/YGuwMtgRDgIsz4AwUkIFOVda5F9edB3YEikvmfRa0/L2L2NCW1P9H/kvydbAQvAQeBLcAF2fAGSgoA4dRb3Vs4ZyENmxP3vJIb3YTSX8HnAveCHS3Ee8NXJwBZ6CADJxCna2TH5hS/7mBzd0xm+6kNTuwMu6N6T3pDDgDBWHgDuqpj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DgDBWBgN+pozuCZWH31o5GPBvp3iOuntvQrMPGvBL3JWwZ0AGkjoFmGytX5AomOLl8O9JttLs6AM5BDBnRYyPYDNKrbzz3JEUwHLwDr2DOJ65PjY2AiOARsA2T7MJgHOgHJU0DOQPsGypMjmA2SNifJdnEGnIE8MDCLStjs4GXi6rgLgZYHQ4Dp9JVgCbgbjA/ydRRZtv2AyQQidt1S4m+BUG92HjoDzkCOGNBSIVwOqBNrpN8eaINRHd069jTinUEz/tIszXJxBpwBMbAf0CbgdiCUASTGgEFhJvE9wTCQdrBIXyaK9EuzVNfFGXAGnAFnwBlwBpwBZ8AZcAacAWfAGXAGnAFnwBlwBpwBZ8AZcAacAWfAGXAGnAFnwBlwBpwBZ8AZcAaMgf8Bq4RntixGcF4AAAAASUVORK5CYII=\" width=\"129.5\" height=\"35\" style=\"width: 129.5px; height: 35px;\"\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; \"\u003e\u003cspan style=\"\"\u003e. The sums of the coefficients of P and P', are \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAAAkCAYAAAC3+rerAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA8KADAAQAAAABAAAAJAAAAACpnfNSAAAInUlEQVR4Ae2Ze8wdRRnGW5GWa8GCWIxSKK01RCvSNgICBggUggjKJdw0qQpEVDRqFEMCf2hMFBQhgAkKhmsMShGEyj0ViKJA0aY1FQU+qoCxUKVShAro71dn2mE9e86ePduve/LNkzxnbu/MvvPsvrMze8aNy8gKZAWyAlmBrEBWICuQFcgKZAWyAlmBrEBWICuQFcgKZAWyAlmBr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/k2J0fhnPfLxei2Njua+PYr8p7ZZyZ1xeyfqTCAlxcbupSX0XZ6l/aqTSuqGg6L3UQcvQu61boRTocpfAv8Dvoa/1zaMGDem+GY/Zyvul3SB8a3sGM+AreBKaZQMHBtvyhtaHH+58Hfn7TYx6JrZwWf1fn4YiPlHaFvZ9u/BjM2KOALSF1k5W3+rKSTHf8FvwoNiOOgW03rvwSbRNMBrG97w39C/V0Id4NiJ/ggtH4RfBNsO9wuxgXnxLY7m/g3gbzndbV+Dh4DI95G5h5o20NQ24wNCtQKYLtfAT2PKGxK6xbA2bBpbIwA1scD4B9hnMdT5F+Fa+B5sM4Rgm6jjvlc0Tm8BLcd9asPdsGJdL8EqrlzcGf0J/gKdD7eh2FYRHFzVPFxrhafW5/jjki/cqUGvq3eBXeGq+EI9OvuSrgx4F9Ml0FXabdVTcI5zoEeB/xLYzFcCn2AhgVTcXQXaBDo/zDCD1p+uHEufj9xYV0On4cZNRUoC+Caw9XuthU994QG1W9qj5I7ZgWyAlmBrEBWICuQFcgKZAWyAlmBrEBWICuQFcgKZAWyAlmBrEBWICuQFcgKZAWyAlmBrMB/ATcVDUOhqUr3AAAAAElFTkSuQmCC\" width=\"120\" height=\"18\" style=\"width: 120px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAAkCAYAAADrcPSPAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA2KADAAQAAAABAAAAJAAAAABhLo42AAAH2ElEQVR4Ae2ae8zXUxz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y4j3u2GU/JvEdmOCgrAINAMK0EzgJwXkMqBv1qOOv80i8yO8xt/hm3dB0AuicDQpT0wmo+hAoFhNAbrr2zTVy+zgO81mJE03RnAisLfzZ8hrBfaTDLHlNMB0DDwTKEj6VxTx7wWVpCKPiF1RVKuWsesP0rIniHpQuBkY2bivFp+0u2NQv0WWaWDtA7JlVJEdFdR2JWLSF930gCYfaGNo6uF+r2wP3ytAatJ2bs6g/sGiGbsuoMWXKdORyC+vsjmgN6g0FTHB2qPkTyDMlvXw1K9Nae8XClDZaRwKKpYaRM3LrmyAfpWKyVDa3gjki20elFbZYBBKRaygXejtHNAO7AQbwA9Aq38RNJ5GXwS6bLYpooN63GYnbO8IdoHV9dgPMl2ntgtBN2UgjelqcECZMCpigoX1VVT5iTSsy6YM1QulI+cB5wHnAecB5wHnAecB5wHnAecB5wHnAecB5wHnAecB5wHnAecB5wHnAecB5wHnAeeB/wA2WWDXBrcNEgAAAABJRU5ErkJggg==\" width=\"108\" height=\"18\" style=\"width: 108px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e, respectively. If we keep summing up coefficients for all higher derivatives the sums sequence will be as follows: \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAkCAYAAAAgqxBxAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAtKADAAQAAAABAAAAJAAAAACH07FpAAAG+ElEQVR4Ae2ZaahWRRjHXdLUyrTFMEOvuVTiErSY2XrNkjBLKKPMun4w+6QRFC2SSWX2oSRSCipQyRYTbwUFaQgqtGcrRiUp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1N7izrSZ0LdgPtgLUuQxjAZrAcJB1laml8rW1ugnB/J71sBP4XcZDOc+jkF9p8CujDstaltc1NkPnQEeOkID2F6aQuTDdBemltcxOEtNhJZCAyEBmIDEQGIgORgchAZKBIDPwPOJEp8UY8O6EAAAAASUVORK5CYII=\" width=\"90\" height=\"18\" style=\"width: 90px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e etc.  The total sum of this sequence converge to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAJKADAAQAAAABAAAAJAAAAAAqDuP8AAACUElEQVRYCe2WT0tWQRTGrwVZQRGYiwhpVQgZSbRp4cLy3bmxPkCt8iO4zhZt/ABGBEbbWrboCxS4UIsUiWphtIhIzEQLsvo915mXc+fOa9BBV/fAc+f8mfOcw9y5c6coGmlWoFmBvV2Brn/QHyU+Cs6BM+ArWAJPwCbYTTy5Wd5xvJ/BL/AcPAZvwB8gfwt0Ek9ulvMmXhVeBQNmhlb0DlDsOxgEqXhyU67SPshzHajoROmpPg5gLgLF71dDhSe3pBJ5KhdwHAvOD2kQ+zd4FfxDSdyTW1LlGjptilw0ulVPBUPNWfHkWp6Krib0OoRvwBbBLPT1/ASKPwJWPLmWp6bHr0lF34I+M2MKXX5t+LPGH1VPbuSojVfw/AAqHIvfRn8Y7HeM50FOPLk5vrbvBlp8NbExjdPgcHtWXvHk5hmDd5jRNiNdh+JIiO82eHKzvNq82rRqQr8J29g2tl5hJ/HkZjmP430B1MQMOALuATUSG5N+HaTiyU252vYDNBXWj7S77d15VV9CTPFPSVxTPbnKr8klPDrwVHCyFi0KxTdCXHPGzBxPbkmTO6kvE+kKRWZNsajOoej6EcWeRZ7cki/X0IlYiVGHX06eGaf2UhRPbsmRa+hlZGfsN7pVV4yxbHRPrqGpqocw14H2x2ugK0Uqd3EovgZ6TNCTa2jq6jVcW0BFn4KTIMotlHiC60ROxZObclXsq1gLQE1pn7wH2lOy50ELdJL/zo1fUydi+XXp0pfUCz4C/f11cUvvQrhq4smtkTWOZgWaFWhWYD9W4C/P++GDxZTKPgAAAABJRU5ErkJggg==\" width=\"18\" height=\"18\" style=\"width: 18px; height: 18px;\"\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; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFor this exercise, you are given an array corresponding to the coefficients of a polynomial function. In the example above, the coefficient array is therefore, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMUAAAAmCAYAAAB06F/cAAAAAXNSR0IArs4c6QAAAERlWElmT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ayj9IngGLComYpjs1IH3eMDVGKndhmzW+aktdBiDoMO38kbAOOQWFJfR8m9QHSml9BNg1J6frNRQAGof7dpWm9pL/gOfhXlfItBEo2IDrcv2Jxu1F7Vt/Cqa+xbKbo31Wqgzhp61axgKk6BsUKT5cHQL0A0OhF2gAmATXA9147MP5onFVN4T6vzQHbaCy+BKuB8WHaMCA1cV3VBj38fIfeCFsAdsB/XNaUeib+4gzA1Jtk+5Ne4r9h7I2QNlV4rSw3HOffHVew80fQ/4oGj6Y+R7WGMPxJ0pxtCfQSV90u3OuyU6/+g90BQ90IZOPQRLJ39d21cMHV51og/j5Ipr8y94DzSOB3RDGvYNS6cflD28B7wHvAe8B7wHvAe8B7wHvAe8B7wHvAe8B7wH8vbAf7FA4HAlc7+AAAAAAElFTkSuQmCC\" width=\"98.5\" height=\"19\" style=\"width: 98.5px; height: 19px;\"\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; \"\u003e\u003cspan style=\"\"\u003e. Your task is to find the total of the sum of the coefficients of the given polynomial function plus the sum of the coefficients of its first derivative plus the sum of cefficients of all its higher degree derivatives.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function totSum = tot_dCoefSum(coef)\r\n  y = x;\r\nend","test_suite":"%%\r\ncs = [5 6 -7 -8];\r\nts = '88';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = [3 15 -2 1];\r\nts = '120';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = [-7 22 43 6 -75 3 1 0 -80 10 5];\r\nts = '-42698751';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = 1:25;\r\nts = '1836856501837772435875025';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = repmat([2,-1],1,15);\r\nts = '47298214022376392514505945712317';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = [ones(1,20) zeros(1,10)];\r\nts = '24893912605687593731774059567276';\r\nassert(isequal(tot_dCoefSum(cs),ts))\r\n%%\r\ncs = repmat([-2,-25,1],1,10);\r\nts = '-68761759219969440143678420163128';\r\nassert(isequal(tot_dCoefSum(cs),ts))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2021-08-17T17:53:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-16T19:00:56.000Z","updated_at":"2025-11-30T19:39:34.000Z","published_at":"2021-08-17T12:43:32.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\u003eConsider the polynomial 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eP\\\\left(x\\\\right)=5x^3+6x^2-7x-8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and its first-order derivative \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\\\\frac{dP}{dx}=15x^2+12x-7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The sums of the coefficients of P and P', 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e5 + 6 - 7 - 8 = -4\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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e15+12-7= 20\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, respectively. If we keep summing up coefficients for all higher derivatives the sums sequence will be as follows: \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-4,\\\\ 20,\\\\ 42, ...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e etc.  The total sum of this sequence converge 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e88\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\u003eFor this exercise, you are given an array corresponding to the coefficients of a polynomial function. In the example above, the coefficient array is therefore, \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[5\\\\ 6\\\\ -7\\\\ -8]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Your task is to find the total of the sum of the coefficients of the given polynomial function plus the sum of the coefficients of its first derivative plus the sum of cefficients of all its higher degree derivatives.\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":52584,"title":"Easy Sequences 9: Faithful Pairs","description":"A \"faithful number\" is a non-prime number that is one less or one more than some prime number but not both. For example, for numbers up to 20, the numbers 1 8, 10, 14, 16 and 20 are faithful. The number 4 does not qualify because it is equal to \"3 + 1\" and \"5 - 1\". \r\nIf both 'x' and 'x+2' are faithful but not to the same prime, the pair (x, x+2) is called a faithful pair. So, from 1 to 20 the faithful pairs are (8, 10) and (14, 16). Faithful pairs are scarse and rarer than primes themselves. We can only find 1 faithful pair for numbers 1 to 10, 5 pairs for numbers up to 50 and 8 pairs up to 100.\r\nLet \"P\" be the set of all faithful pairs from 1 to a given number \"n\". We define \"F\" as the set of all p1, p1 \u003c p2 ∀pairs (p1,p2) ∈ P. Write a function \"S(n)\", that sums all the elements of F. \r\nFor 1 to 20, P(20) = [8 10; 14 16], F(20) = [8 14] and S(20) = 22. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 237px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eA \"faithful number\" is a non-prime number that is one less or one more than some prime number but not both. For example, for numbers up to 20, the numbers 1 8, 10, 14, 16 and 20 are faithful. The number 4 does not qualify because it is equal to \"3 + 1\" and \"5 - 1\". \u003c/span\u003e\u003c/span\u003e\u003c/div\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eIf both 'x' and 'x+2' are faithful but not to the same prime, the pair (x, x+2) is called a faithful pair. So, from 1 to 20 the faithful pairs are (8, 10) and (14, 16). Faithful pairs are scarse and rarer than primes themselves. We can only find 1 faithful pair for numbers 1 to 10, 5 pairs for numbers up to 50 and 8 pairs up to 100.\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eLet \"P\" be the set of all faithful pairs from 1 to a given number \"n\". We define \"F\" as the set of all p1, p1 \u0026lt; p2 \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; \"\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; \"\u003e\u003cspan style=\"\"\u003epairs (p1,p2) \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; \"\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; \"\u003e\u003cspan style=\"\"\u003e P. \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; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eWrite a function \"S(n)\", that sums all the elements of F.\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; \"\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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFor 1 to 20, P(20) = [8 10; 14 16], F(20) = [8 14] and S(20) = 22. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = S(n)\r\n    n = 20;\r\n    p = [8 10; 14 16];\r\n    f = [8 14];\r\n    s = 22;\r\nend\r\n","test_suite":"%%\r\nn = 20;\r\ns_correct = 22;\r\nassert(isequal(S(n),s_correct))\r\n%%\r\nn = 9;\r\ns_correct = 0;\r\nassert(isequal(S(n),s_correct))\r\n%%\r\nn = 5:5:100;\r\ns_correct = [0 8 8 22 42 42 42 80 80 124 124 124 124 192 192 192 272 272 272 370];\r\nassert(isequal(S(n),s_correct))\r\n%%\r\nn = 1000;\r\ns_correct = 17216;\r\nassert(isequal(S(n),s_correct))\r\n%%\r\nn = 2^20;\r\ns_correct = 4054100250;\r\nassert(isequal(S(n),s_correct))\r\n%%\r\nn = intmax;\r\ns_correct = 6921757389660954;\r\nassert(isequal(S(n),s_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-22T10:45:18.000Z","updated_at":"2025-11-30T19:31:23.000Z","published_at":"2021-08-22T11:03:11.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\u003eA \\\"faithful number\\\" is a non-prime number that is one less or one more than some prime number but not both. For example, for numbers up to 20, the numbers 1 8, 10, 14, 16 and 20 are faithful. The number 4 does not qualify because it is equal to \\\"3 + 1\\\" and \\\"5 - 1\\\". \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf both 'x' and 'x+2' are faithful but not to the same prime, the pair (x, x+2) is called a faithful pair. So, from 1 to 20 the faithful pairs are (8, 10) and (14, 16). Faithful pairs are scarse and rarer than primes themselves. We can only find 1 faithful pair for numbers 1 to 10, 5 pairs for numbers up to 50 and 8 pairs up to 100.\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\u003eLet \\\"P\\\" be the set of all faithful pairs from 1 to a given number \\\"n\\\". We define \\\"F\\\" as the set of all p1, p1 \u0026lt; p2 \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:t\u003epairs (p1,p2) \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:t\u003e P. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a function \\\"S(n)\\\", that sums all the elements of F.\u003c/w:t\u003e\u003c/w:r\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\u003eFor 1 to 20, P(20) = [8 10; 14 16], F(20) = [8 14] and S(20) = 22. \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":52594,"title":"Easy Sequences 10: Sum of Cumsums of Fibonacci Sequence","description":"The function F(n) is defined as the set of Fibonacci numbers from the first up to the n-th. S(n) is the result of applying to F, the MATLAB built-in function 'cumsum' and followed by the function 'sum'. For example for n = 10, we have:\r\n  \u003e\u003e Fn = [1 1 2 3 5 8 13 21 34 55];\r\n  \u003e\u003e Sn = sum(cumsum(Fn))\r\n  \u003e\u003e Sn =\r\n     364\r\nIt has been argued that the Fibonacci sequence exhibits an exponentially growth relative to the golden ratio, which means that S(n) becomes very big, very quickly. So instead, we will do the inverse operation. \r\nGiven a number 's', our task is to find the largest 'n', such that S(n) is less than or equal to 's'. In the example above we have, 'n = 10' for 's = 364' . ","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: 236.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 118.367px; transform-origin: 407px 118.367px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 130.5px 8px; transform-origin: 130.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function F(n) is defined as the set of \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Fibonacci_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eFibonacci numbers\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: 188.5px 8px; transform-origin: 188.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e from the first up to the n-th. S(n) is the result of applying to F, the MATLAB built-in function 'cumsum' and followed by the function 'sum'. For example for n = 10, we have:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 144px 8.5px; tab-size: 4; transform-origin: 144px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e  \u0026gt;\u0026gt; Fn = [1 1 2 3 5 8 13 21 34 55];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 100px 8.5px; tab-size: 4; transform-origin: 100px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e  \u0026gt;\u0026gt; Sn = sum(cumsum(Fn))\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 36px 8.5px; tab-size: 4; transform-origin: 36px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e  \u0026gt;\u0026gt; Sn =\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 32px 8.5px; tab-size: 4; transform-origin: 32px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     364\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.5px 8px; transform-origin: 383.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIt has been argued that the Fibonacci sequence exhibits an exponentially growth relative to the golden ratio, which means that S(n) becomes very big, very quickly. So instead, we will do the inverse operation.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 327px 8px; transform-origin: 327px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eGiven a number 's', our task is to find the largest 'n', such that S(n) is less than or equal to 's'. \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 47.5px 8px; transform-origin: 47.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the example above we have,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 68px 8px; transform-origin: 68px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e'n = 10' for 's = 364' . \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = N(s)\r\n    n = inv_cumsum(inv_sum(s));\r\nend","test_suite":"%%\r\ns = 364;\r\nn_correct = 10;\r\nassert(isequal(N(s),n_correct))\r\n%%\r\ns = 2000;\r\nn_correct = 13;\r\nassert(isequal(N(s),n_correct))\r\n%%\r\ns = 5000:100:10000;\r\nn_correct = 798;\r\nn_answer = sum(arrayfun(@(i) N(i),s));\r\nassert(isequal(n_answer,n_correct))\r\n%%\r\ns = intmax;\r\nn_correct = 42;\r\nassert(isequal(N(s),n_correct))\r\n%%\r\ns = 10^10;\r\nn_correct = 45;\r\nassert(isequal(N(s),n_correct))\r\n%%\r\ns = intmax('uint64');\r\nn_correct = 89;\r\nassert(isequal(N(s),n_correct))\r\n%%\r\ns = realmax/10;\r\nn_correct = 1467;\r\nassert(isequal(N(s),n_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":49,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-23T07:31:32.000Z","updated_at":"2025-12-16T04:43:30.000Z","published_at":"2021-08-23T12:03:43.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 function F(n) is defined as the set of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Fibonacci_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFibonacci numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e from the first up to the n-th. S(n) is the result of applying to F, the MATLAB built-in function 'cumsum' and followed by the function 'sum'. For example for n = 10, we have:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[  \u003e\u003e Fn = [1 1 2 3 5 8 13 21 34 55];\\n  \u003e\u003e Sn = sum(cumsum(Fn))\\n  \u003e\u003e Sn =\\n     364]]\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\u003eIt has been argued that the Fibonacci sequence exhibits an exponentially growth relative to the golden ratio, which means that S(n) becomes very big, very quickly. So instead, we will do the inverse operation.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eGiven a number 's', our task is to find the largest 'n', such that S(n) is less than or equal to 's'. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eIn the example above we have,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e'n = 10' for 's = 364' . \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":52609,"title":"Easy Sequences 11: Factorial Digits without Trailing Zeros","description":"Here is an easy one...\r\nIt is not difficult to count the number of digits of the factorial of a given number. For example for 'n = 10', we have:\r\n  \u003e\u003e length(num2str(factorial(10)))\r\n  \u003e\u003e ans =\r\n     7\r\nBut 2 of those digits are just trailing zeros. So, for 10!, if we remove the trailing zeros, there would only be 5 digits left.\r\nWrite a function that outputs the number of digits of factorials excluding trailing zeros.","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: 183.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 91.65px; transform-origin: 407px 91.65px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 69px 8px; transform-origin: 69px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHere is an easy one...\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: 354.5px 8px; transform-origin: 354.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIt is not difficult to count the number of digits of the factorial of a given number. For example for 'n = 10', we have:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 140px 8.5px; tab-size: 4; transform-origin: 140px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e  \u0026gt;\u0026gt; length(num2str(factorial(10)))\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 40px 8.5px; tab-size: 4; transform-origin: 40px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e  \u0026gt;\u0026gt; ans =\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 24px 8.5px; tab-size: 4; transform-origin: 24px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     7\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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: 368.5px 8px; transform-origin: 368.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBut 2 of those digits are just trailing zeros. So, for 10!, if we remove the trailing zeros, there would only be 5 digits left.\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: 303px 8px; transform-origin: 303px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eWrite a function that outputs the number of digits of factorials excluding trailing zeros.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = numFacDigits(x)\r\n    n = length_of(num2string(x!)) - '0';\r\nend\r\n","test_suite":"%%\r\nx = randi(3);\r\nn_correct = 1;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = 10;\r\nn_correct = 5;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = 100;\r\nn_correct = 134;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = 5000;\r\nn_correct = 15077;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = intmax;\r\nn_correct = 18570655587;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = double(intmax)*10;\r\nn_correct = 207181392197;\r\nassert(isequal(numFacDigits(x),n_correct))\r\n%%\r\nx = 3:12;\r\nn_correct = uint64([2319 33161 431575 5315711 63157061 731570558 8315705525 93157055190 1031570551819 11315705518107]);\r\nassert(isequal(numFacDigits(10.^x),n_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":255988,"edited_by":223089,"edited_at":"2023-06-03T06:48:10.000Z","deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2023-06-03T06:48:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-24T11:46:25.000Z","updated_at":"2025-11-30T19:40:35.000Z","published_at":"2021-08-24T12:11:43.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\u003eHere is an easy one...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt is not difficult to count the number of digits of the factorial of a given number. For example for 'n = 10', we have:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[  \u003e\u003e length(num2str(factorial(10)))\\n  \u003e\u003e ans =\\n     7]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBut 2 of those digits are just trailing zeros. So, for 10!, if we remove the trailing zeros, there would only be 5 digits left.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a function that outputs the number of digits of factorials excluding trailing zeros.\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":52614,"title":"Easy Sequences 12: 50th Prime","description":"Write a function that outputs the th prime after a given number .  For example, the th prime after  is .\r\nNOTE: If  itself is prime start counting from the next prime greater than .","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 36px; transform-origin: 407px 36px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 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: 115.5px 8px; transform-origin: 115.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eWrite a function that outputs the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABhElEQVRYhe2WXbGDMBCFPw84wAAGUFAFOMABDmoBDZWAByygIRZ6H5IdltwuSWhn+tCcmTwQNsnZv5NARUXF99EBvTFmoE2sb5X922gABzyNsZysHYANeAATnrwDxrDvJUwnZJ7YXs/h/z2aH9kdKSYl0RkL18mhm3HowmuyWRs70jWioVNsHTiwR7grIbQBKz4tueGV6DyBm2HTKpvsKGkvZKxh/ozcquzPIitR3HIJbS8IyXDYxaxtzrCQR/yAHh/2u0EwTkl3kZCV2iQGjprkOKavv0iotIsPaDjWyWQQeiT20fr2FiHwOZdIaaXWhM4UHHwZfIwQ7EqsU/OVlAluxsFXCBWJowWJRqwj0o25hEpvAhMSoTmal1SmPNdi+xHIwbGG6DoajLVar7LqpwkbW6GUu8jqpCXxXzrMeg38gxa/KVokOrRip0TLQmyjXwPZL0jdAeLJhPfM4dOV8qwLtk6RatlFtfi6GPBqu4QxB1Klb6NR7fMI3x/pqoqKioqfwR8/dbpDcDzzhwAAAABJRU5ErkJggg==\" style=\"width: 18px; height: 18px;\" width=\"18\" 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: 106.5px 8px; transform-origin: 106.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eth prime after a given number \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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 59px 8px; transform-origin: 59px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e  For example, the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABhElEQVRYhe2WXbGDMBCFPw84wAAGUFAFOMABDmoBDZWAByygIRZ6H5IdltwuSWhn+tCcmTwQNsnZv5NARUXF99EBvTFmoE2sb5X922gABzyNsZysHYANeAATnrwDxrDvJUwnZJ7YXs/h/z2aH9kdKSYl0RkL18mhm3HowmuyWRs70jWioVNsHTiwR7grIbQBKz4tueGV6DyBm2HTKpvsKGkvZKxh/ozcquzPIitR3HIJbS8IyXDYxaxtzrCQR/yAHh/2u0EwTkl3kZCV2iQGjprkOKavv0iotIsPaDjWyWQQeiT20fr2FiHwOZdIaaXWhM4UHHwZfIwQ7EqsU/OVlAluxsFXCBWJowWJRqwj0o25hEpvAhMSoTmal1SmPNdi+xHIwbGG6DoajLVar7LqpwkbW6GUu8jqpCXxXzrMeg38gxa/KVokOrRip0TLQmyjXwPZL0jdAeLJhPfM4dOV8qwLtk6RatlFtfi6GPBqu4QxB1Klb6NR7fMI3x/pqoqKioqfwR8/dbpDcDzzhwAAAABJRU5ErkJggg==\" style=\"width: 18px; height: 18px;\" width=\"18\" 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: 44px 8px; transform-origin: 44px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eth prime after \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAkCAYAAAAkcgIJAAABtklEQVRYhe2XXbGDMBBGj4c6wAAGqqAKcIADHNQCGioBD1hAQyz0PoQdtimbFLYvnZszk4dCvmT/yKZQqVQq/4UWuBpjBJqCvlHzj+LRvnEBAvA0xpTRdsACPICB6HgA+nXdHB6tyWA4IcOK2Li+vyfPe7YgWEZ5tCaSlf6gTjZdjE0n9o31aotGBcrfhEaXpbVhx5bZ9kvaIgswE0vp07RKZJ/AzZjTqDnaaI82i46AjHl9nnNsVvNzGZUMLF/SZll4d0ZGwP7w9ZwcE++Ge7RFrsR039l3Li2F9qRBN6f2FB2vPSfwWnLXkwb1Tu1pLrzW9qDeaYMehXV0/0qdOap10bBlSN8AtEG5mwHE0rWcOap1I11al8TPlZlwMzY+Y5A0P4/WhUQyPevl1PvUIH3D8GhdSGbG5LmUXylquhF/Q+tCNk7PeV37naHVPUXXvEdrclkXtlIo9yPr1JkK7+U02rsZe7S76MY4JCLpMzN2KeijO52jb8Z7VyKPdhd9WkgUBmJUArHESlFp17lBGdWwNdzcNcSj3aUjduJpHSPRoaP/bXq1zmP9/ckaHm2lUqlUKpUSfw3/IxblkdjJAAAAAElFTkSuQmCC\" style=\"width: 25.5px; height: 18px;\" width=\"25.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: 9px 8px; transform-origin: 9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAkCAYAAAAkcgIJAAACRklEQVRYhe2YW3XDMAyGPw5hEAIhUARFUAZlEAalEAyBEA6hEAyhsD3EmhVXcpxsO3uY/3P8UMuy7pJTqKioqPhP6IBbWM1JXuHrLsj9Du8OLTAAK9CHJb+nQPfQhLMfyVqB54HcBngBi5K7hHXEa6JTSqeRENqKbVAbaKkher0cuS0wB8VTuWPgtXTKYgmMd4f+DPTBoE2B/6H2Ot4jZd09B1pv0Bqikyy6iU4J9HL1RkwbjXvY8/h6dfeY0B4FcrVDiqIjiuYiI2eWZH8kn9cN+/pJea19DW1wUXS0wBnbAy/s3B/INwbY0tBSenX2NbSj08i60OFMC04awFKguAUxZkr2vYhptIXndmiIxSiMN2JNDJyfNwJpLmk66uaQu/u0MfBukFzg1VEJxLNWVCViuVqFi8aAb9DViSzdzGoS0u5z9XApzVLhL94H4dkIyZxIa0XTJQW9+3Utz2eEC6Nc2rJPhQ+2OirFiN8dBR17gyY2h4ozR0WzBrYJiYgVbu2ddM54eIazJenZsM2Tgc2YMejTEkfCqcyQlPIYtIeOovOg3JAc9HPGeruZ0IPJU0A/eXIT/6cMgf1T6HFw9gslxsCxMXeODekoG7zaecWTXyDh9DygnzyWMvJKyKWgtP0jY3SXO/38hxhSr/vITLC8JIbMxI8ray34bVrfJYaMji5FkM4xs0+VJ7FNeh9uuQ+z0lnVEz8CL31hpmjDpZNaPX76jMnZ3Eqd0bAZJzNlCkZcjsZfomVT/sqfJhUVFRUVFb+OT0V/ExDoakWxAAAAAElFTkSuQmCC\" style=\"width: 25.5px; height: 18px;\" width=\"25.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: 2px 8px; transform-origin: 2px 8px; 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: 28.5px 8px; transform-origin: 28.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNOTE: If \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: 193.5px 8px; transform-origin: 193.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e itself is prime start counting from the next prime greater than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; 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 p = prime50th(n)\r\n  p = 500 / 499 (n - 1) + 229;\r\nend","test_suite":"%%\r\nn = 1;\r\np_correct = 229;\r\nassert(isequal(prime50th(n),p_correct))\r\n%%\r\nn = 500;\r\np_correct = 829;\r\nassert(isequal(prime50th(n),p_correct))\r\n%%\r\nn = 1:1000;\r\ns_correct = 821400;\r\ns_answer = sum(arrayfun(@(i) prime50th(i),n));\r\nassert(isequal(s_answer,s_correct))\r\n%%\r\nn = 1234;\r\np_correct = 1601;\r\nassert(isequal(prime50th(n),p_correct))\r\n%%\r\nn = 1234567890;\r\np_correct = 1234569059;\r\nassert(isequal(prime50th(n),p_correct))\r\n%%\r\nn = intmax;\r\np_correct = 2147484611;\r\nassert(isequal(prime50th(n),p_correct))\r\n%%\r\nn1 = 8123456789101112;\r\nn2 = floor(flintmax * 0.95);\r\np1 = prime50th(n1);\r\np2 = prime50th(n2);\r\np_correct = 16680296081108630;\r\ns_answer = p1 + p2;\r\nassert(p1\u003en1 \u0026\u0026 p2\u003en2)\r\nassert(isprime(p1) \u0026\u0026 isprime(p2))\r\nassert(isequal(p1+p2,p_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2021-08-26T18:34:48.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-26T04:22:07.000Z","updated_at":"2025-12-01T11:55:26.000Z","published_at":"2021-08-26T07:45:28.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a function that outputs 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e50\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eth prime after a given number \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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e  For example, 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\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e50\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003eth prime after \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\u003e500\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is \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\u003e829\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\u003eNOTE: If \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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e itself is prime start counting from the next prime greater than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\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.\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}}