{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":45536,"title":"Distance Between Points","description":"Being n the number of points (If n = 3 there would be 3 points: A, B and C).\r\nThe distance between each pair of points increases progressively twice, starting with points A and B. \r\n\r\n\u003c\u003chttp://imgfz.com/i/XUJEt6w.png\u003e\u003e\r\n\r\nGiven *n* as an integer greater than 1 and *x* as the distance between the last pair of points (D and E in figure).\r\n\r\nFind the distance between the first and last points *y*.\r\n","description_html":"\u003cp\u003eBeing n the number of points (If n = 3 there would be 3 points: A, B and C).\r\nThe distance between each pair of points increases progressively twice, starting with points A and B.\u003c/p\u003e\u003cimg src = \"http://imgfz.com/i/XUJEt6w.png\"\u003e\u003cp\u003eGiven \u003cb\u003en\u003c/b\u003e as an integer greater than 1 and \u003cb\u003ex\u003c/b\u003e as the distance between the last pair of points (D and E in figure).\u003c/p\u003e\u003cp\u003eFind the distance between the first and last points \u003cb\u003ey\u003c/b\u003e.\u003c/p\u003e","function_template":"function y = distance(n,x)\r\n      y = x*n;\r\nend","test_suite":"%%\r\nn = 5;\r\nx = 80;\r\ny = 150;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 2;\r\nx = 64;\r\ny = 64;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 8;\r\nx = 1600;\r\ny = 3175;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 3;\r\nx = 2500;\r\ny = 3750;\r\nassert(isequal(distance(n,x),y))\r\n\r\n\r\n%%\r\nn = 8;\r\nx = 1000000;\r\ny = 1984375;\r\nassert(isequal(distance(n,x),y))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":446926,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-05-18T00:55:44.000Z","updated_at":"2026-02-20T08:45:53.000Z","published_at":"2020-05-18T00:55:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBeing n the number of points (If n = 3 there would be 3 points: A, B and C). The distance between each pair of points increases progressively twice, starting with points A and B.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as an integer greater than 1 and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as the distance between the last pair of points (D and E in figure).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the distance between the first and last points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\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\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABIARcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEh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xL5bsrFTjaxwCORnHUYPockVoVFNBFcwvDNEksTjDI6hlYe4PWgY22tktLcRRtKyjoZZWkb8WYkn86nqva2dtYw+TaW8VvFnOyJAq59cAVYoAKKKKACiiigAqnqbNHpl06MVZYXIIOCDg81bpjosiMjqGUggqRkEUAtzJt7cWF7aR209y/nhvNjmnkm+ULncC5JXBwOCAd3OcDG1VS002x08MLKzt7YN97yYlTP1wBVqgSVhaKKKBhRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAGZrhk/smURFg7MijErR5y6jG5eVznGR0zUmmWz2lntlVkcsSym7kuMduGcA9McYAqzPbw3UDwXEKSxOMNHIoZWHuDwajtLCzsEZLO1gtlY5ZYYwgJ9SAKEBaooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k=\"}]}"},{"id":264,"title":"Find the \"ordinary\" or Euclidean distance between A and Z","description":"A, B and Z define three points in the 3D _Euclidean_ space of the form:\r\nA = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\r\n\r\nFind the *Euclidean distance* between A and Z where\r\n  \r\n  A = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\n  \r\n  \u003e\u003e euclidean(A,B,Z)\r\n  \r\n  ans = 5.830951894845301\r\n\r\nYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors\r\nfor all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are.\r\nSo 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function\r\ninput vectors.\r\n\r\nHINT: use the Pythagorean formula.","description_html":"\u003cp\u003eA, B and Z define three points in the 3D \u003ci\u003eEuclidean\u003c/i\u003e space of the form:\r\nA = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\u003c/p\u003e\u003cp\u003eFind the \u003cb\u003eEuclidean distance\u003c/b\u003e between A and Z where\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e\u003e\u003e euclidean(A,B,Z)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eans = 5.830951894845301\r\n\u003c/pre\u003e\u003cp\u003eYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors\r\nfor all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are.\r\nSo 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function\r\ninput vectors.\u003c/p\u003e\u003cp\u003eHINT: use the Pythagorean formula.\u003c/p\u003e","function_template":"function y = euclidean(A,B,Z)\r\n  y = findEuclid(A,B,Z);\r\nend","test_suite":"%%\r\nA = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [1;0;0]; B = [5;3;0]; Z=[5;3;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0,0,0]; B = [4,3,0]; Z=[4,3,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;0;0]; B = [4;3;0]; Z=[4;3;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0,3,0]; B = [4,0,0]; Z=[4,0,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;3;0]; B = [4;0;0]; Z=[4;0;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;3;0]; B = [4;0;0]; Z=[4;0;12];\r\ny_correct = 13;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":177,"test_suite_updated_at":"2012-02-12T03:40:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-05T23:24:30.000Z","updated_at":"2026-02-11T14:15:21.000Z","published_at":"2012-02-12T03:52:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA, B and Z define three points in the 3D\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between A and Z where\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[A = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\\n\\n\u003e\u003e euclidean(A,B,Z)\\n\\nans = 5.830951894845301]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors for all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are. So 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function input vectors.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHINT: use the Pythagorean formula.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":48965,"title":"Taxicab distance","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGet the taxicab distance between the vectors.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = taxiD(v1,v2)\r\n    y = x;\r\nend","test_suite":"%%\r\nv1=1:10;\r\nv2=11:20;\r\nassert(isequal(taxiD(v1,v2),100))\r\n%%\r\nv1=1:4:50;\r\nv2=25:4:75;\r\nassert(isequal(taxiD(v1,v2),312))\r\n%%\r\nv1=1:8:50;\r\nv2=25:8:75;\r\nassert(isequal(taxiD(v1,v2),168))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T15:12:15.000Z","updated_at":"2026-02-11T14:35:59.000Z","published_at":"2020-12-31T01:18:10.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\u003eGet the taxicab distance between the vectors.\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":1693,"title":"Calculate distance travelled when given radius and rotations","description":"When given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14","description_html":"\u003cp\u003eWhen given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14\u003c/p\u003e","function_template":"function y = calci_dist(r,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\nr = 1;\r\nn = 1;\r\ny_correct = 6.28;\r\nassert(isequal(calci_dist(r,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":242,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-02T09:00:14.000Z","updated_at":"2026-03-09T20:57:39.000Z","published_at":"2013-07-02T09:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhen given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":47139,"title":"delta x","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 20.8px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.4px; transform-origin: 407px 10.4px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ewhat is the traveld distance for a vehicle with acceleration of a, and initial speed of v, in the time interval of t.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(a,v,t)\r\n  y = x;\r\nend","test_suite":"%%\r\n\r\ny_correct = 1.5;\r\nassert(isequal(your_fcn_name(1,1,1),y_correct))\r\n\r\n%%\r\n\r\ny_correct = 0.5;\r\nassert(isequal(your_fcn_name(-1,1,1),y_correct))\r\n\r\n%%\r\n\r\ny_correct = 1.5;\r\nassert(isequal(your_fcn_name(-1,-1,1),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":430136,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-30T15:40:22.000Z","updated_at":"2026-03-31T15:21:36.000Z","published_at":"2020-10-30T15:40:22.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\u003ewhat is the traveld distance for a vehicle with acceleration of a, and initial speed of v, in the time interval of t.\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":61268,"title":"Compute the Euclidean Distance Between Two N-Dimensional Vectors","description":"Write a function that computes the Euclidean distance between two N-dimensional vectors.\r\nGiven two input vectors x and z of equal length, compute their Euclidean distance.\r\nRequirements\r\nThe two input vectors will always have the same length.\r\nThe final result must be rounded to 2 decimal places.\r\nYou are NOT allowed to use the following built-in functions:\r\nnorm\r\nvecnorm\r\nsqrt\r\ndot\r\npdist\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 351.5px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 175.75px; transform-origin: 468.5px 175.75px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 107.992px 8px; transform-origin: 107.992px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.3833px 8px; transform-origin: 63.3833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEuclidean distance\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: 114.367px 8px; transform-origin: 114.367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between two N-dimensional vectors.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.5px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.75px; text-align: left; transform-origin: 444.5px 10.75px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 74.675px 8px; transform-origin: 74.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven two input vectors \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.85px 8px; transform-origin: 3.85px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.5px; transform-origin: 3.85px 8.5px; \"\u003ex\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: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.85px 8px; transform-origin: 3.85px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.5px; transform-origin: 3.85px 8.5px; \"\u003ez\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: 156.767px 8px; transform-origin: 156.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of equal length, compute their Euclidean distance.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 46.675px 8px; transform-origin: 46.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRequirements\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 172.317px 8px; transform-origin: 172.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe two input vectors will always have the same length.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 164.15px 8px; transform-origin: 164.15px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe final result must be rounded to 2 decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 23.8667px 8px; transform-origin: 23.8667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou are\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 156.767px 8px; transform-origin: 156.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNOT allowed to use the following built-in functions:\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 8px; transform-origin: 15.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003enorm\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 26.8417px 8px; transform-origin: 26.8417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evecnorm\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 11.6667px 8px; transform-origin: 11.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esqrt\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003edot\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 14.7833px 8px; transform-origin: 14.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003epdist\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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 y = your_fcn_name(x,z)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'norm')) \u0026 (isempty(strfind(filetext, 'vecnorm'))) \u0026 (isempty(strfind(filetext, 'sqrt')))\u0026 (isempty(strfind(filetext, 'dot'))) \u0026 (isempty(strfind(filetext, 'pdist'))))\r\n%%\r\nx=[1 2 3];\r\nz=[4 3 4];\r\ny_correct = 3.32;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[1 22 32];\r\nz=[41 23 34];\r\ny_correct = 40.06;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[-1 22 -32];\r\nz=[41 23 34];\r\ny_correct = 78.24;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[-100 12 133 4 66];\r\nz=[1234 -123456 0.7 12.1 -12.8];\r\ny_correct = 123475.3;\r\nassert(isequal(your_fcn_name(x,z),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-03-03T09:48:07.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-03-03T08:28:28.000Z","updated_at":"2026-04-02T01:57:28.000Z","published_at":"2026-03-03T08:28:28.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\u003eWrite a function that computes the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between two N-dimensional vectors.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two input vectors \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of equal length, compute their Euclidean distance.\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\u003eRequirements\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\u003eThe two input vectors will always have the same length.\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:t\u003eThe final result must be rounded to 2 decimal places.\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\u003eYou are\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:rPr/\u003e\u003cw:t\u003eNOT allowed to use the following built-in functions:\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\u003enorm\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\u003evecnorm\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\u003esqrt\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\u003edot\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\u003epdist\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\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":44762,"title":"Find The Difference","description":"Vector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;","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: 400; 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=\"\"\u003eVector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dif = difference(x)\r\n\r\nend","test_suite":"%%\r\nx =[ 3 2 2 3 6 9 8 4];\r\ndif_correct = 76308633;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[ 3 2 2 0 0 4];\r\ndif_correct = 429966;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[1 1 1];\r\ndif_correct = 0;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[1 2 3 3 2 1];\r\ndif_correct = 219978;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":246131,"edited_by":26769,"edited_at":"2023-04-07T19:18:03.000Z","deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2019-04-25T19:06:31.000Z","rescore_all_solutions":false,"group_id":162,"created_at":"2018-10-31T09:59:39.000Z","updated_at":"2026-03-31T13:00:16.000Z","published_at":"2018-11-10T14:25:31.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\u003eVector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;\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":60939,"title":"Frequencies of prime gaps","description":"Problem statement\r\n\r\nGiven two positive integers n and , write a function which computes the frequency of the gap   between two consecutive of the primes in the prime vector going from 2 to n.\r\n\r\nExamples\r\n\r\nFor n = 100 and = 2, your function should return f = 1/3 since one third of the prime gaps between 2 and 97 equal ;\r\nFor n = 1000 and = 6, your function should return f = 44/167;\r\n\r\n\r\nSee also\r\nProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\r\nPrime numbers properties II","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: 414.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 207.367px; transform-origin: 408px 207.367px; 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.0083px 8px; transform-origin: 63.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 85.575px 8px; transform-origin: 85.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven two positive integers \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: 5.83333px 8px; transform-origin: 5.83333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en \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: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\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: 180.475px 8px; transform-origin: 180.475px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewrite a function which computes the frequency of the gap  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 81.7833px 8px; transform-origin: 81.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between two consecutive of the primes in the prime vector going from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e2\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: 9.71667px 8px; transform-origin: 9.71667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 81.7333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 40.8667px; transform-origin: 392px 40.8667px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.4833px 8px; transform-origin: 25.4833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en = 100 \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.925px 8px; transform-origin: 9.925px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= 2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 86.7417px 8px; transform-origin: 86.7417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, your function should return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.5833px 8px; transform-origin: 21.5833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e f = 1/3\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 133.808px 8px; transform-origin: 133.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e since one third of the prime gaps between \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e 97\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.0083px 8px; transform-origin: 21.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e equal \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 55.4333px 8px; transform-origin: 55.4333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor n = 1000 and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.925px 8px; transform-origin: 9.925px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= 6\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 86.7417px 8px; transform-origin: 86.7417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, your function should return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.8583px 8px; transform-origin: 11.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e f = \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e44/\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e167;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95759\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties II\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = frequencies_of_prime_gaps(delta, n)\r\n  f = delta*n;\r\nend","test_suite":"%%\r\ndelta = 2;\r\nn = 100;\r\nf_correct = 1/3;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 2;\r\nn = 200;\r\nf_correct = 15/45;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 6;\r\nn = 1000;\r\nf_correct = 44/167;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 4;\r\nn = 200;\r\nf_correct = 13/45;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 24;\r\nn = 10000;\r\nf_correct = 15/1228;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 1;\r\nn = 100;\r\nf_correct = 1/24;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 3;\r\nn = 100;\r\nf_correct = 0;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('frequencies_of_prime_gaps.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T06:48:50.000Z","deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2025-07-09T05:56:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-24T10:21:21.000Z","updated_at":"2026-03-16T13:25:01.000Z","published_at":"2025-06-24T11:07:25.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement\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\u003eGiven two positive integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eand\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\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\u003e\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003ewrite a function which computes the frequency of the gap  \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e between two consecutive of the primes in the prime vector going from \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\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\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\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en = 100 \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eand \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= 2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, your function should return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e f = 1/3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e since one third of the prime gaps between \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e 97\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e equal \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\\\\Delta\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor n = 1000 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\u003e\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= 6\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, your function should return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e f = \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e44/\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e167;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\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: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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95759\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties II\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":49337,"title":"Minkowski distance","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGet the Minkowski distance between the vectors. Round the result to the 4th decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = minkowski(v1,v2,p)\r\n    y = p;\r\nend","test_suite":"%%\r\nv1=1:10;\r\nv2=11:20;\r\np=2;\r\nassert(isequal(minkowski(v1,v2,p),31.6228))\r\n%%\r\nv1=1:4:50;\r\nv2=25:4:75;\r\np=5;\r\nassert(isequal(minkowski(v1,v2,p),40.0867))\r\n%%\r\nv1=1:8:50;\r\nv2=25:8:75;\r\np=9;\r\nassert(isequal(minkowski(v1,v2,p),29.7928))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-23T11:48:54.000Z","updated_at":"2026-02-04T11:51:43.000Z","published_at":"2020-12-31T01:23:13.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\u003eGet the Minkowski distance between the vectors. Round the result to the 4th decimal.\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":59711,"title":" Calculating distance of lightning based on time delay","description":"If we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(t)\r\n  %Easier than it looks\r\nend","test_suite":"%%\r\nt = 1;\r\ny_correct = 343;\r\nassert(isequal(your_fcn_name(t),y_correct))\r\n%%\r\nt = 57;\r\ny_correct = 19551;\r\nassert(isequal(your_fcn_name(t),y_correct))\r\n%%\r\nt = randi(1000);\r\ny_correct = 343*t;\r\nassert(isequal(your_fcn_name(t),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4207616,"edited_by":4207616,"edited_at":"2024-03-23T10:18:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":"2024-03-23T10:18:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-03-23T10:15:53.000Z","updated_at":"2025-08-26T12:10:35.000Z","published_at":"2024-03-23T10:18:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. \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":43007,"title":"Euclidean inter-point distance matrix","description":"The Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\r\n\r\nBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\r\n\r\nThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\r\n\r\nSo you can test your code, here is an example:\r\n\r\n  A = [1 1\r\n       5 2\r\n       2 2\r\n       4 5]\r\n\r\n  format short g\r\n  D = interDist(A)\r\n  D =\r\n         0       4.1231       1.4142            5\r\n    4.1231            0            3       3.1623\r\n    1.4142            3            0       3.6056\r\n         5       3.1623       3.6056            0\r\n\r\nThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\r\n\r\nAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.","description_html":"\u003cp\u003eThe Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\u003c/p\u003e\u003cp\u003eBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\u003c/p\u003e\u003cp\u003eThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\u003c/p\u003e\u003cp\u003eSo you can test your code, here is an example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 1\r\n     5 2\r\n     2 2\r\n     4 5]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eformat short g\r\nD = interDist(A)\r\nD =\r\n       0       4.1231       1.4142            5\r\n  4.1231            0            3       3.1623\r\n  1.4142            3            0       3.6056\r\n       5       3.1623       3.6056            0\r\n\u003c/pre\u003e\u003cp\u003eThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\u003c/p\u003e\u003cp\u003eAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.\u003c/p\u003e","function_template":"function D = interDist(A)\r\n  % compute the interpoint distance matrix between rows of A\r\n  D = A;\r\nend\r\n\r\n","test_suite":"%%\r\nA = eye(3);\r\ny_correct = (1-A)*sqrt(2);\r\ntol = 10*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n%%\r\nA = (1:4)';\r\ny_correct = [     0     1     2     3;...\r\n     1     0     1     2;...\r\n     2     1     0     1;...\r\n     3     2     1     0];\r\ntol = 10*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n\r\n\r\n\r\n%%\r\nA = magic(3);\r\ny_correct = [0       6.48074069840786 9.79795897113271; ...\r\n  6.48074069840786                0 6.48074069840786; ...\r\n  9.79795897113271 6.48074069840786                0];\r\ntol = 1000*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n%%\r\nA = reshape((1:20).^2,4,5);\r\ntol = 1e-12;\r\ny_correct = [0 49.4469412603045 102.761860629321 160.015624237135; ...\r\n   49.4469412603045 0 53.3385414123783 110.634533487515; ...\r\n   102.761860629321 53.3385414123783 0 57.3149195236284; ...\r\n   160.015624237135 110.634533487515 57.3149195236284 0];\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":28,"test_suite_updated_at":"2016-10-02T16:43:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-02T13:56:26.000Z","updated_at":"2026-04-02T13:14:06.000Z","published_at":"2016-10-02T16:43:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo you can test your code, here is an example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = [1 1\\n     5 2\\n     2 2\\n     4 5]\\n\\nformat short g\\nD = interDist(A)\\nD =\\n       0       4.1231       1.4142            5\\n  4.1231            0            3       3.1623\\n  1.4142            3            0       3.6056\\n       5       3.1623       3.6056            0]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":450,"title":"What is the distance from point P(x,y) to the line Ax + By + C = 0?","description":"Given a point, P(x,y), find the distance from this point to a linear line.\r\n\r\nINPUTS: x, y, A, B, C\r\n\r\nOUTPUTS: d, the distance which of course should always be positive.\r\n    \r\n  EX:\r\n  \u003e\u003ex=2; y=2; A=2; B=2; C=-4;\r\n  \u003e\u003ed = normalLen(x,y,A,B,C)\r\n  d = 1.4142\r\n\r\n\r\n","description_html":"\u003cp\u003eGiven a point, P(x,y), find the distance from this point to a linear line.\u003c/p\u003e\u003cp\u003eINPUTS: x, y, A, B, C\u003c/p\u003e\u003cp\u003eOUTPUTS: d, the distance which of course should always be positive.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eEX:\r\n\u003e\u003ex=2; y=2; A=2; B=2; C=-4;\r\n\u003e\u003ed = normalLen(x,y,A,B,C)\r\nd = 1.4142\r\n\u003c/pre\u003e","function_template":"function d = normalLen(x,y,A,B,C)\r\n  d = x+y+[A,B,C]\r\nend","test_suite":"%% test 1\r\nx=2; y=2; A=2; B=2; C=-4;\r\ny_correct = 1.4142;\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)\u003c=1e-4)\r\n%% test 2\r\nx=3; y=4; A=3; B=4; C=5;\r\ny_correct = 6;\r\nassert(normalLen(x,y,A,B,C)-y_correct==0)\r\n%% test 3\r\nx=4; y=5; A=3; B=4; C=5;\r\ny_correct = 7.4;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)\u003c1e-1)\r\n%% test 4\r\nx=0;y=12345;A=0;B=1;C=0;\r\ny_correct = 12345;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)==0)\r\n%% test 5\r\nx=0;y=-12345;A=0;B=1;C=0;\r\ny_correct = 12345;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)==0)\r\n\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":560,"test_suite_updated_at":"2013-01-26T00:45:07.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-03-05T04:51:25.000Z","updated_at":"2026-03-13T05:04:32.000Z","published_at":"2012-03-06T06:29:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a point, P(x,y), find the distance from this point to a linear line.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eINPUTS: x, y, A, B, C\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOUTPUTS: d, the distance which of course should always be positive.\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[EX:\\n\u003e\u003ex=2; y=2; A=2; B=2; C=-4;\\n\u003e\u003ed = normalLen(x,y,A,B,C)\\nd = 1.4142]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2393,"title":"Measure a Special Distance","description":"Given an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.","description_html":"\u003cp\u003eGiven an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.\u003c/p\u003e","function_template":"function ldist = measure_dist(linef,cd,gd)\r\nn=size(linef,1);\r\nldist=zeros(n);\r\nfor a=1:n\r\n    for b=1:n\r\n        if linef(a,1)\u003e0\u0026\u0026linef(b,2)\u003e0\r\n            ldist(b,a)=( linef(a,1)+linef(b,2)-cd ).^2;\r\n        elseif linef(a,1)\u003c0\u0026\u0026linef(b,2)\u003c0\r\n            ldist(b,a)=( linef(a,1)+linef(b,2)-gd ).^2;\r\n        else\r\n            ldist(b,a)=( abs(linef(a,1)-linef(b,2))-(cd-gd) ).^2;\r\n        end\r\n    end\r\nend","test_suite":"%%\r\ncd=randi(100);\r\ngd=-randi(100);\r\nlinef=(cd-gd)*rand(randi([50,100]),2)+gd;\r\n%\r\nn=size(linef,1);\r\nldist=zeros(n);\r\nfor a=1:n\r\n    for b=1:n\r\n        if linef(a,1)\u003e0\u0026\u0026linef(b,2)\u003e0\r\n            ldist(b,a)=(linef(a,1)+linef(b,2)-cd).^2;\r\n        elseif linef(a,1)\u003c0\u0026\u0026linef(b,2)\u003c0\r\n            ldist(b,a)=(linef(a,1)+linef(b,2)-gd).^2;\r\n        else\r\n            ldist(b,a)=(abs(linef(a,1)-linef(b,2))-(cd-gd)).^2;\r\n        end\r\n    end\r\nend\r\ny_correct=ldist;\r\nf_result=measure_dist(linef,cd,gd);\r\nassert(all(abs(f_result(:)-y_correct(:))\u003c0.1))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":18223,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2014-07-02T13:30:11.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-28T05:23:57.000Z","updated_at":"2014-07-03T15:58:45.000Z","published_at":"2014-07-02T11:59:26.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2199,"title":"Pairwise Euclidean Distance","description":"Given two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns).  The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\r\n\r\nExample:\r\n\r\n pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\r\n ans =\r\n    5.6569    8.4853   11.3137\r\n    2.8284    5.6569    8.4853","description_html":"\u003cp\u003eGiven two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns).  The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\r\n ans =\r\n    5.6569    8.4853   11.3137\r\n    2.8284    5.6569    8.4853\u003c/pre\u003e","function_template":"function d = pairEuc(a,b)\r\n  d = zeros(size(a,2),size(b,2));\r\nend","test_suite":"%%\r\na = [9 10 3 10 10; 10 7 6 2 5; 2 1 10 10 9];\r\nb = [2 8 1; 5 10 9; 10 7 10];\r\nd = [11.7473    5.0990   11.3578; ...\r\n     12.2066    7.0000   12.8841; ...\r\n      1.4142    7.0711    3.6056; ...\r\n      8.5440    8.7750   11.4018; ...\r\n      8.0623    5.7446    9.8995];\r\nassert(all(all(abs(pairEuc(a,b)-d)\u003c1e-4)))\r\n\r\n%%\r\na = [1 2; 3 4]';\r\nb = [5 6; 7 8; 9 10]';\r\nd = [5.6569    8.4853   11.3137;...\r\n     2.8284    5.6569    8.4853];\r\nassert(all(all(abs(pairEuc(a,b)-d)\u003c1e-4)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":23140,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":"2014-02-19T00:50:33.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-02-19T00:27:04.000Z","updated_at":"2026-02-19T10:24:33.000Z","published_at":"2014-02-19T00:50:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns). The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[ pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\\n ans =\\n    5.6569    8.4853   11.3137\\n    2.8284    5.6569    8.4853]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44816,"title":"Word Distance - Average Sort","description":"Based on the method of \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum this problem\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if \r\n\r\n str_arr = {'jazz','cab','tree'}\r\n\r\nthen \r\n\r\n d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]\r\n\r\nwhich would result in the following sorted order:\r\n\r\n str_arr_sort = {'cab','tree','jazz'}\r\n\r\nRemember that the method is case insensitive. See the test suite for examples.","description_html":"\u003cp\u003eBased on the method of \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum\"\u003ethis problem\u003c/a\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if\u003c/p\u003e\u003cpre\u003e str_arr = {'jazz','cab','tree'}\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre\u003e d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]\u003c/pre\u003e\u003cp\u003ewhich would result in the following sorted order:\u003c/p\u003e\u003cpre\u003e str_arr_sort = {'cab','tree','jazz'}\u003c/pre\u003e\u003cp\u003eRemember that the method is case insensitive. See the test suite for examples.\u003c/p\u003e","function_template":"function d = word_distance_sort(str_arr)\r\n d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(word_distance_sort({'jazz','cab','tree'}),{'cab','tree','jazz'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'first','second','third'}),{'first','second','third'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'the','longest','words','supercede','some','of','the','shortest'}), ...\r\n\t{'some','longest','of','the','the','supercede','shortest','words'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'}), ...\r\n\t{'one','TWO','EiGHt','FouR','NINe','Three','ten','fiVe','six','sEvEn'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'Why','is','it','that','this','does','not','work','as','expected'}), ...\r\n\t{'not','work','is','it','this','does','as','expected','that','Why'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'set','of','very','short','words','for','this','test','case'}), ...\r\n\t{'for','of','short','this','test','words','case','very','set'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'iron','zinc','carbon','molybdenum','praseodymium','silicon'}), ...\r\n\t{'iron','silicon','molybdenum','carbon','zinc','praseodymium'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'crazier','craziest','crazy'}), ...\r\n\t{'crazy','craziest','crazier'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'this','test','case','with','only','four','each','word'}), ...\r\n\t{'each','only','four','this','word','test','case','with'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'largest','smallest','sourest','sweetest'}), ...\r\n\t{'sourest','smallest','largest','sweetest'}))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-01-02T15:43:24.000Z","updated_at":"2025-11-21T14:57:55.000Z","published_at":"2019-01-09T15:06:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased on the method of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ethis problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if\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[ str_arr = {'jazz','cab','tree'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\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[ d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhich would result in the following sorted order:\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[ str_arr_sort = {'cab','tree','jazz'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRemember that the method is case insensitive. See the test suite for examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2100,"title":"distance to a straight line (2D) given any 2 distinct points on this straight line","description":"Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\r\n\r\nHint: create a parameter representation of the (very...) long line.","description_html":"\u003cp\u003eGiven 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\u003c/p\u003e\u003cp\u003eHint: create a parameter representation of the (very...) long line.\u003c/p\u003e","function_template":"function d = dist2line(p1,p2,pe)\r\n  d=norm(pe);\r\nend","test_suite":"%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[-2;0];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071070e-01))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[-0.8;0.1];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071100e-02))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[0;0.9];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071100e-02))\r\n%%\r\np1=[0;-1];\r\np2=[0;1];\r\npe=[-pi;100];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,3.141593))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[0;1];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,0))","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":20079,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":"2014-01-15T03:55:52.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-01-10T05:50:50.000Z","updated_at":"2026-02-19T10:19:57.000Z","published_at":"2014-01-10T13:49:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\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\u003eHint: create a parameter representation of the (very...) long line.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60940,"title":"Find the first occurence of a given gap between two consecutive prime numbers","description":"Problem statement \r\n\r\nGiven a gap = p' - p between the two consecutive prime numbers p and p', find its first occurence, f.\r\n\r\nExamples\r\n\r\nIf , f=2, since 5 - 3 = 2, and 3 is the 2nd prime;\r\nIf , f=4, since 11 - 7 = 4, and 7 is the 4th prime;\r\nIf , f=9, since 29 - 23 = 6, and 23 is the 9th prime;\r\nIf  neither equals an even positive integer nor equals 1 your function should return the empty set : f = []; \r\n\r\nSee also\r\nProblem 60939. Frequencies of prime gaps\r\nPrime numbers properties II","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: 403.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 201.65px; transform-origin: 408px 201.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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 64.95px 8px; transform-origin: 64.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 39.675px 8px; transform-origin: 39.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a gap \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.3667px 8px; transform-origin: 21.3667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= p' - 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; perspective-origin: 142.367px 8px; transform-origin: 142.367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between the two consecutive prime 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: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 9.10833px 8px; transform-origin: 9.10833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep', \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: 75.4417px 8px; transform-origin: 75.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efind its first occurence, f.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.3px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 30.65px; transform-origin: 392px 30.65px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAAC70lEQVRoQ+1YPUgeQRDVXgmaSttYKKSwiQohbQRBLAIaxMIuSZFSiBYhpDCQlCmSCHYi0c4mEBELRclPk0JIiliYQisDwfTJe7ID67l7397Owbef7MHj7vtuZ2727dvZ2W1vy5eKgXaVdTZuywQqRZAJzAQqGVCaZwVmApUMKM1jFXiM774GXii/n4p5NwJ5AowD/SaoE9x3gUfAb1+gMQTehbOPwF+gMxUGFHHcgu0G0OPxwX4OAoeu9zEEfoKjYePsPu5riuBTMP2OIK4BK8CWCege7tNAh/ntFUtVAm/A4U+r1z/wPJACC5ExzMPuMTABfC344LQ+sJTJqfy2+J2qBFJtY8aJjE4rq5C5/LmLGNPHh7i/Mc/ruE9pCOSInAJLwB9gzjj7jPtIpAKaacbZxEWityQI6TObbAKjGgJfwpgyZkLlZU/lIfwuToFmklPnt/8ZZxTOg1gCORJHwL41CpzOk8ahc3Tq7EWTfNkKdKaq0BzIXPAK4OpEsnhx+f9idawPz86lPrDzVLikhUATZ7M6ZwNz3nuANaFzqocSyGTLvFdcce2SxinxCkykSKDMMu9CGUKgjILLibwTnq7jwVu1VyAzhaZSspWmpxACqTIWmr56j+qUKl6rwhSIkxjYb14s26K3cpLnFuDEt++1a6Wrsr1jOpkBXAX2hUFupEDmgDvAzQZT8wzvpbAuIzslhflioSCehpBHB2UESg4ImZb2AhCrwhQWkUrkNSLwHRpwQ+09ibCG0K6X+HfM9q7ZBIaQx35eyIc+BUrhvAqDS9W3R/t2Yd1qhwxypDWLvkmdW+wmOdkDbtsk+gjkKcUiwALyV2Di4koth5GxKgz8VK3NSN428AFY9njuwv/PgJ2ioHwE2qVJbLStcMgg5MkCWNZX5nZ7J3be1kWgXZbEkid2dW6rtLEU7blIfgNCyKOtMy01KmPqDvrK+csEKoc0E5gJVDKgNM8KzAQqGVCaZwVmApUMKM2zApUE/gdVDoAl3uI4wAAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 90.0333px 8px; transform-origin: 90.0333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 5 - 3 = 2, and 3 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e2nd\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAACd0lEQVRoQ+2YPS8FQRSG3Z5IqCQSBQWJQuMjES2JRBQSRNQ+fgDBDyChUCh81CL8BAod8dGQKBQURKhIhJ73lZlkct27OztnrLv3ziZvrLtz5px59szsmclVhUtEICeyDsZVAaAwCQLAAFBIQGgeMjAAFBIQmrtm4DP8bkArQv+lbF6H4E6gRqimWKAuAPvR2SH0GdVxKZOxjG0b7abixukC8AyddqsgxvH3wDKgLDUbQ7D7KuDIREkKsBmd3hkkbnHfliUyFrFyjFfQE9TqOwOZbYMqiOoyzULOsHfoGprzCZCL6iu0oxywc17nUI/Fm81Ck1UEOQm1Qwu+AbLzWahDkTCnchd+u8wCoYgYO/HsGBqBjiCO11sGMvseoFNoQAXB6Tyq7ulQ/55FjhzfDbQLzasBeAU4g07XjLdDH3xjFwatFtzfC+jpgAVd/Ji6zAYmQxNkLkVeAbJw5sKa/8U1SxqujdOC0f8XQJYs69AwZC5D3gDqmqhQzWfWS2RXD70JIKZtqksWrnVbec69AWSW1RbIPu2P2dmg/pFmYdoAOTau7UyE/MsLQL3OLaH3Yvtero+bynuWtncENAT1Fpk1XgByce2DWBdFTc0PPNeFdRTstDMsyt+XQzC/EiRqK6e3bTbT0vwAuGZh2h+RPwfI04gJiIVzXHmidyn6pbocMqQNMC4BRVNYF8578GJbmpiFdTkcMogALgLcMvQCPca9KvWcX2qeXkiy0NJVKs1EAM3SxDXarB8yOAM0yxJXeNrOZVsl9enL3hmgrwAqop+kJ9IVASXJIAPAJLQKtA0AA0AhAaF5yMAAUEhAaB4yMAAUEhCafwM814AluHiUvQAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=4\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 93.4083px 8px; transform-origin: 93.4083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 11 - 7 = 4, and 7 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 10.5px 8px; transform-origin: 10.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e4th\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAADEUlEQVRoQ+1Yv2sVQRB+6RVRq6SxiIVCCiExEUFLBTsREkmVKuofYKFFyghaWmgsRCzEH4W1SReIaGxsBAsttNBKIcTefB/syLy727vdnXd3RPbg4z3e253Z+e7bmdkdG+THxMCYaXaePMgEGkWQCcwEGhkwTs8KzAQaGaiffgR/zwDTwGHgFfBBT0lV4A8YuQ/caXX5/Rm/DteXgbPAW+AxsAH8Li4phcALMPIG+AMc7C/GVjyfhtWnwAngPbACrNd5SiHwHQzOOaNX8fmilVC6N0rV3QMOAC+BG1WKsypwEga+KCOf8f1k97GO3OMCLD53Vqm8M6EeYhVItV1yxvmm+Ox3FVIUH53yfuJzKkR5QnAMgaxIv4BHwA5wM+WNhb7ZDsfplHQbfqMKYwyBd11eOOWC01t5Fr8NlfcOCbC4YtHYdgZYFI/FqI/zQgmk+r4BLOkXnUNu53n3nZVKfrcE1PXcYgyvsYAlQIokc/wmcMtHbCiBUqGuwJCUdf32GPhx4KuBASpc0oLBzCBmN7CfHVcK/OQI40/nFZFUJ3deKb5QAumIea9YcXX+YG68Zoi8DwL/qvVW5T8K54EiuNT3hhAoJb6q2uryTz9HfVI3ENvWVDkQ0D6r74THkd7m7A0f6nEhBFJlhyrUJ3b0NrCqsC2yquxqAutyuBZJaVwTgZLn6sp7o8y7ZCXCVyiB0r7RdOn42kQg5XsOaGoudzFGGuvoXioi6FEPlRzY1EXIuCgC5dgWsi11AUi9ZOijiEj6aVqzEFg6utYpcA2vexGoLN8FKWiZ86+U410fBDLGZReLrwDq2HjJwJz47/ERKI3zM4wMbU10tdovlwz6csSXenSu5GFh6HrLRyA771WA5f17YOJhpeY9mjwpKgx0NdJhvNskSb5tLMKozJM+AnVrkrraqGuhVCcjmMfdtuVefnHnSIfBWHgLFXQjrdsS6/pijlVWX9b5jHsJ4DmYhMnzBF+GmmftqKmNsS7qv5+fCTS+4kxgJtDIgHF6VmAm0MiAcXpWYCbQyIBxelagkcA9dW2WJVpPbIMAAAAASUVORK5CYII=\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=9\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 101.708px 8px; transform-origin: 101.708px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 29 - 23 = 6, and 23 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 10.5px 8px; transform-origin: 10.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e9th\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 158.333px 8px; transform-origin: 158.333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e neither equals an even positive integer nor equals \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: 5.83333px 8px; transform-origin: 5.83333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e1 \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: 132.625px 8px; transform-origin: 132.625px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eyour function should return the empty set : \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: 14.975px 8px; transform-origin: 14.975px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ef = []\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60939-frequencies-of-prime-gaps\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60939. Frequencies of prime gaps\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95759\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties II\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = first_occurence_of_prime_gap(delta)\r\n  f = delta;\r\nend","test_suite":"%%\r\ndelta = 2;\r\nf_correct = 2;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 4;\r\nf_correct = 4;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 6;\r\nf_correct = 9;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 8;\r\nf_correct = 24;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 14;\r\nf_correct = 30;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 10;\r\nf_correct = 34;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 12;\r\nf_correct = 46;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 1;\r\nf_correct = 1;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 3;\r\nf_correct = [];\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = -1 +1i*pi;\r\nf_correct = [];\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('first_occurence_of_prime_gap.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T06:47:33.000Z","deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":"2025-07-09T05:56:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-25T12:22:19.000Z","updated_at":"2026-03-30T01:19:31.000Z","published_at":"2025-06-25T13:06:05.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement \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\u003eGiven a gap \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= p' - p\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between the two consecutive prime numbers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep', \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003efind its first occurence, f.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf \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\\\\Delta = 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 5 - 3 = 2, and 3 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2nd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf \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\\\\Delta = 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 11 - 7 = 4, and 7 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e4th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\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\u003e\\\\Delta = 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=9\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 29 - 23 = 6, and 23 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e9th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\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 \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e neither equals an even positive integer nor equals \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e1 \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eyour function should return the empty set : \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ef = []\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\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60939-frequencies-of-prime-gaps\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60939. Frequencies of prime gaps\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95759\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties II\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":490,"title":"Fastest shortest-path-finder in the west","description":"Given connectivity information about a graph, your job is to find the shortest-path distance between every pair of vertices in this graph.\r\nNote: Valid solutions will be scored based on their speed, not their size (hence the fastest in the west...).\r\nFormat: D = mindist(from,to)\r\nInputs: two vectors, from and to, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex a and b does not imply a connection between vertex b and a; in other words this is a directed graph)\r\nOutput: D is a square matrix where D(a,b) is the number of edges in the shortest-path starting from vertex a and ending in vertex b (or inf if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\r\nExample:\r\n    D=mindist([1,2,3],[2,3,4])\r\n    D =\r\n\r\n     0     1     2     3\r\n   Inf     0     1     2\r\n   Inf   Inf     0     1\r\n   Inf   Inf   Inf     0\r\nImportant note \u0026 disclaimer: Your algorithm will be scored based on its speed, not based on its cody size. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g. http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments) regarding the cody scoring method. This problem is just a little experiment on tweaking cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 527px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 469px 263.5px; transform-origin: 469px 263.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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven connectivity information about a graph, your job is to find the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Shortest_path_problem\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eshortest-path distance\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between every pair of vertices in this graph.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: Valid solutions will be scored based on their\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003espeed\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, not their\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003esize\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (hence the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003efastest in the west\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: 0px 0px; transform-origin: 0px 0px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFormat:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e D = mindist(from,to)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 31.5px; text-align: left; transform-origin: 445px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInputs:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e two vectors,\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003efrom\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eto\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e does not imply a connection between vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e; in other words this is a directed graph)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 31.5px; text-align: left; transform-origin: 445px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eD\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a square matrix where\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eD(a,b)\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the number of edges in the shortest-path starting from vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and ending in vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (or\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003einf\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 126px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 465px 63px; transform-origin: 465px 63px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    D=mindist([1,2,3],[2,3,4])\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    D =\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     2     3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf     0     1     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf   Inf     0     1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf   Inf   Inf     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 126px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 63px; text-align: left; transform-origin: 445px 63px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eImportant note \u0026amp; disclaimer:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Your algorithm will be scored based on its\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003espeed\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, not based on its cody\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003esize\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g.\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"\"\u003ehttp://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e) regarding the cody scoring method. This problem is just a little experiment on\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003etweaking\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function D = mindist(from,to)\r\n  D=zeros(max([from,to]));\r\nend","test_suite":"%%\r\n% test small connectivity matrix (3x3)\r\nassert(isequal(mindist([1,3,2,3],[2,2,1,2]),[0 1 Inf;1 0 Inf;2 1 0]))\r\nt0=clock;\r\nD=mindist([1,3,2,3],[2,2,1,2]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)'); \r\ndisp(t1)\r\n\r\n%%\r\n% test small connectivity matrix (10 vertices, 15 edges)\r\nassert(isequal(mindist([10 5 5 7 7 3 3 4 6 6 1 8 7 1 10],[7 4 10 6 8 4 1 7 9 4 6 9 6 10 9]),[0 Inf Inf 2 Inf 1 2 3 2 1;Inf 0 Inf Inf Inf Inf Inf Inf Inf Inf;1 Inf 0 1 Inf 2 2 3 3 2;Inf Inf Inf 0 Inf 2 1 2 3 Inf;Inf Inf Inf 1 0 3 2 3 2 1;Inf Inf Inf 1 Inf 0 2 3 1 Inf;Inf Inf Inf 2 Inf 1 0 1 2 Inf;Inf Inf Inf Inf Inf Inf Inf 0 1 Inf;Inf Inf Inf Inf Inf Inf Inf Inf 0 Inf;Inf Inf Inf 3 Inf 2 1 2 1 0]))\r\nt0=clock;\r\nD=mindist([10 5 5 7 7 3 3 4 6 6 1 8 7 1 10],[7 4 10 6 8 4 1 7 9 4 6 9 6 10 9]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% test small connectivity matrix (10 vertices, 30 edges)\r\nassert(isequal(mindist([4 10 2 9 8 2 7 10 3 7 5 9 2 6 9 3 2 9 8 7 9 9 10 8 2 7 3 2 1 8],[2 6 9 4 3 1 4 8 10 5 4 6 5 5 7 4 7 1 4 4 3 8 5 7 5 4 7 3 4 1]),[0 2 3 1 3 4 3 4 3 4;1 0 1 2 1 2 1 2 1 2;3 2 0 1 2 2 1 2 3 1;2 1 2 0 2 3 2 3 2 3;3 2 3 1 0 4 3 4 3 4;4 3 4 2 1 0 4 5 4 5;3 2 3 1 1 4 0 4 3 4;1 2 1 1 2 3 1 0 3 2;1 2 1 1 2 1 1 1 0 2;2 3 2 2 1 1 2 1 4 0]))\r\nt0=clock;\r\nD=mindist([4 10 2 9 8 2 7 10 3 7 5 9 2 6 9 3 2 9 8 7 9 9 10 8 2 7 3 2 1 8],[2 6 9 4 3 1 4 8 10 5 4 6 5 5 7 4 7 1 4 4 3 8 5 7 5 4 7 3 4 1]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% test medium connectivity matrix (100 vertices, 200 edges)\r\ni=[17 21 97 93 63 87 68 14 40 12 30 60 45 63 55 43 71 74 32 66 48 27 10 80 1 50 36 40 100 35 84 75 93 94 79 49 6 6 60 24 80 43 60 41 64 87 1 17 44 63 6 89 15 70 74 48 69 68 63 24 77 82 48 69 33 50 100 90 37 29 10 62 61 87 69 6 45 27 77 8 100 94 77 26 8 72 59 4 4 36 59 47 9 60 95 88 15 27 32 50 51 42 40 76 22 32 68 39 46 82 32 27 15 39 75 63 33 63 63 91 64 43 13 10 2 56 10 62 45 24 44 58 80 2 44 98 80 92 31 97 76 82 48 68 5 100 91 65 65 90 77 96 95 44 84 4 29 85 25 99 26 75 47 2 47 64 63 4 83 73 63 26 56 99 9 98 47 7 82 53 86 84 66 40 83 76 69 86 74 60 18 99 69 3 10 35 85];\r\nj=[6 27 87 92 2 77 23 12 86 60 81 18 14 69 98 84 91 76 12 81 22 81 4 26 25 27 56 39 52 20 56 92 21 37 61 100 24 67 34 76 77 90 46 25 76 69 44 94 65 9 80 28 56 39 65 68 37 51 12 1 64 21 98 50 46 99 86 21 46 99 99 81 16 60 80 20 88 74 68 15 72 55 28 67 11 31 24 39 85 35 64 42 65 87 45 95 78 59 49 13 61 30 28 31 28 35 13 74 13 7 94 60 2 40 74 93 38 18 91 84 25 29 72 36 98 12 41 28 31 54 73 71 49 29 43 82 10 46 8 91 30 80 54 26 83 46 84 51 17 20 78 7 50 30 58 58 27 30 36 15 42 54 32 13 80 89 4 50 56 88 16 98 49 24 91 72 55 77 65 83 79 12 82 70 93 19 95 35 62 98 51 70 48 68 56 28 6];\r\n\r\nassert(isequal(interp2(mindist(i,j),[2 55 45 33 34 87 53 43 99 50],[90 66 53 41 94 68 94 38 23 76],'nearest'),[8,5,8,Inf,7,7,Inf,Inf,Inf,9]))\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% Time-score evaluation\r\n% test medium connectivity matrix (100 vertices, 200 edges)\r\nrand('state',2); \r\nn=100;m=200; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% first run for initialization\r\nassert(isequal(interp2(mindist(i,j),I,J,'nearest'),[6 6 Inf 0 5 Inf 4 8 6 3]))\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(1)=etime(clock,t0)*1e3;\r\n\r\n% test large connectivity matrix (1000 vertices, 2000 edges)\r\nrand('state',0); \r\nn=1000;m=2000; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% first run for initialization\r\nassert(isequal(interp2(mindist(i,j),I,J,'nearest'),[8 8 9 8 11 7 Inf 5 8 Inf]))\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(2)=etime(clock,t0)*1e3;\r\n\r\n% test large connectivity matrix (1000 vertices, 10000 edges)\r\nrand('state',1); \r\nn=1000;m=10000; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(3)=etime(clock,t0)*1e3;\r\nassert(isequal(interp2(D,I,J,'nearest'),[3 4 3 4 4 3 3 2 3 3]))\r\n\r\n% convert time to score\r\ndisp('Time (ms)');\r\ndisp(t1);\r\n\r\n% urlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\n% rehash path; \r\n% SetSolutionScore(round(sum(t1)));\r\n%feval(@evalin,'caller',sprintf('score=%d',round(sum(t1))));\r\n%%fh=fopen('mindist.m','wt');\r\n%%fprintf(fh,'%s\\n',repmat('1;',[1,ceil(sum(t1)/2)]));\r\n%%fclose(fh);","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":43,"edited_by":485721,"edited_at":"2026-03-19T14:03:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2026-03-19T14:03:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-13T04:35:04.000Z","updated_at":"2026-03-19T15:07:26.000Z","published_at":"2012-03-15T18:12:51.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\u003eGiven connectivity information about a graph, your job is to find the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Shortest_path_problem\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eshortest-path distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e between every pair of vertices in this graph.\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: Valid solutions will be scored based on their\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, not their\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (hence the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efastest in the west\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFormat:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e D = mindist(from,to)\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\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e two vectors,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efrom\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eto\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e does not imply a connection between vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; in other words this is a directed graph)\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\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is a square matrix where\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD(a,b)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the number of edges in the shortest-path starting from vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and ending in vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003einf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\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\u003eExample:\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[    D=mindist([1,2,3],[2,3,4])\\n    D =\\n\\n     0     1     2     3\\n   Inf     0     1     2\\n   Inf   Inf     0     1\\n   Inf   Inf   Inf     0]]\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\u003eImportant note \u0026amp; disclaimer:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Your algorithm will be scored based on its\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, not based on its cody\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) regarding the cody scoring method. This problem is just a little experiment on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etweaking\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.\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":190,"title":"Great Circle Distance","description":"Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\r\n","description_html":"\u003cp\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/p\u003e","function_template":"function d = sphere_distance(r,a1,p1,a2,p2)\r\n  d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":281,"test_suite_updated_at":"2012-01-31T02:47:01.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-01-31T02:38:51.000Z","updated_at":"2026-03-31T15:30:19.000Z","published_at":"2012-01-31T02:47:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42319,"title":"How close to a hole","description":"Suppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\r\n\r\n  tfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];\r\n\r\nFor this scenario, we want to have:\r\n\r\n  distancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];\r\n\r\nLets assume that outside the sequence there are zeros. For example:\r\n\r\n                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\r\n","description_html":"\u003cp\u003eSuppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];\r\n\u003c/pre\u003e\u003cp\u003eFor this scenario, we want to have:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edistancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];\r\n\u003c/pre\u003e\u003cp\u003eLets assume that outside the sequence there are zeros. For example:\u003c/p\u003e\u003cpre\u003e                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\u003c/pre\u003e","function_template":"function y = distancesFromHoles(x)\r\n  d = diff([0 v]);\r\nend","test_suite":"%%\r\n        x = [0 0 1 1 1 0];\r\ny_correct = [0 0 1 2 1 0];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\n        x = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\ny_correct = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = [ones(1,10),0,ones(1,10)];\r\ny_correct = [1:5,5:-1:0,1:5,5:-1:1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\n        x = [1 1 1 0 0 0 0 0 0 0 0 0 1 1 1];\r\ny_correct = [1 2 1 0 0 0 0 0 0 0 0 0 1 2 1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = ones(1,101);\r\ny_correct = [1:51,50:-1:1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = [repmat([1,0],[1,50]),1];\r\ny_correct = x;\r\nassert(isequal(distancesFromHoles(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":44119,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-03-03T19:22:09.000Z","rescore_all_solutions":false,"group_id":39,"created_at":"2015-05-17T08:00:09.000Z","updated_at":"2026-04-02T08:20:08.000Z","published_at":"2015-05-17T08:01:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[tfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor this scenario, we want to 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[distancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLets assume that outside the sequence there are zeros. For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44815,"title":"Word Distance - Sum","description":"Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\r\n\r\n word = 'hello'\r\n\r\nthen the total distance would be \r\n\r\n abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.\r\n\r\nLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.","description_html":"\u003cp\u003eLet's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\u003c/p\u003e\u003cpre\u003e word = 'hello'\u003c/pre\u003e\u003cp\u003ethen the total distance would be\u003c/p\u003e\u003cpre\u003e abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.\u003c/pre\u003e\u003cp\u003eLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.\u003c/p\u003e","function_template":"function d = word_distance_sum(str)\r\n d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(word_distance_sum('hello'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Hello'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('HELLO'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('way'),46))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Sway'),50))\r\n\r\n%%\r\n[d] = word_distance_sum({'hello','Sway'});\r\nassert(isequal(d(1),13))\r\nassert(isequal(d(2),50))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Matlab'),51))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('aBCdEfghIJkLmNOPqrStUVwxyZ'),25))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('qwerty'),44))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('bead'),10))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('payday'),87))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('bookkeeper'),58))\r\n\r\n%%\r\n[d] = word_distance_sum({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'});\r\nassert(isequal(d(1),10))\r\nassert(isequal(d(2),11))\r\nassert(isequal(d(3),35))\r\nassert(isequal(d(4),18))\r\nassert(isequal(d(5),33))\r\nassert(isequal(d(6),25))\r\nassert(isequal(d(7),57))\r\nassert(isequal(d(8),19))\r\nassert(isequal(d(9),19))\r\nassert(isequal(d(10),24))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('crazier'),91))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":185,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-01-02T14:44:50.000Z","updated_at":"2026-03-30T18:05:29.000Z","published_at":"2019-01-02T14:44:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\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[ word = 'hello']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen the total distance would be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1446,"title":"Minimum Distance Point to Segment","description":"This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\r\n\r\nThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\r\n\r\nInput are the three defining points and the output is distance.\r\n\r\n*Input (px py vx vy wx wy):*   1 1 0 3 3 0\r\n\r\n*Output distance:* .7071\r\n\r\nPoint is beyond perpendicular to segment.\r\n\r\n*Input (px py vx vy wx wy):*   4 3 -100 0 0 0\r\n\r\n*Output distance:* 5\r\n\r\n\r\nFollow Up Challenges:\r\n\r\n1) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons Minimum distance between non-contiguous N-sided polygons\u003e\r\n\r\n2) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice USC Spring 2013 ACM: Walking on Thin Ice\u003e\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\u003c/p\u003e\u003cp\u003eThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\u003c/p\u003e\u003cp\u003eInput are the three defining points and the output is distance.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput (px py vx vy wx wy):\u003c/b\u003e   1 1 0 3 3 0\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput distance:\u003c/b\u003e .7071\u003c/p\u003e\u003cp\u003ePoint is beyond perpendicular to segment.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput (px py vx vy wx wy):\u003c/b\u003e   4 3 -100 0 0 0\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput distance:\u003c/b\u003e 5\u003c/p\u003e\u003cp\u003eFollow Up Challenges:\u003c/p\u003e\u003cp\u003e1) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons\"\u003eMinimum distance between non-contiguous N-sided polygons\u003c/a\u003e\u003c/p\u003e\u003cp\u003e2) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\"\u003eUSC Spring 2013 ACM: Walking on Thin Ice\u003c/a\u003e\u003c/p\u003e","function_template":"function d=distP2S(px,py,vx,vy,wx,wy)\r\n% segment defined by (vx,vy) to (wx,wy)\r\n% [px py vx vy wx wy]\r\n d=0;\r\nend","test_suite":"%%\r\np=[0 0];\r\nv=[1 -1];\r\nw=[1 1];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-1)\u003c.005)\r\n\r\n%%\r\np=[0 0];\r\nv=[-1 2];\r\nw=[1 2];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-2)\u003c.005)\r\n\r\n%%\r\np=[0 0];\r\nv=[-1 -1];\r\nw=[1 1];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d)\u003c.005)\r\n\r\n%%\r\np=[1 1];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-1/2^.5)\u003c.005)\r\n\r\n%%\r\np=[5 0];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-2)\u003c.005)\r\n\r\n%%\r\np=[0 6];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-3)\u003c.005)\r\n\r\n%%\r\np=[-4 0];\r\nv=[0 3];\r\nw=[-3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2))\r\nassert(abs(d-1)\u003c.005)\r\n\r\n%%\r\np=[1 0];\r\nv=[1.01 0];\r\nw=[5 5];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2))\r\nassert(abs(d-.01)\u003c.005)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":62,"test_suite_updated_at":"2018-07-20T15:16:15.000Z","rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-23T02:10:21.000Z","updated_at":"2026-02-16T10:58:16.000Z","published_at":"2013-04-23T02:45:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput are the three defining points and the output is distance.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput (px py vx vy wx wy):\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 1 1 0 3 3 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput distance:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .7071\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePoint is beyond perpendicular to segment.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput (px py vx vy wx wy):\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 4 3 -100 0 0 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput distance:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFollow Up Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMinimum distance between non-contiguous N-sided polygons\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC Spring 2013 ACM: Walking on Thin Ice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43642,"title":"Euclidean distance from a point to a polynomial","description":"A not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\r\n\r\nAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\r\n\r\nGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003chttps://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\r\n\r\nThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\r\n\r\nAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\r\n\r\n  x0y0 = [-2 -5];\r\n  P = [0.5 3 -5];\r\n  D = distance2polynomial(P,xy)\r\n  D =\r\n          1.89013819497707\r\n\r\n(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\r\n\r\nThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\r\n\r\nDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.","description_html":"\u003cp\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/p\u003e\u003cp\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/p\u003e\u003cp\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003ca href = \"https://en.wikipedia.org/wiki/Euclidean_distance\"\u003eEuclidean distance\u003c/a\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/p\u003e\u003cp\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/p\u003e\u003cp\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\nD = distance2polynomial(P,xy)\r\nD =\r\n        1.89013819497707\r\n\u003c/pre\u003e\u003cp\u003e(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\u003c/p\u003e\u003cp\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/p\u003e\u003cp\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/p\u003e","function_template":"function D = distance2polynomial(P,x0y0)\r\n  % compute the minimum Euclidean distance between a point and a polynomial\r\n  D = rand;\r\nend\r\n","test_suite":"%%\r\nx0y0 = [-2 5];\r\nP = [0.5 3 -5];\r\ny_correct = 4.3093988461280149175163000679048;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [pi, pi];\r\nP = [10];\r\ny_correct = 6.8584073464102067615373566167205;\r\ntol = 7e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0.25,50];\r\nP = [1 2 3 4 5];\r\ny_correct = 1.6470039192886012020234097061626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-3 -3];\r\nP = [-2 1];\r\ny_correct = 4.4721359549995793928183473374626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0 5];\r\nP = [1 0 1];\r\ny_correct = 1.9364916731037084425896326998912;\r\ntol = 2e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\ny_correct = 1.8901381949770695260066523338279;\r\ntol = 2e-13;\r\n(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-28T21:00:14.000Z","updated_at":"2026-02-08T12:58:41.000Z","published_at":"2016-10-28T21:08:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Euclidean_distance\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x0y0 = [-2 -5];\\nP = [0.5 3 -5];\\nD = distance2polynomial(P,xy)\\nD =\\n        1.89013819497707]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(Be careful plotting these curves in case you want to plot your solution. The command \\\"axis equal\\\" is a good idea.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":51,"title":"Find the two most distant points","description":"Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\r\n\r\nSo if\r\n\r\n p = [0 0]\r\n     [1 0]\r\n     [2 2]\r\n     [0 1]\r\n\r\nThen \r\n\r\n ix = [1 3]\r\n\r\nThat is, the two points p(1,:) and p(3,:) are farthest apart.","description_html":"\u003cp\u003eGiven a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\u003c/p\u003e\u003cp\u003eSo if\u003c/p\u003e\u003cpre\u003e p = [0 0]\r\n     [1 0]\r\n     [2 2]\r\n     [0 1]\u003c/pre\u003e\u003cp\u003eThen\u003c/p\u003e\u003cpre\u003e ix = [1 3]\u003c/pre\u003e\u003cp\u003eThat is, the two points p(1,:) and p(3,:) are farthest apart.\u003c/p\u003e","function_template":"function ix = mostDistant(p)\r\n  ix = [1 2];\r\nend","test_suite":"%%\r\np = [0 0;\r\n     1 0;\r\n     2 2;\r\n     0 1];\r\nix_correct = [1 3];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [0 0;\r\n     1 0;\r\n     2 2;\r\n     0 10];\r\nix_correct = [2 4];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [0 0;\r\n    -1 50];\r\nix_correct = [1 2];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [5 5;\r\n     1 0;\r\n     2 2;\r\n     0 10;\r\n     -100 20;\r\n     1000 400];\r\nix_correct = [5 6];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":8,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2952,"test_suite_updated_at":"2012-02-01T19:47:35.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:24.000Z","updated_at":"2026-02-27T13:38:59.000Z","published_at":"2012-01-18T01:00:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo if\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[ p = [0 0]\\n     [1 0]\\n     [2 2]\\n     [0 1]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen\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[ ix = [1 3]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThat is, the two points p(1,:) and p(3,:) are farthest apart.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60953,"title":"Chek the Delta =  p' - p = 6k gap theorem about arithmetic progressions in the prime number set","description":"Context\r\n \r\nIn the prime numbers set there are some arithmetic progressions (sequences of three or more consecutive prime numbers (p, p’, p’’) equally spaced one to the others by an even number  ).\r\n \r\nOne theorem, which can actually easily be proven from , is that above the sole and unique triplet (3, 5, 7) -with a gap of  then-  all the following progressions are such that \r\n \r\nProblem statement\r\n\r\nFor a given interval [i1, i2], i1 \u003e 7 and i2 \u003e 7 find p the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio . \r\n\r\nExamples\r\n                \r\nFor [i1, i2] = [8, 68], p = [47, 53, 59] and k = [1, 1], since this is the first arithmetic progression above 8 and with  here; \r\n \r\nFor [i1, i2] = [180, 228], p = [199, 211, 223], and k = [2, 2], since this is the first arithmetic progression above 180 and with  here;\r\n\r\nFor [i1, i2] = [240, 272], p = [251, 257, 263, 269], and k = [1, 1, 1], since this is the first arithmetic progression above 140 and with  here; \r\n\r\nFor [i1, i2] = [180, 272], p = [199, 211, 223], and k = [2, 2], since this is the first arithmetic progression above 180 and with  here;\r\n\r\nTip\r\n \r\nFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for u = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\r\n\r\nForbidden functions\r\n \r\n \r\nregexp\r\n \r\nstr2num\r\n \r\nassignin\r\n\r\necho\r\n \r\n \r\nSee also\r\n \r\nProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\r\nPrime numbers properties I","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: 1469.2px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 734.6px; transform-origin: 408px 734.6px; 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 26.0583px 8px; transform-origin: 26.0583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eContext\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 248.55px 8px; transform-origin: 248.55px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the prime numbers set there are some arithmetic progressions (sequences of \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: 110.45px 8px; transform-origin: 110.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ethree or more consecutive prime 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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 30.825px 8px; transform-origin: 30.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e(p, p’, 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; perspective-origin: 166.875px 8px; transform-origin: 166.875px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e equally spaced one to the others by an even number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ0AAAAkCAYAAACTxm9CAAAGgElEQVR4Xu1dO8hdRRBOelOolSm00EKxMEV8oGhhoSBJ6ysWVj4KS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8AaXWjNAVLleIAAAAASUVORK5CYII=\" width=\"134.5\" height=\"18\" style=\"width: 134.5px; 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; perspective-origin: 6.21667px 8px; transform-origin: 6.21667px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 172.317px 8px; transform-origin: 172.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOne theorem, which can actually easily be proven from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAAAmCAYAAACI9OF6AAAO1UlEQVR4Xu2da+h+2RTHZ96T8IqEmBcj91yjmRdyKZGQy6BJkVtJEhlJk8TkkuSFS0z/FINCIuWSKSKGKQzxgkLilVu8Z304X1anfc7e++y9z/Oc3289tZrf/J999tn7u9de37XXXns/V18Vn0AgEAgEAoFAIBAYgsDVQ2qNSgOBQCAQCAQCgUDgqiDZUIJAIBAIBAKBQGAQAkGyg4CNagOBQCAQCAQCgSDZ0IFAIBAIBAKBQGAQAkGyg4CNagOBQCAQCAQCgSDZ0IFAIBAIBAKBQGAQAkGyg4CNagOBQCAQCAQCgSDZ0IFAIBAIBAKBFgSebg8/aJI77b+fa6nsoj07J9kfWAefYPJxk1dXdPZjVvZVJj80eWLFc0ct+l5r+JsLG/8nK3eXyZdMPlr4TBT7LwJM3leYXGdyH5N/mnzf5O0mP7ogINHHr1f25W1W/j2Vzxyt+L9mDX6f/f9bCjuBHfu7yTMWyj/O/h1SCDIoBDRRTHPzmfbdL0yumHzT5DfbqzzMk/eylr7V5GUm9821ek6yr7EHPmICMWQfdpX/w/6+m8lrTS4DkUCy9PX5EwYYSRyTLyQApwwOCAQBThDGZVDEnO7lvve6+HsrfH8TiFafF9sfF8FIBsmmNQGS1ZzC0XqhCaT5jZzi2Pc5ktVi4t5W9i8F9UWR/yMAwdxmgt7CE+80uQw2HwRErth++A6bfveccsxJlkr+PD1UqtAvsvKfnV74gEuitCJZAYxBWFpdyIiCJ8YCz++y4JTTv6Xv0akPmnzYxK/YwBJHBgWvdQS3tuWcnhM5XJaVrF+9/tIG4n6FcydFsjht95z0ifn7bJMnmzzN5DEmpavkc9KHvdtCBOD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RErlze5LO+NU8v1TWO4il9Xldy0WCZHCYf3x0CUDpu1ROdwZfO/0DevC6DvN2qR2lJOvnI7jcacK2RQvJzk8slDoVe9q72vFrLe8v1/A/C6h5AaH6yI6PsKSSUv3Cgjn+CJOWhZbv30iS9dubvDObrV9zvZqMeY1n570VJvnPTDiI/ECT35pw1KNnuA2ixaPV8ZFSxarZo/CT2tffQrLzYy+loa55+PIuaxA/S8cVe+D8RROdlSzFYl5ODsBoctV7lbFLkoQ/BoTR5Aeje4STarHQr89A7j0Jlna0kmwuqVCRDlYZZH+3JKQxNvwKkTLIS3Es1WdfXw3J8tzcUd3yTr1/Hrkrndt727tS/HuVQ1d1bzHXKxJt4sM1i7eYeKfXY5i6ZMKfd2dOg3HrQkv91DWNPX/CkDr5DWJvl3gfCzocb37rOGlra0h2y0D5zLQs4295QeIZDAGGEK+q1BjUkmynpiarwVhAJlw5lvvssVfGZOHHHGrDi7m2H+l79Ph2kxaCOlJ/c22VweFGKUU41p5pIbxcW0Z/D9mX2odT2LvR/Y/6GxEYTbJ7JyQ1wnHyx3UMofQS9pjUJx+yaMAFRgBngtCzLr3IdTXsXQ6hPt+f+jKKql6MJFm/j1uzx1jVgQtUWKG4KxUrppjUF0gBoitnhQBbBOxf32hSsqUV9m6/4QuSnbD2CSyliQP7DdN5vQmCvc3kVpPSPVSfWBBOzHmNZ7Tm2AjoN3hT2e1LPQt7d+wxH9b6kStZn/Xa69cVhgFxwIr90Z09r5Q8IFTR5EBgOAJh74ZDfMwXjCBZJUVwC4s+ZKGR9VpzAP6YiI5vNWEpcCSD2H/I8IN4e2Xoje9JvCEQOD4CYe+OP4ZDezCCZIc2OCoPBAKBQCAQCASOgkCQ7FFGKtoZCAQCgUAgcDgEgmQPN2TR4EAgEAgEAoGjIPBvUGKfY9MvwZsAAAAASUVORK5CYII=\" width=\"236.5\" height=\"19\" style=\"width: 236.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; perspective-origin: 85.5667px 8px; transform-origin: 85.5667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is that above the sole and unique triplet \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: 24.1083px 8px; transform-origin: 24.1083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e(3, 5, 7)\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: 45.8917px 8px; transform-origin: 45.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e -with a gap of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAAC70lEQVRoQ+1YPUgeQRDVXgmaSttYKKSwiQohbQRBLAIaxMIuSZFSiBYhpDCQlCmSCHYi0c4mEBELRclPk0JIiliYQisDwfTJe7ID67l7397Owbef7MHj7vtuZ2727dvZ2W1vy5eKgXaVdTZuywQqRZAJzAQqGVCaZwVmApUMKM1jFXiM774GXii/n4p5NwJ5AowD/SaoE9x3gUfAb1+gMQTehbOPwF+gMxUGFHHcgu0G0OPxwX4OAoeu9zEEfoKjYePsPu5riuBTMP2OIK4BK8CWCege7tNAh/ntFUtVAm/A4U+r1z/wPJACC5ExzMPuMTABfC344LQ+sJTJqfy2+J2qBFJtY8aJjE4rq5C5/LmLGNPHh7i/Mc/ruE9pCOSInAJLwB9gzjj7jPtIpAKaacbZxEWityQI6TObbAKjGgJfwpgyZkLlZU/lIfwuToFmklPnt/8ZZxTOg1gCORJHwL41CpzOk8ahc3Tq7EWTfNkKdKaq0BzIXPAK4OpEsnhx+f9idawPz86lPrDzVLikhUATZ7M6ZwNz3nuANaFzqocSyGTLvFdcce2SxinxCkykSKDMMu9CGUKgjILLibwTnq7jwVu1VyAzhaZSspWmpxACqTIWmr56j+qUKl6rwhSIkxjYb14s26K3cpLnFuDEt++1a6Wrsr1jOpkBXAX2hUFupEDmgDvAzQZT8wzvpbAuIzslhflioSCehpBHB2UESg4ImZb2AhCrwhQWkUrkNSLwHRpwQ+09ibCG0K6X+HfM9q7ZBIaQx35eyIc+BUrhvAqDS9W3R/t2Yd1qhwxypDWLvkmdW+wmOdkDbtsk+gjkKcUiwALyV2Di4koth5GxKgz8VK3NSN428AFY9njuwv/PgJ2ioHwE2qVJbLStcMgg5MkCWNZX5nZ7J3be1kWgXZbEkid2dW6rtLEU7blIfgNCyKOtMy01KmPqDvrK+csEKoc0E5gJVDKgNM8KzAQqGVCaZwVmApUMKM2zApUE/gdVDoAl3uI4wAAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; 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; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e then-\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 134.208px 8px; transform-origin: 134.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eall the following progressions are such that \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAAAmCAYAAACWNESlAAAHmklEQVR4Xu2bS8huUxjHvzMnYURiwIBcyzUinVxKZCD3klJuJQM55QzOwIATAwMDl9A3cC8DE4UyIHIbGBADBiRGbjHn+bH/er71rbX2Wnvv97Lfs3Y9fV/vu9+1ntv/ua2992y1q2mgaWBrT9NB00DTwFYDQnOCpgE00DJC84OmgQaE5gNNA/9poGWE5glNAw0IzQeaBlpGaD7QNPC/BoaURjfar58wOvYQ0uNRJuvlRmcbXWL0vtE+o7uNnoroYYhex6rzxI7Hd+3vd2MXO9R+P8RgH5uSzje6x+jpDVfYFSbfA0b8/cvoZaPHAkeLgWGIXoeoEl4AJvbQddIMgYAcDzoZ0PUJRr8WKAXbvG10ntFnkfsJYncZPZpbq9ZgRJ1vuwW/sb+nFDA6x1tQ3isdAOAfWa9OOJgM4eWs1etYHf1kCxzT8XlRoQON3XPK3wMEAut1RkcaPWf0ldEFBZv0AUEgu8nWei21Xq3BWOgGt9iV9v87BczO6RZA8KHRyR3TyHdzxrnWAQh/d7y+bn8pXed2yVnlj8jwqtHjRpSguSsGBD67zOig0TlGZAwyJba93ugZox3lYw0QWOR7o8McV5/Y/yWonYthQhD8bIyflgEBcq0aCOcaD592Cs5GvTU2goDggaygmyp5JE4MCFpP9iOw3W/0Rue/u/RUA4SHbJFHIsqcY02a8gn1P/q+JOOtGgjeLkf3gHYIFiiHicpnGvleJLdWn/OGv/U9gnpPBaXj7ObDM5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4ZgWvs0MKPelOHWEXOVXFTHxCUBTgUU78l/RJ0OPQbpdsUEKTovugeO4hC/qEHbKsAAvyGPUDoTGFGYCYvJ8lNjcKSquTZpRL/8QEIB6An0HNgHqQla4X3+JJ3lHNVbN4HBJaSnn2Q8/odxWsKCNSfpPbYSyehfNfYB74e5vuhteoqpkbwG2a2MKOEh4h+Jp0DAgElPIlPnQDTGPIIcsnBl6K2B5bn0fOHbLXvjajsWlbPVwIE7KSApADtA/HkQEhF+QqA/3vr0KxQu89U9/voEpZ3ue/6DtRiQ4XwcMdnnJLDST1W4QOOL5c0yoa3h42uMqo5VPMyLQMMpUDA1tiCh+j04o70OzkQUq8f1jpcTZ1eu/Yi7g9fxpFifQ8BQEKniukrDAJh6RU6e1hC5Z4b8geAYUPrAQWvxxvx9OWQZ5q8XPAbniVNaYMaIChQ/2gM8Gg1r8/SH00OhNQ0olbwkshWu+Yy7ica3mF0hhGHOUcY0aS9YBSe1OIsAD58CNE7Tmz0ihz+AFIPNWod34OEMvsmPJZ1/Vj1dvtxSamV0mtKvj471DplDRDYO5aFa/fcIUPfOUKfwO376TUAcN40yr5jO/22yRX1zi+ZZVHvIyxRnPhWDQgrN8EOBjQmvNg+HXM6vF5SzYCbBoT1MZIelts2lmqnPOsjxUw5aUBYD8OpUY/1IevB4YZz0YCw4QZu4pVpoAGhTE/trg3XQAPChhu4iVemgQaEMj21uzZcAw0IG27gJl6ZBv4BNebfNgluZhwAAAAASUVORK5CYII=\" width=\"97\" height=\"19\" style=\"width: 97px; height: 19px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.0083px 8px; transform-origin: 63.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 61.4583px 8px; transform-origin: 61.4583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given interval \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: 75.825px 8px; transform-origin: 75.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2], i1 \u0026gt; 7 and i2 \u0026gt; 7\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: 15.1667px 8px; transform-origin: 15.1667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e find \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: 4.275px 8px; transform-origin: 4.275px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep\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: 217.05px 8px; transform-origin: 217.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAAlCAYAAACeVr0yAAAE00lEQVR4Xu1aS6iOQRg+ZyGRIkqRWJCIErnGyrXEgoXbhij3WFGIrCgUolxWLhvsJAsWdsplIxsUCyWXBZLLEs9zfHPOfO+Z+ead75/z/8c589XTf5t555v3mff6f+1t+eoTGmjvE7vIm2jLRPaRQ5CJbD6R47HkZmAosDvV8pnIVJrUy7mJoauB38BA/bTqkZnIVJrUy/mJoYOBq8Am/bQ4Imdh+ANgiJi2DJ/vp1q0l8u5hPsbBqztgfukzOvAAGA28DRiDbrkJcB0YBpwGqB1d1wui+SE1/2UyOHY99viIE/A65sIRWuG3sOgxcD34rBo5mzHoL3AJOADcA7gYftiT/a51j/9lEgq7UKx98t43abRtHIMD8lngLo9D+wJzKN3vFYQyKG3gB2SQCMjE1nW5nt8HFV89QOv43yKU5JnD+MhOQMwwQlZuwxxJzFnf9Wamcgu7SzFW7o++woqMIJQxsMZAN3jmIp5kkTmJsxRKq9MZJd6SCLJtC8qfXRIiYrfTd7BkmMXcNEzx47RHKL2CpnIfxo1iiZxxrUaXTMu+RSv4LBjyAHgMDAIGAGUEhVLyCO8n2N9VsfpOkRysSmAXaK8xOezCTasVUzqccwCmdIfAaR7TWGVn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003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 31.0667px 8px; transform-origin: 31.0667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e                \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 48.4167px 8px; transform-origin: 48.4167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [8, 68]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 48.0333px 8px; transform-origin: 48.0333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [47, 53, 59]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 28.2px 8px; transform-origin: 28.2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [1, 1]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 158.692px 8px; transform-origin: 158.692px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, since this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e8\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 29.95px 8px; transform-origin: 29.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\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sIzbjYrGjr+ZGzNAnjs0wahfyph64jDjcySEZ/QuvsQCe0idQqZOa62ly1+bowKfAgtWWddNUNnpBRqBtCXo1kbkN5glmUnaiMyhzgbu2Nb6JfbQ4sKZvixA1/IBUhIzKxNomXlJYotidSn6piowIfQ9MK8crTVm/UEqV56ItdcE9qVAySVkSZSoZq5xovQpqeWqWPJzP5aVleYpWvUY9o1EVriZNcEKcdym+vtS2gpV8aEHW3qZ5JEZGla8xCZzRM6JH8x5/EltNPBNCnH43Y50HTZ8B1t5KIlJYkJMWaOthJDN1VppF1oHJ1DxpQxxtND65hZZIxJnqWvdjAuDjkdkYvQknX6hBHacLGL3kZSKOFSk8xC6JCr/qEmhSSgmQBuwd/uAL516rpNqqscLgej7TqGmy5CM1bZDPjcDOljmcLGXIe3QWgdj9kSWq2bK1kxF2mohLZVM3zr1K4Thy9WcVO4HIcOOcYk6TZCy0XKVQzuW4rT1YAQT5ZypKb21V7BdsxpYvJSKegqNlXAxP65Q46m0lwqqXU+ZovHRafam10boeUKkuWsT55GZSWEu0ueGC/tOVXWZvo9hbr/5pCN2hRnZxUq02B1hI4trTaRWUROITX7vgF4W2izt4SJtQ7IRmhdiou1bdRdfOxkCf30Apgni3iMlHJUgmhJXTU59EAxSbsvmXOQWs9lxsjiXKx5XR2htdtPsig6p5RxUucO7U+9RwG+x0ECy3MZH/p0mcJ7Az7yPkqdHbhxefO7D/B5qUxuhEM2tnYUoacb+/4D8D2O2QBfSeBDmU8B1rCvqWwXSorSfpgWIMH4CkDof/HE9ou2YiF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2wC+pZlg0tqGokQAAAABJRU5ErkJggg==\" width=\"90\" height=\"18\" style=\"width: 90px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 19.8333px 8px; transform-origin: 19.8333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [180, 228]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 59.1917px 8px; transform-origin: 59.1917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [199, 211, 223]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 32.0833px 8px; transform-origin: 32.0833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [2, 2], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e180\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAAkCAYAAAA0Po6QAAAGMUlEQVR4Xu1bTchWRRTOfRHlKhFa1KJA0E0lRDtJECIoSCmJwLAfiDYa1SJCosJw5UIT3UlWO0GCQlokRtqmUrGFLnSRq0SxfT5PzYHj/ebnzNzr+957ORcO78f3zp0558x55vzNu+oef1wDroH/NLDK9eAacA38rwEHg1uCayBowMHgpuAacDC4DbgG7tSAewa3CNeAewa3gYwGHsF374HWg54C/Qn6A3QE9MNENUeZSJsC/5/j87qWpdUz/IVJ9oM+m6hicmw/iC/fB20HrTHIJ+Ofw9jHwvhr+DwFequrcMN8yx7yJhj4AnRvghF+R6BM4eHevAF6FXR/2JMkoFvA8Cwm/R70D+i+KWjEyKMYNQ2YhmCR7wmMOw56KLEG59gAumzkYdnDZG9LfGzGgLF7iK3g8XDYy2/x+WFpH1rA8Asmpevksw30TUlzE/ieinsBdAO0M/BrAcNFjOWJcxR0Mrz3Ij5fDpvAf1nmGYuK6PF5wH0Fugl6GLRFySJ8nsEfG8fCdISPL8M+UvcHQCZPVgsGxlyX1OKMJR8fsVKsrFEuOb0F7CUj/gDvvAN6HvRrZyF6mfMg8Rj0NgetzCxpHMOjd0FPg3QsTe/3YwQQtbazKLEECFyvKqSrFYhegCcFH4kp5+IdZLOsYOApuidj5DQunkp86Kbpfcb80Msxtu4CmzxrWUQGq+3wYDgGehtUEy4ShJ+AGJJZH+r46zCYYVzNu1UdaAr1N+gQiC50d1h07C7TqkgZZwEDPQkT5FyCLfrivNUbU8v0AONpfDEgcGotSy0YmF8yF6nJn7Q3sh4k5PEKSPI9hqtVeY0V3VTAXhDdPRNCPjpcejKjyAH2aaFTWMBgZejfMJAHCKsaU35EFspQEx7TSE+DWGmzAEIDgQctI5E7SqAJJTJs/TR813RAW8EgqPsZi4nrYcj0Ul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7Pq/MW5acDBMLcddXmaNeBgaFadvzg3DTgY5rajLk+zBhwMzarzF+emAQfD3HbU5WnWgIOhWXX+4tw04GCY2466PM0auA1Dgoc0VXEbjwAAAABJRU5ErkJggg==\" width=\"97.5\" height=\"18\" style=\"width: 97.5px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [240, 272]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 75.2667px 8px; transform-origin: 75.2667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [251, 257, 263, 269]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 39.8583px 8px; transform-origin: 39.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [1, 1, 1], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e140\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 29.95px 8px; transform-origin: 29.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAkCAYAAAAgqxBxAAAFm0lEQVR4Xu1bS6iPWxR35iSMSN0BA8rglme3GIlSBlII6RR5le6ILgMjITIy8AjJwPUYSJmgDIg8JoQYuAMGjNwSc36/+lYt+3x7f/t1zvdof/Xr/M/578daa//22mut/Z2RSeUpFhiQBUYGpEtRpVhgUiF0IcGgLFAIPajlLMoUQhcODMoChdCDWs6iTCG0mwPT8fUiYCEwDbgJvOghbeZA5l3AHmBKD+UXkakHsbL6w3H8/F/rE0vozxjkNHCsx8Zxib4bX64D/gKeAJeA+6bxeqD7Ksi4HdigZI1d87bUpVPhZtwGTAUeAReBe3UCxShHI90FfvR8t9fZYzH+eAWYBzwDDtsM19bqes7LDfl3pYfZJWbNPafN3mwjRrwATAZuAIeA/1yzxCj3FAMurQbdhJ/Xs6vRzoAkwUllPB7Pvx1n7YgVPOs79HgIPFBk0IPErHmwEBk6nMMYOwE6zjPAAZ8xQ5Vj/PJBDfwen+f7TNTxNvQE1yoZ6ZmXdVxeX/FOoOF+o3HomvvOlbOdkJlj0sl4kZmNQ5WjN15TSc5jgE/fvTQ36UuA+nwBFgB99Mx1hMpFaMax/wJ7AeeRbwjBEO4IsDqA7dq5ME4O6RtEaCr1FTgPfANk5/fdo+kQijHakBLdXIRmzsTcicf/n56kJpkZ9kj8S6I2PeTYx6oP51oP1CZ/toFCP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8B1rCvqWwXSorSfpgWIMH4CkDof/HE9ou2YiF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2wC+pZlg0tqGokQAAAABJRU5ErkJggg==\" width=\"90\" height=\"18\" style=\"width: 90px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 19.8333px 8px; transform-origin: 19.8333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [180, 272]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 59.1917px 8px; transform-origin: 59.1917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [199, 211, 223]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 32.0833px 8px; transform-origin: 32.0833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [2, 2], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e180\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAAkCAYAAAA0Po6QAAAGMUlEQVR4Xu1bTchWRRTOfRHlKhFa1KJA0E0lRDtJECIoSCmJwLAfiDYa1SJCosJw5UIT3UlWO0GCQlokRtqmUrGFLnSRq0SxfT5PzYHj/ebnzNzr+957ORcO78f3zp0558x55vzNu+oef1wDroH/NLDK9eAacA38rwEHg1uCayBowMHgpuAacDC4DbgG7tSAewa3CNeAewa3gYwGHsF374HWg54C/Qn6A3QE9MNENUeZSJsC/5/j87qWpdUz/IVJ9oM+m6hicmw/iC/fB20HrTHIJ+Ofw9jHwvhr+DwFequrcMN8yx7yJhj4AnRvghF+R6BM4eHevAF6FXR/2JMkoFvA8Cwm/R70D+i+KWjEyKMYNQ2YhmCR7wmMOw56KLEG59gAumzkYdnDZG9LfGzGgLF7iK3g8XDYy2/x+WFpH1rA8Asmpevksw30TUlzE/ieinsBdAO0M/BrAcNFjOWJcxR0Mrz3Ij5fDpvAf1nmGYuK6PF5wH0Fugl6GLRFySJ8nsEfG8fCdISPL8M+UvcHQCZPVgsGxlyX1OKMJR8fsVKsrFEuOb0F7CUj/gDvvAN6HvRrZyF6mfMg8Rj0NgetzCxpHMOjd0FPg3QsTe/3YwQQtbazKLEECFyvKqSrFYhegCcFH4kp5+IdZLOsYOApuidj5DQ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d+CIPxqJPQ/gnx+Dfqo4WO6qgInJa4DAKWpuhJaAICz1AYSufKWAKpXPaF6R8gy6XNq6MU33Q1oXG+g9fdmLU+b6JqmrzTFWUo2ggdgeZBrt2S0TWptvViAMAQi9VjcnEPmSOXAMDLHruhblxMb0KZe1rtnyHmP0HaDuD1loxAwVeZ9f/4hJ4urUTyO7PIw9bNSX3Kz6szZYxdPW9BG0h6gNx/TPcNdCmAtBIN6g2AdK3mQtlVativFxroGUBmic/F1H7e/BW99r3gkHQ7Pq/MW5acDBMLcddXmaNeBgaFadvzg3DTgY5rajLk+zBhwMzarzF+emAQfD3HbU5WnWgIOhWXX+4tw04GCY2466PM0auA1Dgoc0VXEbjwAAAABJRU5ErkJggg==\" width=\"97.5\" height=\"18\" style=\"width: 97.5px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 10.3667px 8px; transform-origin: 10.3667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTip\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 358.192px 8px; transform-origin: 358.192px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for \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: 122.325px 8px; transform-origin: 122.325px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eu = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 67.6417px 8px; transform-origin: 67.6417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eForbidden functions\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.4px 8px; transform-origin: 21.4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eregexp\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.2833px 8px; transform-origin: 25.2833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003estr2num\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.6833px 8px; transform-origin: 25.6833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eassignin\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.175px 8px; transform-origin: 15.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eecho\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95630\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties I\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [p, k] = check_the_6k_delta_theorem(i1, i2)\r\n  \r\n    u = i1;\r\n    k = i2;\r\n\r\nend","test_suite":"%%\r\ni1 = 8;\r\ni2 = 68;\r\np_correct = [47, 53, 59];\r\nk_correct = [1, 1];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 180;\r\ni2 = 228;\r\np_correct = [199, 211, 223];\r\nk_correct = [2, 2];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 240;\r\ni2 = 272;\r\np_correct = [251, 257, 263, 269];\r\nk_correct = [1, 1, 1];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 180;\r\ni2 = 272;\r\np_correct = [199, 211, 223];\r\nk_correct = [2, 2];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%% Test forbidden functions\r\nfiletext = fileread('check_the_6k_delta_theorem.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T07:04:42.000Z","deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2025-07-11T05:36:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-07-05T06:40:29.000Z","updated_at":"2026-03-06T14:30:46.000Z","published_at":"2025-07-10T12:03:38.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eContext\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\u003eIn the prime numbers set there are some arithmetic progressions (sequences of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethree or more consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e(p, p’, p’’)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e equally spaced one to the others by an even 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\u003e\\\\mathbf{\\\\Delta = p' - p = p'' - p'}\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\u003eOne theorem, which can actually easily be proven from \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\\\\forall p \\\\in \\\\mathbb{P}, p\u0026gt; 3 \\\\Rightarrow \\\\exists n \\\\in \\\\mathbb{N}^*, p = 6n \\\\pm 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, is that above the sole and unique triplet \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e(3, 5, 7)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -with a gap of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\Delta = 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e then-\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\u003eall the following progressions are such that \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mathbf{\\\\Delta = 6k}, k \\\\in \\\\mathbb{N}^*\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\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\u003eProblem statement\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\u003eFor a given interval \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2], i1 \u0026gt; 7 and i2 \u0026gt; 7\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e find \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio \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\\\\mathbf{k = \\\\Delta / 6}\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [8, 68]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [47, 53, 59]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [1, 1]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, since this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e8\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 6 = \\\\mathbf{1} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here; \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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [180, 228]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [199, 211, 223]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [2, 2], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e180\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 12 = \\\\mathbf{2} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here;\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [240, 272]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [251, 257, 263, 269]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [1, 1, 1], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e140\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 6 = \\\\mathbf{1} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here; \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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [180, 272]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [199, 211, 223]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [2, 2], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e180\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 12 = \\\\mathbf{2} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here;\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTip\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\u003eFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eu = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\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\u003eForbidden functions\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\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexp\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estr2num\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassignin\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:i/\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eecho\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\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95630\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties I\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":193,"title":"Smallest distance between a point and a rectangle","description":"Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another point *z* and every point within this rectangle.\r\n\r\nFor example, the two points\r\n\r\n     x = [-1,-1];\r\n     y = [1,1];\r\n\r\ndefine a square centered at the origin. The distance between the point\r\n\r\n   z = [4,5];\r\n\r\nand this square is\r\n\r\n   d = 5;\r\n\r\n(the closest point in the square is at [1,1])\r\n\r\nThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,1])\r\n\r\nThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\r\n\r\n\r\nNotes: \r\n\r\n* you can always assume that *x* \u003c *y* (element-wise) \r\n* The function should work for points x,y,z in an arbitrary n-dimensional space (with n\u003e1)\r\n\r\n\r\n\r\n ","description_html":"\u003cp\u003eGiven two points \u003cb\u003ex\u003c/b\u003e and \u003cb\u003ey\u003c/b\u003e placed at opposite corners of a rectangle, find the minimal euclidean distance between another point \u003cb\u003ez\u003c/b\u003e and every point within this rectangle.\u003c/p\u003e\u003cp\u003eFor example, the two points\u003c/p\u003e\u003cpre\u003e     x = [-1,-1];\r\n     y = [1,1];\u003c/pre\u003e\u003cp\u003edefine a square centered at the origin. The distance between the point\u003c/p\u003e\u003cpre\u003e   z = [4,5];\u003c/pre\u003e\u003cp\u003eand this square is\u003c/p\u003e\u003cpre\u003e   d = 5;\u003c/pre\u003e\u003cp\u003e(the closest point in the square is at [1,1])\u003c/p\u003e\u003cp\u003eThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,1])\u003c/p\u003e\u003cp\u003eThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\u003c/p\u003e\u003cp\u003eNotes:\u003c/p\u003e\u003cul\u003e\u003cli\u003eyou can always assume that \u003cb\u003ex\u003c/b\u003e \u0026lt; \u003cb\u003ey\u003c/b\u003e (element-wise)\u003c/li\u003e\u003cli\u003eThe function should work for points x,y,z in an arbitrary n-dimensional space (with n\u003e1)\u003c/li\u003e\u003c/ul\u003e","function_template":"function d = distanceRectangle2Point(x,y,z)\r\n  d = 0;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp','regexpi','regexprep','str2num'},'FileName','distanceRectangle2Point.m')\r\n%%\r\nx = [-1,-1];\r\ny = [1,1];\r\nz = [4,5];\r\nassert(isequal(distanceRectangle2Point(x,y,z),5))\r\nd_correct = 5;\r\n%%\r\nx = [-2,-1];\r\ny = [3,1];\r\nz = [1,2];\r\nassert(isequal(distanceRectangle2Point(x,y,z),1))\r\nd_correct = 1;\r\n%%\r\nx = [1,2];\r\ny = [3,4];\r\nz = [-5,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),6))\r\nd_correct = 6;\r\n%%\r\nx = [2,2];\r\ny = [4,4];\r\nz = [3,4];\r\nassert(isequal(distanceRectangle2Point(x,y,z),0))\r\nd_correct = 0;\r\n%%\r\nx = [-1,0,1];\r\ny = [0,2,4];\r\nz = [4,5,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),5))\r\nd_correct = 5;\r\n%%\r\nx = [1,0,1];\r\ny = [2,3,2];\r\nz = [-1,-2,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),3))\r\nd_correct = 3;\r\n\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":3,"created_by":43,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":280,"test_suite_updated_at":"2017-12-04T00:12:33.000Z","rescore_all_solutions":true,"group_id":17,"created_at":"2012-01-31T06:07:25.000Z","updated_at":"2026-03-31T15:32:49.000Z","published_at":"2012-01-31T08:50:23.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e placed at opposite corners of a rectangle, find the minimal euclidean distance between another point\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and every point within this rectangle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, the two points\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[     x = [-1,-1];\\n     y = [1,1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003edefine a square centered at the origin. The distance between the point\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[   z = [4,5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand this square is\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[   d = 5;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(the closest point in the square is at [1,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotes:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eyou can always assume that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (element-wise)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe function should work for points x,y,z in an arbitrary n-dimensional space (with n\u0026gt;1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":29,"title":"Nearest Numbers","description":"Given a row vector of numbers, find the indices of the two nearest numbers.\n\nExamples:\n\n [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\n\n index1 =\n      1\n index2 =\n      3\n\n [index1 index2] = nearestNumbers([-40 14 22 17])\n\n index1 =\n      2\n index2 =\n      4\n\nNotes\n\n# The indices should be returned in order such that index2 \u003e index1.\n# There will always be a unique solution.\n","description_html":"\u003cp\u003eGiven a row vector of numbers, find the indices of the two nearest numbers.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\u003c/pre\u003e\u003cpre\u003e index1 =\n      1\n index2 =\n      3\u003c/pre\u003e\u003cpre\u003e [index1 index2] = nearestNumbers([-40 14 22 17])\u003c/pre\u003e\u003cpre\u003e index1 =\n      2\n index2 =\n      4\u003c/pre\u003e\u003cp\u003eNotes\u003c/p\u003e\u003col\u003e\u003cli\u003eThe indices should be returned in order such that index2 \u003e index1.\u003c/li\u003e\u003cli\u003eThere will always be a unique solution.\u003c/li\u003e\u003c/ol\u003e","function_template":"function [index1 index2] = nearestNumbers(A)\nindex1 = 1;\nindex2 = 2;\nend","test_suite":"%%\nA = [30 46 16 -46 35 44 18 26 25 -10];\ncorrect = [8 9];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [1555 -3288 2061 -4681 -2230 -4538 -4028 3235 1949 -1829];\ncorrect = [3 9];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [-1 1 10 -10];\ncorrect = [1 2];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [0 1000 -2000 1001 0];\ncorrect = [1 5];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [1:1000 0.5];\ncorrect = [1 1001];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\n% Area codes\nA = [847 217 508 312 212];\ncorrect = [2 5];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\n% Zip codes\nA = [60048 61802 01702 60601 10001];\ncorrect = [1 4];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))","published":true,"deleted":false,"likes_count":46,"comments_count":5,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5049,"test_suite_updated_at":"2012-01-18T01:00:21.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:21.000Z","updated_at":"2026-04-03T07:32:16.000Z","published_at":"2012-01-18T01:00:21.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a row vector of numbers, find the indices of the two nearest numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\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[ [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\\n\\n index1 =\\n      1\\n index2 =\\n      3\\n\\n [index1 index2] = nearestNumbers([-40 14 22 17])\\n\\n index1 =\\n      2\\n index2 =\\n      4]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe indices should be returned in order such that index2 \u0026gt; index1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere will always be a unique solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1452,"title":"Minimum Distance between two N-sided Polygons","description":"This Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\r\n\r\n*Input:* polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\r\n\r\n*Output:* 0.5  \r\n\r\n\r\nRelated Challenges:\r\n\r\n1) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment Minimum Distance Point to Segment\u003e\r\n\r\n2) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice USC Spring 2013 ACM Walking on Thin Ice\u003e","description_html":"\u003cp\u003eThis Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e 0.5\u003c/p\u003e\u003cp\u003eRelated Challenges:\u003c/p\u003e\u003cp\u003e1) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment\"\u003eMinimum Distance Point to Segment\u003c/a\u003e\u003c/p\u003e\u003cp\u003e2) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\"\u003eUSC Spring 2013 ACM Walking on Thin Ice\u003c/a\u003e\u003c/p\u003e","function_template":"function pdistmin=PolytoPol(polycell)\r\n% Convert [x0 y0 x1 y1 ... xn yn] to nx2 array\r\n% Length of polycell{1} may vary from polycell{2}\r\n p1=reshape(polycell{1},2,[])';\r\n p2=reshape(polycell{2},2,[])';\r\n \r\n pdistmin=0;\r\nend","test_suite":"polycell={[0 0 5 10 10 0] [5 -1 6 -5 5 -5]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-1)\u003c.01);\r\n%%\r\npolycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-0.5)\u003c.01);\r\n%%\r\npolycell={[0 10 0 90 50 50 100 90 100 10] [0 110 100 110 50 70]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-15.617376)\u003c.01);\r\n%%\r\npolycell={[0 110 100 110 50 70] [20 5 50 7 30 5]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-63)\u003c.01);\r\n%%\r\npolycell={[-5 -5 -4 -4 -3 -3 -2 -2 5 5 5 0] [6 10 6 -10 20 0]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-1)\u003c.01);\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-24T01:39:41.000Z","updated_at":"2026-02-16T10:57:04.000Z","published_at":"2013-04-24T02:03:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 0.5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRelated Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMinimum Distance Point to Segment\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC Spring 2013 ACM Walking on Thin Ice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2242,"title":"Wayfinding 5 - Travel contour","description":"This is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See \r\n\u003chttp://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding search:tag=wayfinding\u003e for the other assignments.\r\n\r\nThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a |2xn| array |F|. The last node of |F| is connected to the first node.\r\n\r\n|a| is the index in |F| of the starting node, and |b| is the goal. \r\n\r\n\u003c\u003chttp://i61.tinypic.com/iq8p69.png\u003e\u003e\r\n\r\nCalculate the shortest distance from |a| to |b| over the contour of the polygon. \r\n\r\nThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.","description_html":"\u003cp\u003eThis is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See  \u003ca href = \"http://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding\"\u003esearch:tag=wayfinding\u003c/a\u003e for the other assignments.\u003c/p\u003e\u003cp\u003eThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a \u003ctt\u003e2xn\u003c/tt\u003e array \u003ctt\u003eF\u003c/tt\u003e. The last node of \u003ctt\u003eF\u003c/tt\u003e is connected to the first node.\u003c/p\u003e\u003cp\u003e\u003ctt\u003ea\u003c/tt\u003e is the index in \u003ctt\u003eF\u003c/tt\u003e of the starting node, and \u003ctt\u003eb\u003c/tt\u003e is the goal.\u003c/p\u003e\u003cimg src = \"http://i61.tinypic.com/iq8p69.png\"\u003e\u003cp\u003eCalculate the shortest distance from \u003ctt\u003ea\u003c/tt\u003e to \u003ctt\u003eb\u003c/tt\u003e over the contour of the polygon.\u003c/p\u003e\u003cp\u003eThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.\u003c/p\u003e","function_template":"function d = polygon_distance(F,a,b)\r\n  d = 0;\r\nend","test_suite":"%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 1;\r\nb = 3;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 2;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 1;\r\nb = 2;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 1;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 4;\r\nb = 1;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 1;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 3;\r\nb = 3;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 0;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [zeros(1,101) ones(1,101);0:100 100:-1:0];\r\na = 1;\r\nfor b = randi(size(F,2)/2,1,100)\r\n  d = polygon_distance(F,a,b);\r\n  d_correct = b-1;\r\n  assert(isequal(d,d_correct));\r\nend\r\n\r\n%%\r\nF = [zeros(1,101) ones(1,101);0:100 100:-1:0];\r\na = 1;\r\nfor b = randi(size(F,2)/2,1,100)+size(F,2)/2\r\n  s = rand(1)+1;\r\n  d = polygon_distance(F*s,a,b);\r\n  d_correct = (size(F,2)-b+1)*s;\r\n  assert(abs(d-d_correct)\u003c1e-10);\r\nend\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":6556,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2014-03-10T14:22:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-03-10T09:32:11.000Z","updated_at":"2014-03-10T14:22:52.000Z","published_at":"2014-03-10T13:43:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esearch:tag=wayfinding\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for the other assignments.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2xn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e array\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The last node of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is connected to the first node.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the index in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of the starting node, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the goal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the shortest distance from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e over the contour of the polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEsASwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgc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"id":45536,"title":"Distance Between Points","description":"Being n the number of points (If n = 3 there would be 3 points: A, B and C).\r\nThe distance between each pair of points increases progressively twice, starting with points A and B. \r\n\r\n\u003c\u003chttp://imgfz.com/i/XUJEt6w.png\u003e\u003e\r\n\r\nGiven *n* as an integer greater than 1 and *x* as the distance between the last pair of points (D and E in figure).\r\n\r\nFind the distance between the first and last points *y*.\r\n","description_html":"\u003cp\u003eBeing n the number of points (If n = 3 there would be 3 points: A, B and C).\r\nThe distance between each pair of points increases progressively twice, starting with points A and B.\u003c/p\u003e\u003cimg src = \"http://imgfz.com/i/XUJEt6w.png\"\u003e\u003cp\u003eGiven \u003cb\u003en\u003c/b\u003e as an integer greater than 1 and \u003cb\u003ex\u003c/b\u003e as the distance between the last pair of points (D and E in figure).\u003c/p\u003e\u003cp\u003eFind the distance between the first and last points \u003cb\u003ey\u003c/b\u003e.\u003c/p\u003e","function_template":"function y = distance(n,x)\r\n      y = x*n;\r\nend","test_suite":"%%\r\nn = 5;\r\nx = 80;\r\ny = 150;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 2;\r\nx = 64;\r\ny = 64;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 8;\r\nx = 1600;\r\ny = 3175;\r\nassert(isequal(distance(n,x),y))\r\n\r\n%%\r\nn = 3;\r\nx = 2500;\r\ny = 3750;\r\nassert(isequal(distance(n,x),y))\r\n\r\n\r\n%%\r\nn = 8;\r\nx = 1000000;\r\ny = 1984375;\r\nassert(isequal(distance(n,x),y))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":446926,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-05-18T00:55:44.000Z","updated_at":"2026-02-20T08:45:53.000Z","published_at":"2020-05-18T00:55:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBeing n the number of points (If n = 3 there would be 3 points: A, B and C). The distance between each pair of points increases progressively twice, starting with points A and B.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as an integer greater than 1 and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as the distance between the last pair of points (D and E in figure).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the distance between the first and last points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\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\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABIARcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACisvVNQfThGwMZD7lKvkFePvkjoq/wARxwDnPGDoR7ti7yGbHJUYBP0yf50ASUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQ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5y6jG5eVznGR0zUmmWz2lntlVkcsSym7kuMduGcA9McYAqzPbw3UDwXEKSxOMNHIoZWHuDwajtLCzsEZLO1gtlY5ZYYwgJ9SAKEBaooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k=\"}]}"},{"id":264,"title":"Find the \"ordinary\" or Euclidean distance between A and Z","description":"A, B and Z define three points in the 3D _Euclidean_ space of the form:\r\nA = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\r\n\r\nFind the *Euclidean distance* between A and Z where\r\n  \r\n  A = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\n  \r\n  \u003e\u003e euclidean(A,B,Z)\r\n  \r\n  ans = 5.830951894845301\r\n\r\nYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors\r\nfor all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are.\r\nSo 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function\r\ninput vectors.\r\n\r\nHINT: use the Pythagorean formula.","description_html":"\u003cp\u003eA, B and Z define three points in the 3D \u003ci\u003eEuclidean\u003c/i\u003e space of the form:\r\nA = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\u003c/p\u003e\u003cp\u003eFind the \u003cb\u003eEuclidean distance\u003c/b\u003e between A and Z where\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e\u003e\u003e euclidean(A,B,Z)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eans = 5.830951894845301\r\n\u003c/pre\u003e\u003cp\u003eYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors\r\nfor all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are.\r\nSo 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function\r\ninput vectors.\u003c/p\u003e\u003cp\u003eHINT: use the Pythagorean formula.\u003c/p\u003e","function_template":"function y = euclidean(A,B,Z)\r\n  y = findEuclid(A,B,Z);\r\nend","test_suite":"%%\r\nA = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [1;0;0]; B = [5;3;0]; Z=[5;3;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0,0,0]; B = [4,3,0]; Z=[4,3,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;0;0]; B = [4;3;0]; Z=[4;3;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0,3,0]; B = [4,0,0]; Z=[4,0,3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;3;0]; B = [4;0;0]; Z=[4;0;3];\r\ny_correct = 5.830951894845301;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n%%\r\nA = [0;3;0]; B = [4;0;0]; Z=[4;0;12];\r\ny_correct = 13;\r\nassert(isequal(euclidean(A,B,Z),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":177,"test_suite_updated_at":"2012-02-12T03:40:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-05T23:24:30.000Z","updated_at":"2026-02-11T14:15:21.000Z","published_at":"2012-02-12T03:52:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA, B and Z define three points in the 3D\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between A and Z where\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[A = [1,0,0]; B = [5,3,0]; Z=[5,3,3];\\n\\n\u003e\u003e euclidean(A,B,Z)\\n\\nans = 5.830951894845301]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should be able to handle 1 x 3 vectors or 3 x 1 vectors for all input parameters: A,B and Z. Z need not be 1 x 3 if A and B are. So 1x3,1x3,3x1 inputs, corresponding A, B and Z, are possible function input vectors.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHINT: use the Pythagorean formula.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":48965,"title":"Taxicab distance","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGet the taxicab distance between the vectors.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = taxiD(v1,v2)\r\n    y = x;\r\nend","test_suite":"%%\r\nv1=1:10;\r\nv2=11:20;\r\nassert(isequal(taxiD(v1,v2),100))\r\n%%\r\nv1=1:4:50;\r\nv2=25:4:75;\r\nassert(isequal(taxiD(v1,v2),312))\r\n%%\r\nv1=1:8:50;\r\nv2=25:8:75;\r\nassert(isequal(taxiD(v1,v2),168))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T15:12:15.000Z","updated_at":"2026-02-11T14:35:59.000Z","published_at":"2020-12-31T01:18:10.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\u003eGet the taxicab distance between the vectors.\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":1693,"title":"Calculate distance travelled when given radius and rotations","description":"When given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14","description_html":"\u003cp\u003eWhen given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14\u003c/p\u003e","function_template":"function y = calci_dist(r,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\nr = 1;\r\nn = 1;\r\ny_correct = 6.28;\r\nassert(isequal(calci_dist(r,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":242,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-02T09:00:14.000Z","updated_at":"2026-03-09T20:57:39.000Z","published_at":"2013-07-02T09:02:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhen given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":47139,"title":"delta x","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 20.8px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.4px; transform-origin: 407px 10.4px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ewhat is the traveld distance for a vehicle with acceleration of a, and initial speed of v, in the time interval of t.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(a,v,t)\r\n  y = x;\r\nend","test_suite":"%%\r\n\r\ny_correct = 1.5;\r\nassert(isequal(your_fcn_name(1,1,1),y_correct))\r\n\r\n%%\r\n\r\ny_correct = 0.5;\r\nassert(isequal(your_fcn_name(-1,1,1),y_correct))\r\n\r\n%%\r\n\r\ny_correct = 1.5;\r\nassert(isequal(your_fcn_name(-1,-1,1),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":430136,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-30T15:40:22.000Z","updated_at":"2026-03-31T15:21:36.000Z","published_at":"2020-10-30T15:40:22.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\u003ewhat is the traveld distance for a vehicle with acceleration of a, and initial speed of v, in the time interval of t.\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":61268,"title":"Compute the Euclidean Distance Between Two N-Dimensional Vectors","description":"Write a function that computes the Euclidean distance between two N-dimensional vectors.\r\nGiven two input vectors x and z of equal length, compute their Euclidean distance.\r\nRequirements\r\nThe two input vectors will always have the same length.\r\nThe final result must be rounded to 2 decimal places.\r\nYou are NOT allowed to use the following built-in functions:\r\nnorm\r\nvecnorm\r\nsqrt\r\ndot\r\npdist\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 351.5px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 175.75px; transform-origin: 468.5px 175.75px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 107.992px 8px; transform-origin: 107.992px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.3833px 8px; transform-origin: 63.3833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEuclidean distance\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: 114.367px 8px; transform-origin: 114.367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between two N-dimensional vectors.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.5px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.75px; text-align: left; transform-origin: 444.5px 10.75px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 74.675px 8px; transform-origin: 74.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven two input vectors \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.85px 8px; transform-origin: 3.85px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.5px; transform-origin: 3.85px 8.5px; \"\u003ex\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: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.85px 8px; transform-origin: 3.85px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.5px; transform-origin: 3.85px 8.5px; \"\u003ez\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: 156.767px 8px; transform-origin: 156.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of equal length, compute their Euclidean distance.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 46.675px 8px; transform-origin: 46.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRequirements\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 172.317px 8px; transform-origin: 172.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe two input vectors will always have the same length.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 164.15px 8px; transform-origin: 164.15px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe final result must be rounded to 2 decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 23.8667px 8px; transform-origin: 23.8667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou are\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 156.767px 8px; transform-origin: 156.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNOT allowed to use the following built-in functions:\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 8px; transform-origin: 15.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003enorm\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 26.8417px 8px; transform-origin: 26.8417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evecnorm\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 11.6667px 8px; transform-origin: 11.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esqrt\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003edot\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 14.7833px 8px; transform-origin: 14.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003epdist\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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 y = your_fcn_name(x,z)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'norm')) \u0026 (isempty(strfind(filetext, 'vecnorm'))) \u0026 (isempty(strfind(filetext, 'sqrt')))\u0026 (isempty(strfind(filetext, 'dot'))) \u0026 (isempty(strfind(filetext, 'pdist'))))\r\n%%\r\nx=[1 2 3];\r\nz=[4 3 4];\r\ny_correct = 3.32;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[1 22 32];\r\nz=[41 23 34];\r\ny_correct = 40.06;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[-1 22 -32];\r\nz=[41 23 34];\r\ny_correct = 78.24;\r\nassert(isequal(your_fcn_name(x,z),y_correct))\r\n%%\r\nx=[-100 12 133 4 66];\r\nz=[1234 -123456 0.7 12.1 -12.8];\r\ny_correct = 123475.3;\r\nassert(isequal(your_fcn_name(x,z),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-03-03T09:48:07.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-03-03T08:28:28.000Z","updated_at":"2026-04-02T01:57:28.000Z","published_at":"2026-03-03T08:28:28.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\u003eWrite a function that computes the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between two N-dimensional vectors.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two input vectors \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of equal length, compute their Euclidean distance.\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\u003eRequirements\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\u003eThe two input vectors will always have the same length.\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:t\u003eThe final result must be rounded to 2 decimal places.\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\u003eYou are\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:rPr/\u003e\u003cw:t\u003eNOT allowed to use the following built-in functions:\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\u003enorm\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\u003evecnorm\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\u003esqrt\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\u003edot\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\u003epdist\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\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":44762,"title":"Find The Difference","description":"Vector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;","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: 400; 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=\"\"\u003eVector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dif = difference(x)\r\n\r\nend","test_suite":"%%\r\nx =[ 3 2 2 3 6 9 8 4];\r\ndif_correct = 76308633;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[ 3 2 2 0 0 4];\r\ndif_correct = 429966;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[1 1 1];\r\ndif_correct = 0;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\nx =[1 2 3 3 2 1];\r\ndif_correct = 219978;\r\nassert(isequal(difference(x),dif_correct))\r\n%%\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":246131,"edited_by":26769,"edited_at":"2023-04-07T19:18:03.000Z","deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2019-04-25T19:06:31.000Z","rescore_all_solutions":false,"group_id":162,"created_at":"2018-10-31T09:59:39.000Z","updated_at":"2026-03-31T13:00:16.000Z","published_at":"2018-11-10T14:25:31.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\u003eVector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. for example: x= [1 2 3]; dif=321 -123=198;\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":60939,"title":"Frequencies of prime gaps","description":"Problem statement\r\n\r\nGiven two positive integers n and , write a function which computes the frequency of the gap   between two consecutive of the primes in the prime vector going from 2 to n.\r\n\r\nExamples\r\n\r\nFor n = 100 and = 2, your function should return f = 1/3 since one third of the prime gaps between 2 and 97 equal ;\r\nFor n = 1000 and = 6, your function should return f = 44/167;\r\n\r\n\r\nSee also\r\nProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\r\nPrime numbers properties II","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: 414.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 207.367px; transform-origin: 408px 207.367px; 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.0083px 8px; transform-origin: 63.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 85.575px 8px; transform-origin: 85.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven two positive integers \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: 5.83333px 8px; transform-origin: 5.83333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en \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: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\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: 180.475px 8px; transform-origin: 180.475px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewrite a function which computes the frequency of the gap  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 81.7833px 8px; transform-origin: 81.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between two consecutive of the primes in the prime vector going from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e2\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: 9.71667px 8px; transform-origin: 9.71667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 81.7333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 40.8667px; transform-origin: 392px 40.8667px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.4833px 8px; transform-origin: 25.4833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003en = 100 \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.925px 8px; transform-origin: 9.925px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= 2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 86.7417px 8px; transform-origin: 86.7417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, your function should return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.5833px 8px; transform-origin: 21.5833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e f = 1/3\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 133.808px 8px; transform-origin: 133.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e since one third of the prime gaps between \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e 97\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.0083px 8px; transform-origin: 21.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e equal \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 55.4333px 8px; transform-origin: 55.4333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor n = 1000 and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.925px 8px; transform-origin: 9.925px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= 6\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 86.7417px 8px; transform-origin: 86.7417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, your function should return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.8583px 8px; transform-origin: 11.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e f = \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 9.725px 8px; transform-origin: 9.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e44/\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 8px; transform-origin: 13.6167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e167;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95759\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties II\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = frequencies_of_prime_gaps(delta, n)\r\n  f = delta*n;\r\nend","test_suite":"%%\r\ndelta = 2;\r\nn = 100;\r\nf_correct = 1/3;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 2;\r\nn = 200;\r\nf_correct = 15/45;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 6;\r\nn = 1000;\r\nf_correct = 44/167;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 4;\r\nn = 200;\r\nf_correct = 13/45;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 24;\r\nn = 10000;\r\nf_correct = 15/1228;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 1;\r\nn = 100;\r\nf_correct = 1/24;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%%\r\ndelta = 3;\r\nn = 100;\r\nf_correct = 0;\r\nfrequencies_of_prime_gaps(delta,n)\r\nassert(isequal(frequencies_of_prime_gaps(delta,n),f_correct))\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('frequencies_of_prime_gaps.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T06:48:50.000Z","deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2025-07-09T05:56:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-24T10:21:21.000Z","updated_at":"2026-03-16T13:25:01.000Z","published_at":"2025-06-24T11:07:25.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement\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\u003eGiven two positive integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eand\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\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\u003e\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003ewrite a function which computes the frequency of the gap  \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e between two consecutive of the primes in the prime vector going from \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\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\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\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en = 100 \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eand \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= 2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, your function should return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e f = 1/3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e since one third of the prime gaps between \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e 97\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e equal \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\\\\Delta\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor n = 1000 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\u003e\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= 6\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, your function should return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e f = \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e44/\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e167;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\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: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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95759\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties II\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":49337,"title":"Minkowski distance","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGet the Minkowski distance between the vectors. Round the result to the 4th decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = minkowski(v1,v2,p)\r\n    y = p;\r\nend","test_suite":"%%\r\nv1=1:10;\r\nv2=11:20;\r\np=2;\r\nassert(isequal(minkowski(v1,v2,p),31.6228))\r\n%%\r\nv1=1:4:50;\r\nv2=25:4:75;\r\np=5;\r\nassert(isequal(minkowski(v1,v2,p),40.0867))\r\n%%\r\nv1=1:8:50;\r\nv2=25:8:75;\r\np=9;\r\nassert(isequal(minkowski(v1,v2,p),29.7928))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-23T11:48:54.000Z","updated_at":"2026-02-04T11:51:43.000Z","published_at":"2020-12-31T01:23:13.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\u003eGet the Minkowski distance between the vectors. Round the result to the 4th decimal.\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":59711,"title":" Calculating distance of lightning based on time delay","description":"If we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(t)\r\n  %Easier than it looks\r\nend","test_suite":"%%\r\nt = 1;\r\ny_correct = 343;\r\nassert(isequal(your_fcn_name(t),y_correct))\r\n%%\r\nt = 57;\r\ny_correct = 19551;\r\nassert(isequal(your_fcn_name(t),y_correct))\r\n%%\r\nt = randi(1000);\r\ny_correct = 343*t;\r\nassert(isequal(your_fcn_name(t),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4207616,"edited_by":4207616,"edited_at":"2024-03-23T10:18:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":"2024-03-23T10:18:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-03-23T10:15:53.000Z","updated_at":"2025-08-26T12:10:35.000Z","published_at":"2024-03-23T10:18:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) of how far the incident happened. Write a code to calculate that distance if the time delay t is known. \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":43007,"title":"Euclidean inter-point distance matrix","description":"The Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\r\n\r\nBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\r\n\r\nThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\r\n\r\nSo you can test your code, here is an example:\r\n\r\n  A = [1 1\r\n       5 2\r\n       2 2\r\n       4 5]\r\n\r\n  format short g\r\n  D = interDist(A)\r\n  D =\r\n         0       4.1231       1.4142            5\r\n    4.1231            0            3       3.1623\r\n    1.4142            3            0       3.6056\r\n         5       3.1623       3.6056            0\r\n\r\nThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\r\n\r\nAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.","description_html":"\u003cp\u003eThe Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\u003c/p\u003e\u003cp\u003eBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\u003c/p\u003e\u003cp\u003eThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\u003c/p\u003e\u003cp\u003eSo you can test your code, here is an example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 1\r\n     5 2\r\n     2 2\r\n     4 5]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eformat short g\r\nD = interDist(A)\r\nD =\r\n       0       4.1231       1.4142            5\r\n  4.1231            0            3       3.1623\r\n  1.4142            3            0       3.6056\r\n       5       3.1623       3.6056            0\r\n\u003c/pre\u003e\u003cp\u003eThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\u003c/p\u003e\u003cp\u003eAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.\u003c/p\u003e","function_template":"function D = interDist(A)\r\n  % compute the interpoint distance matrix between rows of A\r\n  D = A;\r\nend\r\n\r\n","test_suite":"%%\r\nA = eye(3);\r\ny_correct = (1-A)*sqrt(2);\r\ntol = 10*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n%%\r\nA = (1:4)';\r\ny_correct = [     0     1     2     3;...\r\n     1     0     1     2;...\r\n     2     1     0     1;...\r\n     3     2     1     0];\r\ntol = 10*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n\r\n\r\n\r\n%%\r\nA = magic(3);\r\ny_correct = [0       6.48074069840786 9.79795897113271; ...\r\n  6.48074069840786                0 6.48074069840786; ...\r\n  9.79795897113271 6.48074069840786                0];\r\ntol = 1000*eps;\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n%%\r\nA = reshape((1:20).^2,4,5);\r\ntol = 1e-12;\r\ny_correct = [0 49.4469412603045 102.761860629321 160.015624237135; ...\r\n   49.4469412603045 0 53.3385414123783 110.634533487515; ...\r\n   102.761860629321 53.3385414123783 0 57.3149195236284; ...\r\n   160.015624237135 110.634533487515 57.3149195236284 0];\r\nassert(norm(interDist(A)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":28,"test_suite_updated_at":"2016-10-02T16:43:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-02T13:56:26.000Z","updated_at":"2026-04-02T13:14:06.000Z","published_at":"2016-10-02T16:43:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computational geometry. In fact, it is pretty easy to do. norm(u-v) would seem to do the trick, for vectors u and v.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBut what if you have a large number of points between which you want to compute ALL of those distances between every pair of points? In this problem, given an n by p array A, where each row of the matrix will be viewed as containing the coordinates of one p-dimensional point, you need to compute the n by n inter-point distance matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, D(i,J) will be the Euclidean distance between the i'th and j'th rows of A. Of course, D will be a symmetric matrix, with zeros on the diagonal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo you can test your code, here is an example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = [1 1\\n     5 2\\n     2 2\\n     4 5]\\n\\nformat short g\\nD = interDist(A)\\nD =\\n       0       4.1231       1.4142            5\\n  4.1231            0            3       3.1623\\n  1.4142            3            0       3.6056\\n       5       3.1623       3.6056            0]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThus, thinking of the points [1 1] and [5 2] as the coordinates of two points in the (x,y) plane, the Euclidean distance between them in that plane is 4.1231...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs you can see, the matrix is symmetric, with zeros on the main diagonal. That must always happen, since the distance between any point and itself must be zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":450,"title":"What is the distance from point P(x,y) to the line Ax + By + C = 0?","description":"Given a point, P(x,y), find the distance from this point to a linear line.\r\n\r\nINPUTS: x, y, A, B, C\r\n\r\nOUTPUTS: d, the distance which of course should always be positive.\r\n    \r\n  EX:\r\n  \u003e\u003ex=2; y=2; A=2; B=2; C=-4;\r\n  \u003e\u003ed = normalLen(x,y,A,B,C)\r\n  d = 1.4142\r\n\r\n\r\n","description_html":"\u003cp\u003eGiven a point, P(x,y), find the distance from this point to a linear line.\u003c/p\u003e\u003cp\u003eINPUTS: x, y, A, B, C\u003c/p\u003e\u003cp\u003eOUTPUTS: d, the distance which of course should always be positive.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eEX:\r\n\u003e\u003ex=2; y=2; A=2; B=2; C=-4;\r\n\u003e\u003ed = normalLen(x,y,A,B,C)\r\nd = 1.4142\r\n\u003c/pre\u003e","function_template":"function d = normalLen(x,y,A,B,C)\r\n  d = x+y+[A,B,C]\r\nend","test_suite":"%% test 1\r\nx=2; y=2; A=2; B=2; C=-4;\r\ny_correct = 1.4142;\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)\u003c=1e-4)\r\n%% test 2\r\nx=3; y=4; A=3; B=4; C=5;\r\ny_correct = 6;\r\nassert(normalLen(x,y,A,B,C)-y_correct==0)\r\n%% test 3\r\nx=4; y=5; A=3; B=4; C=5;\r\ny_correct = 7.4;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)\u003c1e-1)\r\n%% test 4\r\nx=0;y=12345;A=0;B=1;C=0;\r\ny_correct = 12345;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)==0)\r\n%% test 5\r\nx=0;y=-12345;A=0;B=1;C=0;\r\ny_correct = 12345;\r\ndisplay(normalLen(x,y,A,B,C))\r\nassert(abs(normalLen(x,y,A,B,C)-y_correct)==0)\r\n\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":560,"test_suite_updated_at":"2013-01-26T00:45:07.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-03-05T04:51:25.000Z","updated_at":"2026-03-13T05:04:32.000Z","published_at":"2012-03-06T06:29:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a point, P(x,y), find the distance from this point to a linear line.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eINPUTS: x, y, A, B, C\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOUTPUTS: d, the distance which of course should always be positive.\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[EX:\\n\u003e\u003ex=2; y=2; A=2; B=2; C=-4;\\n\u003e\u003ed = normalLen(x,y,A,B,C)\\nd = 1.4142]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2393,"title":"Measure a Special Distance","description":"Given an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.","description_html":"\u003cp\u003eGiven an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.\u003c/p\u003e","function_template":"function ldist = measure_dist(linef,cd,gd)\r\nn=size(linef,1);\r\nldist=zeros(n);\r\nfor a=1:n\r\n    for b=1:n\r\n        if linef(a,1)\u003e0\u0026\u0026linef(b,2)\u003e0\r\n            ldist(b,a)=( linef(a,1)+linef(b,2)-cd ).^2;\r\n        elseif linef(a,1)\u003c0\u0026\u0026linef(b,2)\u003c0\r\n            ldist(b,a)=( linef(a,1)+linef(b,2)-gd ).^2;\r\n        else\r\n            ldist(b,a)=( abs(linef(a,1)-linef(b,2))-(cd-gd) ).^2;\r\n        end\r\n    end\r\nend","test_suite":"%%\r\ncd=randi(100);\r\ngd=-randi(100);\r\nlinef=(cd-gd)*rand(randi([50,100]),2)+gd;\r\n%\r\nn=size(linef,1);\r\nldist=zeros(n);\r\nfor a=1:n\r\n    for b=1:n\r\n        if linef(a,1)\u003e0\u0026\u0026linef(b,2)\u003e0\r\n            ldist(b,a)=(linef(a,1)+linef(b,2)-cd).^2;\r\n        elseif linef(a,1)\u003c0\u0026\u0026linef(b,2)\u003c0\r\n            ldist(b,a)=(linef(a,1)+linef(b,2)-gd).^2;\r\n        else\r\n            ldist(b,a)=(abs(linef(a,1)-linef(b,2))-(cd-gd)).^2;\r\n        end\r\n    end\r\nend\r\ny_correct=ldist;\r\nf_result=measure_dist(linef,cd,gd);\r\nassert(all(abs(f_result(:)-y_correct(:))\u003c0.1))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":18223,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2014-07-02T13:30:11.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-28T05:23:57.000Z","updated_at":"2014-07-03T15:58:45.000Z","published_at":"2014-07-02T11:59:26.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2199,"title":"Pairwise Euclidean Distance","description":"Given two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns).  The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\r\n\r\nExample:\r\n\r\n pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\r\n ans =\r\n    5.6569    8.4853   11.3137\r\n    2.8284    5.6569    8.4853","description_html":"\u003cp\u003eGiven two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns).  The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\r\n ans =\r\n    5.6569    8.4853   11.3137\r\n    2.8284    5.6569    8.4853\u003c/pre\u003e","function_template":"function d = pairEuc(a,b)\r\n  d = zeros(size(a,2),size(b,2));\r\nend","test_suite":"%%\r\na = [9 10 3 10 10; 10 7 6 2 5; 2 1 10 10 9];\r\nb = [2 8 1; 5 10 9; 10 7 10];\r\nd = [11.7473    5.0990   11.3578; ...\r\n     12.2066    7.0000   12.8841; ...\r\n      1.4142    7.0711    3.6056; ...\r\n      8.5440    8.7750   11.4018; ...\r\n      8.0623    5.7446    9.8995];\r\nassert(all(all(abs(pairEuc(a,b)-d)\u003c1e-4)))\r\n\r\n%%\r\na = [1 2; 3 4]';\r\nb = [5 6; 7 8; 9 10]';\r\nd = [5.6569    8.4853   11.3137;...\r\n     2.8284    5.6569    8.4853];\r\nassert(all(all(abs(pairEuc(a,b)-d)\u003c1e-4)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":23140,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":"2014-02-19T00:50:33.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-02-19T00:27:04.000Z","updated_at":"2026-02-19T10:24:33.000Z","published_at":"2014-02-19T00:50:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns). The result should be a matrix of dimensions KxL which contains all possible pairs of distances.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[ pairEuc([1 2; 3 4]', [5 6; 7 8; 9 10]')\\n ans =\\n    5.6569    8.4853   11.3137\\n    2.8284    5.6569    8.4853]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44816,"title":"Word Distance - Average Sort","description":"Based on the method of \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum this problem\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if \r\n\r\n str_arr = {'jazz','cab','tree'}\r\n\r\nthen \r\n\r\n d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]\r\n\r\nwhich would result in the following sorted order:\r\n\r\n str_arr_sort = {'cab','tree','jazz'}\r\n\r\nRemember that the method is case insensitive. See the test suite for examples.","description_html":"\u003cp\u003eBased on the method of \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum\"\u003ethis problem\u003c/a\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if\u003c/p\u003e\u003cpre\u003e str_arr = {'jazz','cab','tree'}\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre\u003e d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]\u003c/pre\u003e\u003cp\u003ewhich would result in the following sorted order:\u003c/p\u003e\u003cpre\u003e str_arr_sort = {'cab','tree','jazz'}\u003c/pre\u003e\u003cp\u003eRemember that the method is case insensitive. See the test suite for examples.\u003c/p\u003e","function_template":"function d = word_distance_sort(str_arr)\r\n d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(word_distance_sort({'jazz','cab','tree'}),{'cab','tree','jazz'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'first','second','third'}),{'first','second','third'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'the','longest','words','supercede','some','of','the','shortest'}), ...\r\n\t{'some','longest','of','the','the','supercede','shortest','words'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'}), ...\r\n\t{'one','TWO','EiGHt','FouR','NINe','Three','ten','fiVe','six','sEvEn'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'Why','is','it','that','this','does','not','work','as','expected'}), ...\r\n\t{'not','work','is','it','this','does','as','expected','that','Why'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'set','of','very','short','words','for','this','test','case'}), ...\r\n\t{'for','of','short','this','test','words','case','very','set'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'iron','zinc','carbon','molybdenum','praseodymium','silicon'}), ...\r\n\t{'iron','silicon','molybdenum','carbon','zinc','praseodymium'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'crazier','craziest','crazy'}), ...\r\n\t{'crazy','craziest','crazier'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'this','test','case','with','only','four','each','word'}), ...\r\n\t{'each','only','four','this','word','test','case','with'}))\r\n\r\n%%\r\nassert(isequal(word_distance_sort({'largest','smallest','sourest','sweetest'}), ...\r\n\t{'sourest','smallest','largest','sweetest'}))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-01-02T15:43:24.000Z","updated_at":"2025-11-21T14:57:55.000Z","published_at":"2019-01-09T15:06:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased on the method of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ethis problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, write a function to calculate the letter distance for a set of words and then return the sorted set of words based on their distances, in ascending order. However, their distances will now be normalized by the number of characters in each word. For example, if\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[ str_arr = {'jazz','cab','tree'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\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[ d = [(9+25+0)/4, (2+1)/3, (2+13+0)/4] = [34/4, 3/3, 15/4] = [8.5, 1, 3.75]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhich would result in the following sorted order:\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[ str_arr_sort = {'cab','tree','jazz'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRemember that the method is case insensitive. See the test suite for examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2100,"title":"distance to a straight line (2D) given any 2 distinct points on this straight line","description":"Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\r\n\r\nHint: create a parameter representation of the (very...) long line.","description_html":"\u003cp\u003eGiven 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\u003c/p\u003e\u003cp\u003eHint: create a parameter representation of the (very...) long line.\u003c/p\u003e","function_template":"function d = dist2line(p1,p2,pe)\r\n  d=norm(pe);\r\nend","test_suite":"%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[-2;0];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071070e-01))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[-0.8;0.1];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071100e-02))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[0;0.9];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,7.071100e-02))\r\n%%\r\np1=[0;-1];\r\np2=[0;1];\r\npe=[-pi;100];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,3.141593))\r\n%%\r\np1=[-1;0];\r\np2=[2;3];\r\npe=[0;1];\r\n\r\nd=round(1e+6*dist2line(p1,p2,pe))/1e+6;\r\nassert(isequal(d,0))","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":20079,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":"2014-01-15T03:55:52.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-01-10T05:50:50.000Z","updated_at":"2026-02-19T10:19:57.000Z","published_at":"2014-01-10T13:49:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answer should have an accuracy of 1e-6.\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\u003eHint: create a parameter representation of the (very...) long line.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60940,"title":"Find the first occurence of a given gap between two consecutive prime numbers","description":"Problem statement \r\n\r\nGiven a gap = p' - p between the two consecutive prime numbers p and p', find its first occurence, f.\r\n\r\nExamples\r\n\r\nIf , f=2, since 5 - 3 = 2, and 3 is the 2nd prime;\r\nIf , f=4, since 11 - 7 = 4, and 7 is the 4th prime;\r\nIf , f=9, since 29 - 23 = 6, and 23 is the 9th prime;\r\nIf  neither equals an even positive integer nor equals 1 your function should return the empty set : f = []; \r\n\r\nSee also\r\nProblem 60939. Frequencies of prime gaps\r\nPrime numbers properties II","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: 403.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 201.65px; transform-origin: 408px 201.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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 64.95px 8px; transform-origin: 64.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 39.675px 8px; transform-origin: 39.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a gap \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.3667px 8px; transform-origin: 21.3667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e= p' - 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; perspective-origin: 142.367px 8px; transform-origin: 142.367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between the two consecutive prime 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: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep\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: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 9.10833px 8px; transform-origin: 9.10833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ep', \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: 75.4417px 8px; transform-origin: 75.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efind its first occurence, f.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.3px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 30.65px; transform-origin: 392px 30.65px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAAC70lEQVRoQ+1YPUgeQRDVXgmaSttYKKSwiQohbQRBLAIaxMIuSZFSiBYhpDCQlCmSCHYi0c4mEBELRclPk0JIiliYQisDwfTJe7ID67l7397Owbef7MHj7vtuZ2727dvZ2W1vy5eKgXaVdTZuywQqRZAJzAQqGVCaZwVmApUMKM1jFXiM774GXii/n4p5NwJ5AowD/SaoE9x3gUfAb1+gMQTehbOPwF+gMxUGFHHcgu0G0OPxwX4OAoeu9zEEfoKjYePsPu5riuBTMP2OIK4BK8CWCege7tNAh/ntFUtVAm/A4U+r1z/wPJACC5ExzMPuMTABfC344LQ+sJTJqfy2+J2qBFJtY8aJjE4rq5C5/LmLGNPHh7i/Mc/ruE9pCOSInAJLwB9gzjj7jPtIpAKaacbZxEWityQI6TObbAKjGgJfwpgyZkLlZU/lIfwuToFmklPnt/8ZZxTOg1gCORJHwL41CpzOk8ahc3Tq7EWTfNkKdKaq0BzIXPAK4OpEsnhx+f9idawPz86lPrDzVLikhUATZ7M6ZwNz3nuANaFzqocSyGTLvFdcce2SxinxCkykSKDMMu9CGUKgjILLibwTnq7jwVu1VyAzhaZSspWmpxACqTIWmr56j+qUKl6rwhSIkxjYb14s26K3cpLnFuDEt++1a6Wrsr1jOpkBXAX2hUFupEDmgDvAzQZT8wzvpbAuIzslhflioSCehpBHB2UESg4ImZb2AhCrwhQWkUrkNSLwHRpwQ+09ibCG0K6X+HfM9q7ZBIaQx35eyIc+BUrhvAqDS9W3R/t2Yd1qhwxypDWLvkmdW+wmOdkDbtsk+gjkKcUiwALyV2Di4koth5GxKgz8VK3NSN428AFY9njuwv/PgJ2ioHwE2qVJbLStcMgg5MkCWNZX5nZ7J3be1kWgXZbEkid2dW6rtLEU7blIfgNCyKOtMy01KmPqDvrK+csEKoc0E5gJVDKgNM8KzAQqGVCaZwVmApUMKM2zApUE/gdVDoAl3uI4wAAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=2\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 90.0333px 8px; transform-origin: 90.0333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 5 - 3 = 2, and 3 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e2nd\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAACd0lEQVRoQ+2YPS8FQRSG3Z5IqCQSBQWJQuMjES2JRBQSRNQ+fgDBDyChUCh81CL8BAod8dGQKBQURKhIhJ73lZlkct27OztnrLv3ziZvrLtz5px59szsmclVhUtEICeyDsZVAaAwCQLAAFBIQGgeMjAAFBIQmrtm4DP8bkArQv+lbF6H4E6gRqimWKAuAPvR2SH0GdVxKZOxjG0b7abixukC8AyddqsgxvH3wDKgLDUbQ7D7KuDIREkKsBmd3hkkbnHfliUyFrFyjFfQE9TqOwOZbYMqiOoyzULOsHfoGprzCZCL6iu0oxywc17nUI/Fm81Ck1UEOQm1Qwu+AbLzWahDkTCnchd+u8wCoYgYO/HsGBqBjiCO11sGMvseoFNoQAXB6Tyq7ulQ/55FjhzfDbQLzasBeAU4g07XjLdDH3xjFwatFtzfC+jpgAVd/Ji6zAYmQxNkLkVeAbJw5sKa/8U1SxqujdOC0f8XQJYs69AwZC5D3gDqmqhQzWfWS2RXD70JIKZtqksWrnVbec69AWSW1RbIPu2P2dmg/pFmYdoAOTau7UyE/MsLQL3OLaH3Yvtero+bynuWtncENAT1Fpk1XgByce2DWBdFTc0PPNeFdRTstDMsyt+XQzC/EiRqK6e3bTbT0vwAuGZh2h+RPwfI04gJiIVzXHmidyn6pbocMqQNMC4BRVNYF8578GJbmpiFdTkcMogALgLcMvQCPca9KvWcX2qeXkiy0NJVKs1EAM3SxDXarB8yOAM0yxJXeNrOZVsl9enL3hmgrwAqop+kJ9IVASXJIAPAJLQKtA0AA0AhAaF5yMAAUEhAaB4yMAAUEhCafwM814AluHiUvQAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=4\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 93.4083px 8px; transform-origin: 93.4083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 11 - 7 = 4, and 7 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 10.5px 8px; transform-origin: 10.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e4th\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAADEUlEQVRoQ+1Yv2sVQRB+6RVRq6SxiIVCCiExEUFLBTsREkmVKuofYKFFyghaWmgsRCzEH4W1SReIaGxsBAsttNBKIcTefB/syLy727vdnXd3RPbg4z3e253Z+e7bmdkdG+THxMCYaXaePMgEGkWQCcwEGhkwTs8KzAQaGaiffgR/zwDTwGHgFfBBT0lV4A8YuQ/caXX5/Rm/DteXgbPAW+AxsAH8Li4phcALMPIG+AMc7C/GVjyfhtWnwAngPbACrNd5SiHwHQzOOaNX8fmilVC6N0rV3QMOAC+BG1WKsypwEga+KCOf8f1k97GO3OMCLD53Vqm8M6EeYhVItV1yxvmm+Ox3FVIUH53yfuJzKkR5QnAMgaxIv4BHwA5wM+WNhb7ZDsfplHQbfqMKYwyBd11eOOWC01t5Fr8NlfcOCbC4YtHYdgZYFI/FqI/zQgmk+r4BLOkXnUNu53n3nZVKfrcE1PXcYgyvsYAlQIokc/wmcMtHbCiBUqGuwJCUdf32GPhx4KuBASpc0oLBzCBmN7CfHVcK/OQI40/nFZFUJ3deKb5QAumIea9YcXX+YG68Zoi8DwL/qvVW5T8K54EiuNT3hhAoJb6q2uryTz9HfVI3ENvWVDkQ0D6r74THkd7m7A0f6nEhBFJlhyrUJ3b0NrCqsC2yquxqAutyuBZJaVwTgZLn6sp7o8y7ZCXCVyiB0r7RdOn42kQg5XsOaGoudzFGGuvoXioi6FEPlRzY1EXIuCgC5dgWsi11AUi9ZOijiEj6aVqzEFg6utYpcA2vexGoLN8FKWiZ86+U410fBDLGZReLrwDq2HjJwJz47/ERKI3zM4wMbU10tdovlwz6csSXenSu5GFh6HrLRyA771WA5f17YOJhpeY9mjwpKgx0NdJhvNskSb5tLMKozJM+AnVrkrraqGuhVCcjmMfdtuVefnHnSIfBWHgLFXQjrdsS6/pijlVWX9b5jHsJ4DmYhMnzBF+GmmftqKmNsS7qv5+fCTS+4kxgJtDIgHF6VmAm0MiAcXpWYCbQyIBxelagkcA9dW2WJVpPbIMAAAAASUVORK5CYII=\" width=\"40\" height=\"18\" style=\"width: 40px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, f\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 7.98333px 8px; transform-origin: 7.98333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e=9\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 101.708px 8px; transform-origin: 101.708px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e, since 29 - 23 = 6, and 23 is the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 10.5px 8px; transform-origin: 10.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e9th\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.3917px 8px; transform-origin: 21.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e prime;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 5.825px 8px; transform-origin: 5.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: normal; font-weight: 400; color: rgb(0, 0, 0);\"\u003eΔ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 158.333px 8px; transform-origin: 158.333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e neither equals an even positive integer nor equals \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: 5.83333px 8px; transform-origin: 5.83333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e1 \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: 132.625px 8px; transform-origin: 132.625px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eyour function should return the empty set : \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: 14.975px 8px; transform-origin: 14.975px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ef = []\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60939-frequencies-of-prime-gaps\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60939. Frequencies of prime gaps\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95759\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties II\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = first_occurence_of_prime_gap(delta)\r\n  f = delta;\r\nend","test_suite":"%%\r\ndelta = 2;\r\nf_correct = 2;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 4;\r\nf_correct = 4;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 6;\r\nf_correct = 9;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 8;\r\nf_correct = 24;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 14;\r\nf_correct = 30;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 10;\r\nf_correct = 34;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 12;\r\nf_correct = 46;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 1;\r\nf_correct = 1;\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = 3;\r\nf_correct = [];\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%%\r\ndelta = -1 +1i*pi;\r\nf_correct = [];\r\nassert(isequal(first_occurence_of_prime_gap(delta),f_correct))\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('first_occurence_of_prime_gap.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T06:47:33.000Z","deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":"2025-07-09T05:56:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-06-25T12:22:19.000Z","updated_at":"2026-03-30T01:19:31.000Z","published_at":"2025-06-25T13:06:05.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement \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\u003eGiven a gap \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e= p' - p\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e between the two consecutive prime numbers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep', \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003efind its first occurence, f.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf \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\\\\Delta = 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 5 - 3 = 2, and 3 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2nd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf \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\\\\Delta = 4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 11 - 7 = 4, and 7 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e4th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\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\u003e\\\\Delta = 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, f\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e=9\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, since 29 - 23 = 6, and 23 is the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e9th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e prime;\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 \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\\\\Delta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e neither equals an even positive integer nor equals \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e1 \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eyour function should return the empty set : \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ef = []\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\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60939-frequencies-of-prime-gaps\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60939. Frequencies of prime gaps\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95759\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties II\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":490,"title":"Fastest shortest-path-finder in the west","description":"Given connectivity information about a graph, your job is to find the shortest-path distance between every pair of vertices in this graph.\r\nNote: Valid solutions will be scored based on their speed, not their size (hence the fastest in the west...).\r\nFormat: D = mindist(from,to)\r\nInputs: two vectors, from and to, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex a and b does not imply a connection between vertex b and a; in other words this is a directed graph)\r\nOutput: D is a square matrix where D(a,b) is the number of edges in the shortest-path starting from vertex a and ending in vertex b (or inf if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\r\nExample:\r\n    D=mindist([1,2,3],[2,3,4])\r\n    D =\r\n\r\n     0     1     2     3\r\n   Inf     0     1     2\r\n   Inf   Inf     0     1\r\n   Inf   Inf   Inf     0\r\nImportant note \u0026 disclaimer: Your algorithm will be scored based on its speed, not based on its cody size. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g. http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments) regarding the cody scoring method. This problem is just a little experiment on tweaking cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 527px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 469px 263.5px; transform-origin: 469px 263.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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven connectivity information about a graph, your job is to find the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Shortest_path_problem\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eshortest-path distance\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e between every pair of vertices in this graph.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: Valid solutions will be scored based on their\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003espeed\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, not their\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003esize\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (hence the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003efastest in the west\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: 0px 0px; transform-origin: 0px 0px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFormat:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e D = mindist(from,to)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 31.5px; text-align: left; transform-origin: 445px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInputs:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e two vectors,\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003efrom\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eto\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e does not imply a connection between vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e; in other words this is a directed graph)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 31.5px; text-align: left; transform-origin: 445px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eD\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a square matrix where\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eD(a,b)\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the number of edges in the shortest-path starting from vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and ending in vertex\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (or\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003einf\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 10.5px; text-align: left; transform-origin: 445px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 126px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 465px 63px; transform-origin: 465px 63px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    D=mindist([1,2,3],[2,3,4])\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    D =\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     2     3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf     0     1     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf   Inf     0     1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 18px; 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: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; line-height: 18.004px; 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; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 465px 9px; text-wrap-mode: nowrap; transform-origin: 465px 9px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(33, 33, 33); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(33, 33, 33); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(33, 33, 33); border-left-style: none; border-left-width: 0px; border-right-color: rgb(33, 33, 33); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   Inf   Inf   Inf     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 126px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 445px 63px; text-align: left; transform-origin: 445px 63px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eImportant note \u0026amp; disclaimer:\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Your algorithm will be scored based on its\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003espeed\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, not based on its cody\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003esize\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g.\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\"\u003e\u003cspan style=\"border-block-end-color: rgb(0, 91, 130); border-block-start-color: rgb(0, 91, 130); border-bottom-color: rgb(0, 91, 130); border-inline-end-color: rgb(0, 91, 130); border-inline-start-color: rgb(0, 91, 130); border-left-color: rgb(0, 91, 130); border-right-color: rgb(0, 91, 130); border-top-color: rgb(0, 91, 130); caret-color: rgb(0, 91, 130); color: rgb(0, 91, 130); column-rule-color: rgb(0, 91, 130); outline-color: rgb(0, 91, 130); text-decoration-color: rgb(0, 91, 130); text-emphasis-color: rgb(0, 91, 130); \"\u003e\u003cspan style=\"\"\u003ehttp://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e) regarding the cody scoring method. This problem is just a little experiment on\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003etweaking\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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function D = mindist(from,to)\r\n  D=zeros(max([from,to]));\r\nend","test_suite":"%%\r\n% test small connectivity matrix (3x3)\r\nassert(isequal(mindist([1,3,2,3],[2,2,1,2]),[0 1 Inf;1 0 Inf;2 1 0]))\r\nt0=clock;\r\nD=mindist([1,3,2,3],[2,2,1,2]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)'); \r\ndisp(t1)\r\n\r\n%%\r\n% test small connectivity matrix (10 vertices, 15 edges)\r\nassert(isequal(mindist([10 5 5 7 7 3 3 4 6 6 1 8 7 1 10],[7 4 10 6 8 4 1 7 9 4 6 9 6 10 9]),[0 Inf Inf 2 Inf 1 2 3 2 1;Inf 0 Inf Inf Inf Inf Inf Inf Inf Inf;1 Inf 0 1 Inf 2 2 3 3 2;Inf Inf Inf 0 Inf 2 1 2 3 Inf;Inf Inf Inf 1 0 3 2 3 2 1;Inf Inf Inf 1 Inf 0 2 3 1 Inf;Inf Inf Inf 2 Inf 1 0 1 2 Inf;Inf Inf Inf Inf Inf Inf Inf 0 1 Inf;Inf Inf Inf Inf Inf Inf Inf Inf 0 Inf;Inf Inf Inf 3 Inf 2 1 2 1 0]))\r\nt0=clock;\r\nD=mindist([10 5 5 7 7 3 3 4 6 6 1 8 7 1 10],[7 4 10 6 8 4 1 7 9 4 6 9 6 10 9]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% test small connectivity matrix (10 vertices, 30 edges)\r\nassert(isequal(mindist([4 10 2 9 8 2 7 10 3 7 5 9 2 6 9 3 2 9 8 7 9 9 10 8 2 7 3 2 1 8],[2 6 9 4 3 1 4 8 10 5 4 6 5 5 7 4 7 1 4 4 3 8 5 7 5 4 7 3 4 1]),[0 2 3 1 3 4 3 4 3 4;1 0 1 2 1 2 1 2 1 2;3 2 0 1 2 2 1 2 3 1;2 1 2 0 2 3 2 3 2 3;3 2 3 1 0 4 3 4 3 4;4 3 4 2 1 0 4 5 4 5;3 2 3 1 1 4 0 4 3 4;1 2 1 1 2 3 1 0 3 2;1 2 1 1 2 1 1 1 0 2;2 3 2 2 1 1 2 1 4 0]))\r\nt0=clock;\r\nD=mindist([4 10 2 9 8 2 7 10 3 7 5 9 2 6 9 3 2 9 8 7 9 9 10 8 2 7 3 2 1 8],[2 6 9 4 3 1 4 8 10 5 4 6 5 5 7 4 7 1 4 4 3 8 5 7 5 4 7 3 4 1]);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% test medium connectivity matrix (100 vertices, 200 edges)\r\ni=[17 21 97 93 63 87 68 14 40 12 30 60 45 63 55 43 71 74 32 66 48 27 10 80 1 50 36 40 100 35 84 75 93 94 79 49 6 6 60 24 80 43 60 41 64 87 1 17 44 63 6 89 15 70 74 48 69 68 63 24 77 82 48 69 33 50 100 90 37 29 10 62 61 87 69 6 45 27 77 8 100 94 77 26 8 72 59 4 4 36 59 47 9 60 95 88 15 27 32 50 51 42 40 76 22 32 68 39 46 82 32 27 15 39 75 63 33 63 63 91 64 43 13 10 2 56 10 62 45 24 44 58 80 2 44 98 80 92 31 97 76 82 48 68 5 100 91 65 65 90 77 96 95 44 84 4 29 85 25 99 26 75 47 2 47 64 63 4 83 73 63 26 56 99 9 98 47 7 82 53 86 84 66 40 83 76 69 86 74 60 18 99 69 3 10 35 85];\r\nj=[6 27 87 92 2 77 23 12 86 60 81 18 14 69 98 84 91 76 12 81 22 81 4 26 25 27 56 39 52 20 56 92 21 37 61 100 24 67 34 76 77 90 46 25 76 69 44 94 65 9 80 28 56 39 65 68 37 51 12 1 64 21 98 50 46 99 86 21 46 99 99 81 16 60 80 20 88 74 68 15 72 55 28 67 11 31 24 39 85 35 64 42 65 87 45 95 78 59 49 13 61 30 28 31 28 35 13 74 13 7 94 60 2 40 74 93 38 18 91 84 25 29 72 36 98 12 41 28 31 54 73 71 49 29 43 82 10 46 8 91 30 80 54 26 83 46 84 51 17 20 78 7 50 30 58 58 27 30 36 15 42 54 32 13 80 89 4 50 56 88 16 98 49 24 91 72 55 77 65 83 79 12 82 70 93 19 95 35 62 98 51 70 48 68 56 28 6];\r\n\r\nassert(isequal(interp2(mindist(i,j),[2 55 45 33 34 87 53 43 99 50],[90 66 53 41 94 68 94 38 23 76],'nearest'),[8,5,8,Inf,7,7,Inf,Inf,Inf,9]))\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1=etime(clock,t0)*1e3;\r\ndisp('Time (ms)');\r\ndisp(t1)\r\n\r\n%%\r\n% Time-score evaluation\r\n% test medium connectivity matrix (100 vertices, 200 edges)\r\nrand('state',2); \r\nn=100;m=200; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% first run for initialization\r\nassert(isequal(interp2(mindist(i,j),I,J,'nearest'),[6 6 Inf 0 5 Inf 4 8 6 3]))\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(1)=etime(clock,t0)*1e3;\r\n\r\n% test large connectivity matrix (1000 vertices, 2000 edges)\r\nrand('state',0); \r\nn=1000;m=2000; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% first run for initialization\r\nassert(isequal(interp2(mindist(i,j),I,J,'nearest'),[8 8 9 8 11 7 Inf 5 8 Inf]))\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(2)=etime(clock,t0)*1e3;\r\n\r\n% test large connectivity matrix (1000 vertices, 10000 edges)\r\nrand('state',1); \r\nn=1000;m=10000; \r\ni=ceil(n*rand(1,m));\r\nj=ceil(n*rand(1,m));\r\nk=i==j;i(k)=[];j(k)=[];\r\nI=ceil(n*rand(1,10));J=ceil(n*rand(1,10));\r\n\r\n% second run for time evaluation\r\nt0=clock;\r\nD=mindist(i,j);\r\nt1(3)=etime(clock,t0)*1e3;\r\nassert(isequal(interp2(D,I,J,'nearest'),[3 4 3 4 4 3 3 2 3 3]))\r\n\r\n% convert time to score\r\ndisp('Time (ms)');\r\ndisp(t1);\r\n\r\n% urlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\n% rehash path; \r\n% SetSolutionScore(round(sum(t1)));\r\n%feval(@evalin,'caller',sprintf('score=%d',round(sum(t1))));\r\n%%fh=fopen('mindist.m','wt');\r\n%%fprintf(fh,'%s\\n',repmat('1;',[1,ceil(sum(t1)/2)]));\r\n%%fclose(fh);","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":43,"edited_by":485721,"edited_at":"2026-03-19T14:03:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2026-03-19T14:03:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-13T04:35:04.000Z","updated_at":"2026-03-19T15:07:26.000Z","published_at":"2012-03-15T18:12:51.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\u003eGiven connectivity information about a graph, your job is to find the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Shortest_path_problem\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eshortest-path distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e between every pair of vertices in this graph.\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: Valid solutions will be scored based on their\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, not their\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (hence the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efastest in the west\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFormat:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e D = mindist(from,to)\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\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e two vectors,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efrom\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eto\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, listing the vertex labels for each edge in the graph (note: vertex labels are positive integers, connectivity is unidirectional, meaning that a connection between vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e does not imply a connection between vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; in other words this is a directed graph)\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\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is a square matrix where\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD(a,b)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the number of edges in the shortest-path starting from vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and ending in vertex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003einf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e if there is no path connecting them). Note: Your algorithm is not required to output the actual optimal paths between each pair of vertices, just their distance.\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\u003eExample:\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[    D=mindist([1,2,3],[2,3,4])\\n    D =\\n\\n     0     1     2     3\\n   Inf     0     1     2\\n   Inf   Inf     0     1\\n   Inf   Inf   Inf     0]]\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\u003eImportant note \u0026amp; disclaimer:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Your algorithm will be scored based on its\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, not based on its cody\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The reported 'size' measure for any valid entry will instead reflect the time (in milliseconds) your algorithm takes to solve various test suite problems (see the test suite for details). There has been some discussion (e.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://blogs.mathworks.com/desktop/2012/02/06/scoring-in-cody/#comments\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) regarding the cody scoring method. This problem is just a little experiment on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etweaking\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e cody to use a different scoring method other than the default node-length measure. Of course scoring based on running time has its own issues (e.g. lack of appropriate repeatability), please feel free to comment on ways you would improve how this problem is scored.\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":190,"title":"Great Circle Distance","description":"Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\r\n","description_html":"\u003cp\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/p\u003e","function_template":"function d = sphere_distance(r,a1,p1,a2,p2)\r\n  d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":281,"test_suite_updated_at":"2012-01-31T02:47:01.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-01-31T02:38:51.000Z","updated_at":"2026-03-31T15:30:19.000Z","published_at":"2012-01-31T02:47:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42319,"title":"How close to a hole","description":"Suppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\r\n\r\n  tfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];\r\n\r\nFor this scenario, we want to have:\r\n\r\n  distancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];\r\n\r\nLets assume that outside the sequence there are zeros. For example:\r\n\r\n                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\r\n","description_html":"\u003cp\u003eSuppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];\r\n\u003c/pre\u003e\u003cp\u003eFor this scenario, we want to have:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edistancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];\r\n\u003c/pre\u003e\u003cp\u003eLets assume that outside the sequence there are zeros. For example:\u003c/p\u003e\u003cpre\u003e                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\u003c/pre\u003e","function_template":"function y = distancesFromHoles(x)\r\n  d = diff([0 v]);\r\nend","test_suite":"%%\r\n        x = [0 0 1 1 1 0];\r\ny_correct = [0 0 1 2 1 0];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\n        x = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\r\ny_correct = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = [ones(1,10),0,ones(1,10)];\r\ny_correct = [1:5,5:-1:0,1:5,5:-1:1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\n        x = [1 1 1 0 0 0 0 0 0 0 0 0 1 1 1];\r\ny_correct = [1 2 1 0 0 0 0 0 0 0 0 0 1 2 1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = ones(1,101);\r\ny_correct = [1:51,50:-1:1];\r\nassert(isequal(distancesFromHoles(x),y_correct))\r\n\r\n%%\r\nx = [repmat([1,0],[1,50]),1];\r\ny_correct = x;\r\nassert(isequal(distancesFromHoles(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":44119,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-03-03T19:22:09.000Z","rescore_all_solutions":false,"group_id":39,"created_at":"2015-05-17T08:00:09.000Z","updated_at":"2026-04-02T08:20:08.000Z","published_at":"2015-05-17T08:01:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose you have a description of good places (ones) and bad places (zeros). You want to know your distance from a bad place (in the sense of your location in the array/vector). For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[tfs = [0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor this scenario, we want to 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[distancesFromHoles = [0 0 0 1 2 3 2 1 0 0 0 1 2 1 0 0 0];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLets assume that outside the sequence there are zeros. For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                 tfs = [1 1 1 0 0 1 1 0 1 1 1 1 1 1 1];\\n  distancesFromHoles = [1 2 1 0 0 1 1 0 1 2 3 4 3 2 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44815,"title":"Word Distance - Sum","description":"Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\r\n\r\n word = 'hello'\r\n\r\nthen the total distance would be \r\n\r\n abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.\r\n\r\nLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.","description_html":"\u003cp\u003eLet's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\u003c/p\u003e\u003cpre\u003e word = 'hello'\u003c/pre\u003e\u003cp\u003ethen the total distance would be\u003c/p\u003e\u003cpre\u003e abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.\u003c/pre\u003e\u003cp\u003eLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.\u003c/p\u003e","function_template":"function d = word_distance_sum(str)\r\n d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(word_distance_sum('hello'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Hello'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('HELLO'),13))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('way'),46))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Sway'),50))\r\n\r\n%%\r\n[d] = word_distance_sum({'hello','Sway'});\r\nassert(isequal(d(1),13))\r\nassert(isequal(d(2),50))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('Matlab'),51))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('aBCdEfghIJkLmNOPqrStUVwxyZ'),25))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('qwerty'),44))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('bead'),10))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('payday'),87))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('bookkeeper'),58))\r\n\r\n%%\r\n[d] = word_distance_sum({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'});\r\nassert(isequal(d(1),10))\r\nassert(isequal(d(2),11))\r\nassert(isequal(d(3),35))\r\nassert(isequal(d(4),18))\r\nassert(isequal(d(5),33))\r\nassert(isequal(d(6),25))\r\nassert(isequal(d(7),57))\r\nassert(isequal(d(8),19))\r\nassert(isequal(d(9),19))\r\nassert(isequal(d(10),24))\r\n\r\n%%\r\nassert(isequal(word_distance_sum('crazier'),91))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":185,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-01-02T14:44:50.000Z","updated_at":"2026-03-30T18:05:29.000Z","published_at":"2019-01-02T14:44:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the letters of the alphabet to integers (a = 1, b = 2, ... z = 26). For example, if\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[ word = 'hello']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen the total distance would be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ abs(8–5) + abs(5–12) + abs(12–12) + abs(12–15) = 3 + 7 + 0 + 3 = 13.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet's also make this case insensitive (i.e., 'A' = 'a'). Write a function to return the distance for any word or set of words. See the test suite for examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1446,"title":"Minimum Distance Point to Segment","description":"This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\r\n\r\nThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\r\n\r\nInput are the three defining points and the output is distance.\r\n\r\n*Input (px py vx vy wx wy):*   1 1 0 3 3 0\r\n\r\n*Output distance:* .7071\r\n\r\nPoint is beyond perpendicular to segment.\r\n\r\n*Input (px py vx vy wx wy):*   4 3 -100 0 0 0\r\n\r\n*Output distance:* 5\r\n\r\n\r\nFollow Up Challenges:\r\n\r\n1) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons Minimum distance between non-contiguous N-sided polygons\u003e\r\n\r\n2) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice USC Spring 2013 ACM: Walking on Thin Ice\u003e\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\u003c/p\u003e\u003cp\u003eThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\u003c/p\u003e\u003cp\u003eInput are the three defining points and the output is distance.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput (px py vx vy wx wy):\u003c/b\u003e   1 1 0 3 3 0\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput distance:\u003c/b\u003e .7071\u003c/p\u003e\u003cp\u003ePoint is beyond perpendicular to segment.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput (px py vx vy wx wy):\u003c/b\u003e   4 3 -100 0 0 0\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput distance:\u003c/b\u003e 5\u003c/p\u003e\u003cp\u003eFollow Up Challenges:\u003c/p\u003e\u003cp\u003e1) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons\"\u003eMinimum distance between non-contiguous N-sided polygons\u003c/a\u003e\u003c/p\u003e\u003cp\u003e2) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\"\u003eUSC Spring 2013 ACM: Walking on Thin Ice\u003c/a\u003e\u003c/p\u003e","function_template":"function d=distP2S(px,py,vx,vy,wx,wy)\r\n% segment defined by (vx,vy) to (wx,wy)\r\n% [px py vx vy wx wy]\r\n d=0;\r\nend","test_suite":"%%\r\np=[0 0];\r\nv=[1 -1];\r\nw=[1 1];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-1)\u003c.005)\r\n\r\n%%\r\np=[0 0];\r\nv=[-1 2];\r\nw=[1 2];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-2)\u003c.005)\r\n\r\n%%\r\np=[0 0];\r\nv=[-1 -1];\r\nw=[1 1];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d)\u003c.005)\r\n\r\n%%\r\np=[1 1];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-1/2^.5)\u003c.005)\r\n\r\n%%\r\np=[5 0];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-2)\u003c.005)\r\n\r\n%%\r\np=[0 6];\r\nv=[0 3];\r\nw=[3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2));\r\nassert(abs(d-3)\u003c.005)\r\n\r\n%%\r\np=[-4 0];\r\nv=[0 3];\r\nw=[-3 0];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2))\r\nassert(abs(d-1)\u003c.005)\r\n\r\n%%\r\np=[1 0];\r\nv=[1.01 0];\r\nw=[5 5];\r\nd=distP2S(p(1),p(2),v(1),v(2),w(1),w(2))\r\nassert(abs(d-.01)\u003c.005)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":62,"test_suite_updated_at":"2018-07-20T15:16:15.000Z","rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-23T02:10:21.000Z","updated_at":"2026-02-16T10:58:16.000Z","published_at":"2013-04-23T02:45:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe point is (px,py) and the segment is [(vx,vy) to (wx,wy)].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput are the three defining points and the output is distance.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput (px py vx vy wx wy):\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 1 1 0 3 3 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput distance:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .7071\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePoint is beyond perpendicular to segment.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput (px py vx vy wx wy):\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 4 3 -100 0 0 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput distance:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFollow Up Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1452-minimum-distance-between-two-n-sided-polygons\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMinimum distance between non-contiguous N-sided polygons\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC Spring 2013 ACM: Walking on Thin Ice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43642,"title":"Euclidean distance from a point to a polynomial","description":"A not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\r\n\r\nAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\r\n\r\nGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003chttps://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\r\n\r\nThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\r\n\r\nAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\r\n\r\n  x0y0 = [-2 -5];\r\n  P = [0.5 3 -5];\r\n  D = distance2polynomial(P,xy)\r\n  D =\r\n          1.89013819497707\r\n\r\n(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\r\n\r\nThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\r\n\r\nDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.","description_html":"\u003cp\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/p\u003e\u003cp\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/p\u003e\u003cp\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003ca href = \"https://en.wikipedia.org/wiki/Euclidean_distance\"\u003eEuclidean distance\u003c/a\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/p\u003e\u003cp\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/p\u003e\u003cp\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\nD = distance2polynomial(P,xy)\r\nD =\r\n        1.89013819497707\r\n\u003c/pre\u003e\u003cp\u003e(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\u003c/p\u003e\u003cp\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/p\u003e\u003cp\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/p\u003e","function_template":"function D = distance2polynomial(P,x0y0)\r\n  % compute the minimum Euclidean distance between a point and a polynomial\r\n  D = rand;\r\nend\r\n","test_suite":"%%\r\nx0y0 = [-2 5];\r\nP = [0.5 3 -5];\r\ny_correct = 4.3093988461280149175163000679048;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [pi, pi];\r\nP = [10];\r\ny_correct = 6.8584073464102067615373566167205;\r\ntol = 7e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0.25,50];\r\nP = [1 2 3 4 5];\r\ny_correct = 1.6470039192886012020234097061626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-3 -3];\r\nP = [-2 1];\r\ny_correct = 4.4721359549995793928183473374626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0 5];\r\nP = [1 0 1];\r\ny_correct = 1.9364916731037084425896326998912;\r\ntol = 2e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\ny_correct = 1.8901381949770695260066523338279;\r\ntol = 2e-13;\r\n(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-28T21:00:14.000Z","updated_at":"2026-02-08T12:58:41.000Z","published_at":"2016-10-28T21:08:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Euclidean_distance\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x0y0 = [-2 -5];\\nP = [0.5 3 -5];\\nD = distance2polynomial(P,xy)\\nD =\\n        1.89013819497707]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(Be careful plotting these curves in case you want to plot your solution. The command \\\"axis equal\\\" is a good idea.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":51,"title":"Find the two most distant points","description":"Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\r\n\r\nSo if\r\n\r\n p = [0 0]\r\n     [1 0]\r\n     [2 2]\r\n     [0 1]\r\n\r\nThen \r\n\r\n ix = [1 3]\r\n\r\nThat is, the two points p(1,:) and p(3,:) are farthest apart.","description_html":"\u003cp\u003eGiven a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\u003c/p\u003e\u003cp\u003eSo if\u003c/p\u003e\u003cpre\u003e p = [0 0]\r\n     [1 0]\r\n     [2 2]\r\n     [0 1]\u003c/pre\u003e\u003cp\u003eThen\u003c/p\u003e\u003cpre\u003e ix = [1 3]\u003c/pre\u003e\u003cp\u003eThat is, the two points p(1,:) and p(3,:) are farthest apart.\u003c/p\u003e","function_template":"function ix = mostDistant(p)\r\n  ix = [1 2];\r\nend","test_suite":"%%\r\np = [0 0;\r\n     1 0;\r\n     2 2;\r\n     0 1];\r\nix_correct = [1 3];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [0 0;\r\n     1 0;\r\n     2 2;\r\n     0 10];\r\nix_correct = [2 4];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [0 0;\r\n    -1 50];\r\nix_correct = [1 2];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n\r\n%%\r\np = [5 5;\r\n     1 0;\r\n     2 2;\r\n     0 10;\r\n     -100 20;\r\n     1000 400];\r\nix_correct = [5 6];\r\nassert(isequal(mostDistant(p),ix_correct))\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":8,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2952,"test_suite_updated_at":"2012-02-01T19:47:35.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:24.000Z","updated_at":"2026-02-27T13:38:59.000Z","published_at":"2012-01-18T01:00:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a collection of points, return the indices of the rows that contain the two points most distant from one another. The input vector p has two columns corresponding to the x and y coordinates of each point. Return ix, the (sorted) pair of indices pointing to the remotest rows. There will always be one unique such pair of points.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo if\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[ p = [0 0]\\n     [1 0]\\n     [2 2]\\n     [0 1]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen\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[ ix = [1 3]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThat is, the two points p(1,:) and p(3,:) are farthest apart.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":60953,"title":"Chek the Delta =  p' - p = 6k gap theorem about arithmetic progressions in the prime number set","description":"Context\r\n \r\nIn the prime numbers set there are some arithmetic progressions (sequences of three or more consecutive prime numbers (p, p’, p’’) equally spaced one to the others by an even number  ).\r\n \r\nOne theorem, which can actually easily be proven from , is that above the sole and unique triplet (3, 5, 7) -with a gap of  then-  all the following progressions are such that \r\n \r\nProblem statement\r\n\r\nFor a given interval [i1, i2], i1 \u003e 7 and i2 \u003e 7 find p the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio . \r\n\r\nExamples\r\n                \r\nFor [i1, i2] = [8, 68], p = [47, 53, 59] and k = [1, 1], since this is the first arithmetic progression above 8 and with  here; \r\n \r\nFor [i1, i2] = [180, 228], p = [199, 211, 223], and k = [2, 2], since this is the first arithmetic progression above 180 and with  here;\r\n\r\nFor [i1, i2] = [240, 272], p = [251, 257, 263, 269], and k = [1, 1, 1], since this is the first arithmetic progression above 140 and with  here; \r\n\r\nFor [i1, i2] = [180, 272], p = [199, 211, 223], and k = [2, 2], since this is the first arithmetic progression above 180 and with  here;\r\n\r\nTip\r\n \r\nFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for u = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\r\n\r\nForbidden functions\r\n \r\n \r\nregexp\r\n \r\nstr2num\r\n \r\nassignin\r\n\r\necho\r\n \r\n \r\nSee also\r\n \r\nProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\r\nPrime numbers properties I","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: 1469.2px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 734.6px; transform-origin: 408px 734.6px; 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 26.0583px 8px; transform-origin: 26.0583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eContext\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 248.55px 8px; transform-origin: 248.55px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the prime numbers set there are some arithmetic progressions (sequences of \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: 110.45px 8px; transform-origin: 110.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ethree or more consecutive prime 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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 30.825px 8px; transform-origin: 30.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e(p, p’, 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; perspective-origin: 166.875px 8px; transform-origin: 166.875px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e equally spaced one to the others by an even number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ0AAAAkCAYAAACTxm9CAAAGgElEQVR4Xu1dO8hdRRBOelOolSm00EKxMEV8oGhhoSBJ6ysWVj4KS0VFJFioaCFioQkWQQQfbUDQwkJRfBVKIlpooYVWioK9fl9ylyzjnP/szDl77u65c2D4899/n9/Ofjs7M+dm/754AoFAIBAwILDfUDaKBgKBQCCwL0gjlCAQCARMCARpmOCKwoFAIBCkEToQCAQCJgSCNExwReFAIBDwkMY9gO0VyMGAT0XgDnz6UWDTPQJXbmbws5jJJfidf/u6+xmOT0DFwEMaX6CvGyGPQt4Y73enSpzAbB+CvAx5Yqdmvq7JcrN8C7kIIvfID/jsasidKz8cBjGwkgYb+mm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c+Bckf2FHgqrdfS2msmxvG6ycxuCxNHokSC9pjFml+Vq25AjV9LFkU9UgkKXaLJlfSRl1vEOKkJx+Y5tCex+FHXmTvVomjfRCWg6kZSMtpTBj/ZSQhnxlwHoQtE4aPBCJQ3os/oIxfFv4ewkhuDEYUvqUJcnXg8cevqQls/C8CUHbMOWGLI2xkKt3jmN41v67J+RqdXC3FD0pCTd6D7naa+Vt3xNyLcZAI40h68E6geJBWBuuVF5aOXnWJzE5C8lj+73NL8GmkUZOgNKimiOUXmnJ1GY1KycnPWlF9Ur+e2FaFQONNDQ/hWfRezP5tIxQplQztVqmkVtPXg9+tepopJFS5ZlmnaeR00HY21udWjYksfx7I3kaec+vA1hIg8Q/GwYaaWgREY8Cz5Va7unbU0dzhF6Mho5D0vWLeQq9v+Q05NPgZntgY01x7T6AkBynvhrgWYspdbT7/F1okFdt/uQLazK1fEp/LdatikGPjrxai1QSPanV95LtljhClxzP3H2VOAHn7rO19qpiEKRxYbmDNFpTfd94qm4Y35AWr1UVgyCNIA0isCY9qLphFt/+vg6rYrAmZfHBO0wa1tfBp/a/VP2SkOtSY6nRT0m4sUa/LbVZFYMgjfNLrYWo6Fk/ApH/WU5LymEdC0PH70DyxCa2wbBjj05POX8mJX4KkV9JOTXd34rzNstXxyBI4/w3kfH7QoaeU/jDWr4seCx57jHMtYf3S7S1Yn7JayO71fqa/TY3v6fvRTAI0vAsTdQJBHYYgSCNHV78mHog4EEgSMODWtQJBHYYgf8AaXWjNAVLleIAAAAASUVORK5CYII=\" width=\"134.5\" height=\"18\" style=\"width: 134.5px; 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; perspective-origin: 6.21667px 8px; transform-origin: 6.21667px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 172.317px 8px; transform-origin: 172.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOne theorem, which can actually easily be proven from \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAAAmCAYAAACI9OF6AAAO1UlEQVR4Xu2da+h+2RTHZ96T8IqEmBcj91yjmRdyKZGQy6BJkVtJEhlJk8TkkuSFS0z/FINC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Jlna0kmwuqVCRDlYZZH+3JKQxNvwKkTLIS3Es1WdfXw3J8tzcUd3yTr1/Hrkrndt727tS/HuVQ1d1bzHXKxJt4sM1i7eYeKfXY5i6ZMKfd2dOg3HrQkv91DWNPX/CkDr5DWJvl3gfCzocb37rOGlra0h2y0D5zLQs4295QeIZDAGGEK+q1BjUkmynpiarwVhAJlw5lvvssVfGZOHHHGrDi7m2H+l79Ph2kxaCOlJ/c22VweFGKUU41p5pIbxcW0Z/D9mX2odT2LvR/Y/6GxEYTbJ7JyQ1wnHyx3UMofQS9pjUJx+yaMAFRgBngtCzLr3IdTXsXQ6hPt+f+jKKql6MJFm/j1uzx1jVgQtUWKG4KxUrppjUF0gBoitnhQBbBOxf32hSsqUV9m6/4QuSnbD2CSyliQP7DdN5vQmCvc3kVpPSPVSfWBBOzHmNZ7Tm2AjoN3hT2e1LPQt7d+wxH9b6kStZn/Xa69cVhgFxwIr90Z09r5Q8IFTR5EBgOAJh74ZDfMwXjCBZJUVwC4s+ZKGR9VpzAP6YiI5vNWEpcCSD2H/I8IN4e2Xoje9JvCEQOD4CYe+OP4ZDezCCZIc2OCoPBAKBQCAQCASOgkCQ7FFGKtoZCAQCgUAgcDgEgmQPN2TR4EAgEAgEAoGjIPBvUGKfY9MvwZsAAAAASUVORK5CYII=\" width=\"236.5\" height=\"19\" style=\"width: 236.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; perspective-origin: 85.5667px 8px; transform-origin: 85.5667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is that above the sole and unique triplet \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: 24.1083px 8px; transform-origin: 24.1083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e(3, 5, 7)\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: 45.8917px 8px; transform-origin: 45.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e -with a gap of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAkCAYAAAAeor16AAAC70lEQVRoQ+1YPUgeQRDVXgmaSttYKKSwiQohbQRBLAIaxMIuSZFSiBYhpDCQlCmSCHYi0c4mEBELRclPk0JIiliYQisDwfTJe7ID67l7397Owbef7MHj7vtuZ2727dvZ2W1vy5eKgXaVdTZuywQqRZAJzAQqGVCaZwVmApUMKM1jFXiM774GXii/n4p5NwJ5AowD/SaoE9x3gUfAb1+gMQTehbOPwF+gMxUGFHHcgu0G0OPxwX4OAoeu9zEEfoKjYePsPu5riuBTMP2OIK4BK8CWCege7tNAh/ntFUtVAm/A4U+r1z/wPJACC5ExzMPuMTABfC344LQ+sJTJqfy2+J2qBFJtY8aJjE4rq5C5/LmLGNPHh7i/Mc/ruE9pCOSInAJLwB9gzjj7jPtIpAKaacbZxEWityQI6TObbAKjGgJfwpgyZkLlZU/lIfwuToFmklPnt/8ZZxTOg1gCORJHwL41CpzOk8ahc3Tq7EWTfNkKdKaq0BzIXPAK4OpEsnhx+f9idawPz86lPrDzVLikhUATZ7M6ZwNz3nuANaFzqocSyGTLvFdcce2SxinxCkykSKDMMu9CGUKgjILLibwTnq7jwVu1VyAzhaZSspWmpxACqTIWmr56j+qUKl6rwhSIkxjYb14s26K3cpLnFuDEt++1a6Wrsr1jOpkBXAX2hUFupEDmgDvAzQZT8wzvpbAuIzslhflioSCehpBHB2UESg4ImZb2AhCrwhQWkUrkNSLwHRpwQ+09ibCG0K6X+HfM9q7ZBIaQx35eyIc+BUrhvAqDS9W3R/t2Yd1qhwxypDWLvkmdW+wmOdkDbtsk+gjkKcUiwALyV2Di4koth5GxKgz8VK3NSN428AFY9njuwv/PgJ2ioHwE2qVJbLStcMgg5MkCWNZX5nZ7J3be1kWgXZbEkid2dW6rtLEU7blIfgNCyKOtMy01KmPqDvrK+csEKoc0E5gJVDKgNM8KzAQqGVCaZwVmApUMKM2zApUE/gdVDoAl3uI4wAAAAABJRU5ErkJggg==\" width=\"40\" height=\"18\" style=\"width: 40px; 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; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e then-\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 134.208px 8px; transform-origin: 134.208px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eall the following progressions are such that \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0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Z3ue/6DtRiQ4XwcMdnnJLDST1W4QOOL5c0yoa3h42uMqo5VPMyLQMMpUDA1tiCh+j04o70OzkQUq8f1jpcTZ1eu/Yi7g9fxpFifQ8BQEKniukrDAJh6RU6e1hC5Z4b8geAYUPrAQWvxxvx9OWQZ5q8XPAbniVNaYMaIChQ/2gM8Gg1r8/SH00OhNQ0olbwkshWu+Yy7ica3mF0hhGHOUcY0aS9YBSe1OIsAD58CNE7Tmz0ihz+AFIPNWod34OEMvsmPJZ1/Vj1dvtxSamV0mtKvj471DplDRDYO5aFa/fcIUPfOUKfwO376TUAcN40yr5jO/22yRX1zi+ZZVHvIyxRnPhWDQgrN8EOBjQmvNg+HXM6vF5SzYCbBoT1MZIelts2lmqnPOsjxUw5aUBYD8OpUY/1IevB4YZz0YCw4QZu4pVpoAGhTE/trg3XQAPChhu4iVemgQaEMj21uzZcAw0IG27gJl6ZBv4BNebfNgluZhwAAAAASUVORK5CYII=\" width=\"97\" height=\"19\" style=\"width: 97px; height: 19px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 63.0083px 8px; transform-origin: 63.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 61.4583px 8px; transform-origin: 61.4583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given interval \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: 75.825px 8px; transform-origin: 75.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2], i1 \u0026gt; 7 and i2 \u0026gt; 7\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: 15.1667px 8px; transform-origin: 15.1667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e find \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: 4.275px 8px; transform-origin: 4.275px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep\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: 217.05px 8px; transform-origin: 217.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAAlCAYAAACeVr0yAAAE00lEQVR4Xu1aS6iOQRg+ZyGRIkqRWJCIErnGyrXEgoXbhij3WFGIrCgUolxWLhvsJAsWdsplIxsUCyWXBZLLEs9zfHPOfO+Z+ead75/z/8c589XTf5t555v3mff6f+1t+eoTGmjvE7vIm2jLRPaRQ5CJbD6R47HkZmAosDvV8pnIVJrUy7mJoauB38BA/bTqkZnIVJrUy/mJoYOBq8Am/bQ4Imdh+ANgiJi2DJ/vp1q0l8u5hPsbBqztgfukzOvAAGA28DRiDbrkJcB0YBpwGqB1d1wui+SE1/2UyOHY99viIE/A65sIRWuG3sOgxcD34rBo5mzHoL3AJOADcA7gYftiT/a51j/9lEgq7UKx98t43abRtHIMD8lngLo9D+wJzKN3vFYQyKG3gB2SQCMjE1nW5nt8HFV89QOv43yKU5JnD+MhOQMwwQlZuwxxJzFnf9Wamcgu7SzFW7o++woqMIJQxsMZAN3jmIp5kkTmJsxRKq9MZJd6SCLJtC8qfXRIiYrfTd7BkmMXcNEzx47RHKL2CpnIfxo1iiZxxrUaXTMu+RSv4LBjyAHgMDAIGAGUEhVLyCO8n2N9VsfpOkRysSmAXaK8xOezCTasVUzqccwCmdIfAaR7TWGVnyB3JEDdzfPcvMu1h2Jpp6g6RHKyye5IIFPj/7nGNO5sX3EQX+CVqb59NVJHM+Y9AZitrgc6az+xhrRG6nY+MLMYx1LIWw7VIZIbf1gI50I+NxGyGlnihMb7fm80IeGhpCWaWGiXIGbNx3gzt+YN0to3AtS1ryXnqt0ZH2VjhuQedR2GOkTS9YwtTktdEqmT3kIkLfAOYKf3dhli+IvtxJh5piV3F1+s8BwGxtBj4jcTm+lyrwB27O4Wt2OJpFtYDqSor+hKUlzcZN1kxMQlGYtOQCZdrX2xII9t22lbcq717HtyeYnSPccQuQUbWVPsbJ3LvFOw0mQZJl5JgmQZYG5LnXwUEyh/FfALYP/Wd7lKH5sb0xWy55dCipZI+mY7AVDXN00mJmY5E5d8iQxj21YhUF0OYF5MS46EGyMxS0puZCgqxW0tkcxKGRdtMhtJAGIU3lNj6c5WApM9C/gSEG1YiWnJuVyr5EZmtbWI5Kn9CjCNtq+D+HC8pqZbnezwHwhTcvi24LIUbZasbclxbbr2G+ImQkSWWndaizTux3Vy6mZzrSSS1kJCQtblKtI1DQJjzdzjIcVhd8VAqVdpkSUjiiWSh0YWzIyfPvdUZaytzFq5B14sO0IXU31Zz4XadtqWnL22tH4Zu6XeS62+OkTytD0Tm4tJAkKK6+nfXVYWu2bIKl9B4ESgqiUn15SZsnThtgfr5t61TwjIE+jK6BppY8UqspHxrrhXR55vv3ZLbicEx9S49p/JPCxTATZd7BjqNBpJJAXdBuQ/ANyoEUASNzjcDUuShUDMcyh1FNjIHFcmWleeL2vXtORCazKGs/5kpfAN4KOTz4FTPv3mp+hCKo3/3fzTUdWSi5camJGJTKtSuyXX1FCTiUxLpLYll3ZVSMtEplMps853AJ8CSPrwseYWM5EaLenGxLTkdBIjRmUiI5QVGMp/MBYBH4Gqp+TSrWhJykSmUystcgHAZ5eaXoJlItMR2VJJmciWqj/d4pnIdLpsqaS/H/sWNY37micAAAAASUVORK5CYII=\" width=\"57\" height=\"18.5\" style=\"width: 57px; height: 18.5px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 32.675px 8px; transform-origin: 32.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 31.0667px 8px; transform-origin: 31.0667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e                \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 48.4167px 8px; transform-origin: 48.4167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [8, 68]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 48.0333px 8px; transform-origin: 48.0333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [47, 53, 59]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.5583px 8px; transform-origin: 15.5583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 28.2px 8px; transform-origin: 28.2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [1, 1]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 158.692px 8px; transform-origin: 158.692px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, since this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.89167px 8px; transform-origin: 3.89167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e8\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 29.95px 8px; transform-origin: 29.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAkCAYAAAAgqxBxAAAFm0lEQVR4Xu1bS6iPWxR35iSMSN0BA8rglme3GIlSBlII6RR5le6ILgMjITIy8AjJwPUYSJmgDIg8JoQYuAMGjNwSc36/+lYt+3x7f/t1zvdof/Xr/M/578daa//22mut/Z2RSeUpFhiQBUYGpEtRpVhgUiF0IcGgLFAIPajlLMoUQhcODMoChdCDWs6iTCG0mwP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5KIlJYkJMWaOthJDN1VppF1oHJ1DxpQxxtND65hZZIxJnqWvdjAuDjkdkYvQknX6hBHacLGL3kZSKOFSk8xC6JCr/qEmhSSgmQBuwd/uAL516rpNqqscLgej7TqGmy5CM1bZDPjcDOljmcLGXIe3QWgdj9kSWq2bK1kxF2mohLZVM3zr1K4Thy9WcVO4HIcOOcYk6TZCy0XKVQzuW4rT1YAQT5ZypKb21V7BdsxpYvJSKegqNlXAxP65Q46m0lwqqXU+ZovHRafam10boeUKkuWsT55GZSWEu0ueGC/tOVXWZvo9hbr/5pCN2hRnZxUq02B1hI4trTaRWUROITX7vgF4W2izt4SJtQ7IRmhdiou1bdRdfOxkCf30Apgni3iMlHJUgmhJXTU59EAxSbsvmXOQWs9lxsjiXKx5XR2htdtPsig6p5RxUucO7U+9RwG+x0ECy3MZH/p0mcJ7Az7yPkqdHbhxefO7D/B5qUxuhEM2tnYUoacb+/4D8D2O2QBfSeBDmU8B1rCvqWwXSorSfpgWIMH4CkDof/HE9ou2YiF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2wC+pZlg0tqGokQAAAABJRU5ErkJggg==\" width=\"90\" height=\"18\" style=\"width: 90px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 19.8333px 8px; transform-origin: 19.8333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [180, 228]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 59.1917px 8px; transform-origin: 59.1917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [199, 211, 223]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 32.0833px 8px; transform-origin: 32.0833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [2, 2], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e180\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAAkCAYAAAA0Po6QAAAGMUlEQVR4Xu1bTchWRRTOfRHlKhFa1KJA0E0lRDtJECIoSCmJwLAfiDYa1SJCosJw5UIT3UlWO0GCQlokRtqmUrGFLnSRq0SxfT5PzYHj/ebnzNzr+957ORcO78f3zp0558x55vzNu+oef1wDroH/NL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r2ODpTlWkyNou9AHaS7h1qHUikjGAgYaBxtLqX6CXqCvd1i04cfWGwIMnIOPNfkbg9wxHnS/ZAggyBoaEPK/ViDwfQ2GXGioexArxpXAIHlBbgEdT5YaVWPddM1XXzBwYxijxppxU5Bf8yihxZBAkPm7UUWfXM8KhmwfogQGKuMZUClhuoUx0oQbKmlbluH0AQMPho9mAgQ55FJAYJzOgklL0STW1baUXVM2oXOGnP3pcStC2BwYJO61hD4ama3eYeoJ9JBAWHYCLcbK6l7qGgkPjVcawNBNljnHCZC1DxEDhK4m5fI0rdcVdp0DA+MrXjiz3LrsdihbKihTBoMFCNSRpXnEzV4mGGhYv4FSQKAx7wIxH6q9tZyqGpXKrpYoQSpeuYZgthiQAoM02Xh70do51aWrmg6lRdBFjqkNk+Qa92tgMtX+l83uXoJbpFyWtWKJbeq92kpZqXzaFxA6d03lH3LgMnrhjVzTj3uktc3mxVWLFjGGFSepRfOVFu9gXOquDqsBg2zwd+CIPxqJPQ/gnx+Dfqo4WO6qgInJa4DAKWpuhJaAICz1AYSufKWAKpXPaF6R8gy6XNq6MU33Q1oXG+g9fdmLU+b6JqmrzTFWUo2ggdgeZBrt2S0TWptvViAMAQi9VjcnEPmSOXAMDLHruhblxMb0KZe1rtnyHmP0HaDuD1loxAwVeZ9f/4hJ4urUTyO7PIw9bNSX3Kz6szZYxdPW9BG0h6gNx/TPcNdCmAtBIN6g2AdK3mQtlVativFxroGUBmic/F1H7e/BW99r3gkHQ7Pq/MW5acDBMLcddXmaNeBgaFadvzg3DTgY5rajLk+zBhwMzarzF+emAQfD3HbU5WnWgIOhWXX+4tw04GCY2466PM0auA1Dgoc0VXEbjwAAAABJRU5ErkJggg==\" width=\"97.5\" height=\"18\" style=\"width: 97.5px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [240, 272]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 75.2667px 8px; transform-origin: 75.2667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [251, 257, 263, 269]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 39.8583px 8px; transform-origin: 39.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [1, 1, 1], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e140\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 29.95px 8px; transform-origin: 29.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u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IzbjYrGjr+ZGzNAnjs0wahfyph64jDjcySEZ/QuvsQCe0idQqZOa62ly1+bowKfAgtWWddNUNnpBRqBtCXo1kbkN5glmUnaiMyhzgbu2Nb6JfbQ4sKZvixA1/IBUhIzKxNomXlJYotidSn6piowIfQ9MK8crTVm/UEqV56ItdcE9qVAySVkSZSoZq5xovQpqeWqWPJzP5aVleYpWvUY9o1EVriZNcEKcdym+vtS2gpV8aEHW3qZ5JEZGla8xCZzRM6JH8x5/EltNPBNCnH43Y50HTZ8B1t5KIlJYkJMWaOthJDN1VppF1oHJ1DxpQxxtND65hZZIxJnqWvdjAuDjkdkYvQknX6hBHacLGL3kZSKOFSk8xC6JCr/qEmhSSgmQBuwd/uAL516rpNqqscLgej7TqGmy5CM1bZDPjcDOljmcLGXIe3QWgdj9kSWq2bK1kxF2mohLZVM3zr1K4Thy9WcVO4HIcOOcYk6TZCy0XKVQzuW4rT1YAQT5ZypKb21V7BdsxpYvJSKegqNlXAxP65Q46m0lwqqXU+ZovHRafam10boeUKkuWsT55GZSWEu0ueGC/tOVXWZvo9hbr/5pCN2hRnZxUq02B1hI4trTaRWUROITX7vgF4W2izt4SJtQ7IRmhdiou1bdRdfOxkCf30Apgni3iMlHJUgmhJXTU59EAxSbsvmXOQWs9lxsjiXKx5XR2htdtPsig6p5RxUucO7U+9RwG+x0ECy3MZH/p0mcJ7Az7yPkqdHbhxefO7D/B5qUxuhEM2tnYUoacb+/4D8D2O2QBfSeBDmU8B1rCvqWwXSorSfpgWIMH4CkDof/HE9ou2YiF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2QCF0tOlKxy5aoBC6i6tSZIq2wC+pZlg0tqGokQAAAABJRU5ErkJggg==\" width=\"90\" height=\"18\" style=\"width: 90px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 19.8333px 8px; transform-origin: 19.8333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 20.4333px; transform-origin: 392px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 20.4333px; text-align: left; transform-origin: 364px 20.4333px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 12.4417px 8px; transform-origin: 12.4417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 60.0917px 8px; transform-origin: 60.0917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003e[i1, i2] = [180, 272]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 59.1917px 8px; transform-origin: 59.1917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ep = [199, 211, 223]\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 32.0833px 8px; transform-origin: 32.0833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; font-weight: 700; \"\u003ek = [2, 2], \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 154.808px 8px; transform-origin: 154.808px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince this is the first arithmetic progression above \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e180\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAAkCAYAAAA0Po6QAAAGMUlEQVR4Xu1bTchWRRTOfRHlKhFa1KJA0E0lRDtJECIoSCmJwLAfiDYa1SJCosJw5UIT3UlWO0GCQlokRtqmUrGFLnSRq0SxfT5PzYHj/ebnzNzr+957ORcO78f3zp0558x55vzNu+oef1wDroH/NLDK9eAacA38rwEHg1uCayBowMHgpuAacDC4DbgG7tSAewa3CNeAewa3gYwGHsF374HWg54C/Qn6A3QE9MNENUeZSJsC/5/j87qWpdUz/IVJ9oM+m6hicmw/iC/fB20HrTHIJ+Ofw9jHwvhr+DwFequrcMN8yx7yJhj4AnRvghF+R6BM4eHevAF6FXR/2JMkoFvA8Cwm/R70D+i+KWjEyKMYNQ2YhmCR7wmMOw56KLEG59gAumzkYdnDZG9LfGzGgLF7iK3g8XDYy2/x+WFpH1rA8Asmpevksw30TUlzE/ieinsBdAO0M/BrAcNFjOWJcxR0Mrz3Ij5fDpvAf1nmGYuK6PF5wH0Fugl6GLRFySJ8nsEfG8fCdISPL8M+UvcHQCZPVgsGxlyX1OKMJR8fsVKsrFEuOb0F7CUj/gDvvAN6HvRrZyF6mfMg8Rj0NgetzCxpHMOjd0FPg3QsTe/3YwQQtbazKLEECFyvKqSrFYhegCcFH4kp5+IdZLOsYOApuidj5DQunkp86Kbpfcb80Msxtu4CmzxrWUQGq+3wYDgGehtUEy4ShJ+AGJJZH+r46zCYYVzNu1UdaAr1N+gQiC50d1h07C7TqkgZZwEDPQkT5FyCLfrivNUbU8v0AONpfDEgcGotSy0YmF8yF6nJn7Q3sh4k5PEKSPI9hqtVeY0V3VTAXhDdPRNCPjpcejKjyAH2aaFTWMBgZejfMJAHCKsaU35EFspQEx7TSE+DWGmzAEIDgQctI5E7SqAJJTJs/TR813RAW8EgqPsZi4nrYcj0Ulh8Cief1R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W5acDBMLcddXmaNeBgaFadvzg3DTgY5rajLk+zBhwMzarzF+emAQfD3HbU5WnWgIOhWXX+4tw04GCY2466PM0auA1Dgoc0VXEbjwAAAABJRU5ErkJggg==\" width=\"97.5\" height=\"18\" style=\"width: 97.5px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 17.8917px 8px; transform-origin: 17.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e here;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 10.3667px 8px; transform-origin: 10.3667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTip\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 358.192px 8px; transform-origin: 358.192px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for \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: 122.325px 8px; transform-origin: 122.325px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eu = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 67.6417px 8px; transform-origin: 67.6417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eForbidden functions\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 21.4px 8px; transform-origin: 21.4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eregexp\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.2833px 8px; transform-origin: 25.2833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003estr2num\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 25.6833px 8px; transform-origin: 25.6833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eassignin\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 392px 10.2167px; transform-origin: 392px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 364px 10.2167px; text-align: left; transform-origin: 364px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.175px 8px; transform-origin: 15.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eecho\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95630\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ePrime numbers properties I\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [p, k] = check_the_6k_delta_theorem(i1, i2)\r\n  \r\n    u = i1;\r\n    k = i2;\r\n\r\nend","test_suite":"%%\r\ni1 = 8;\r\ni2 = 68;\r\np_correct = [47, 53, 59];\r\nk_correct = [1, 1];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 180;\r\ni2 = 228;\r\np_correct = [199, 211, 223];\r\nk_correct = [2, 2];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 240;\r\ni2 = 272;\r\np_correct = [251, 257, 263, 269];\r\nk_correct = [1, 1, 1];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%%\r\ni1 = 180;\r\ni2 = 272;\r\np_correct = [199, 211, 223];\r\nk_correct = [2, 2];\r\n[p,k] = check_the_6k_delta_theorem(i1,i2);\r\nassert(isequal(p,p_correct) \u0026 isequal(k,k_correct))\r\n\r\n\r\n%% Test forbidden functions\r\nfiletext = fileread('check_the_6k_delta_theorem.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T07:04:42.000Z","deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2025-07-11T05:36:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2025-07-05T06:40:29.000Z","updated_at":"2026-03-06T14:30:46.000Z","published_at":"2025-07-10T12:03:38.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eContext\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\u003eIn the prime numbers set there are some arithmetic progressions (sequences of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethree or more consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e(p, p’, p’’)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e equally spaced one to the others by an even 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\u003e\\\\mathbf{\\\\Delta = p' - p = p'' - p'}\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\u003eOne theorem, which can actually easily be proven from \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\\\\forall p \\\\in \\\\mathbb{P}, p\u0026gt; 3 \\\\Rightarrow \\\\exists n \\\\in \\\\mathbb{N}^*, p = 6n \\\\pm 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, is that above the sole and unique triplet \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e(3, 5, 7)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -with a gap of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\Delta = 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e then-\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\u003eall the following progressions are such that \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mathbf{\\\\Delta = 6k}, k \\\\in \\\\mathbb{N}^*\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\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\u003eProblem statement\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\u003eFor a given interval \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2], i1 \u0026gt; 7 and i2 \u0026gt; 7\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e find \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e the first corresponding arithmetic progression (3 or more consecutive consecutive primes equally spaced) in this interval and check the conjecture equation simply by calculating the integer ratio \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\\\\mathbf{k = \\\\Delta / 6}\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [8, 68]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [47, 53, 59]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [1, 1]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, since this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e8\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 6 = \\\\mathbf{1} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here; \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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [180, 228]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [199, 211, 223]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [2, 2], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e180\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 12 = \\\\mathbf{2} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here;\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [240, 272]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [251, 257, 263, 269]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [1, 1, 1], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e140\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 6 = \\\\mathbf{1} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here; \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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[i1, i2] = [180, 272]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ep = [199, 211, 223]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek = [2, 2], \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003esince this is the first arithmetic progression above \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e180\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and with \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\\\\Delta = 12 = \\\\mathbf{2} \\\\times 6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e here;\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTip\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\u003eFirst maybe, train yourself to find the first and last indices of zeros of a first block of consecutive zeros in a vector of integers, eg for \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eu = [1 0 0 0 1 1 0 0 1], j1 = 2 and j2 = 4.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\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\u003eForbidden functions\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\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexp\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estr2num\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassignin\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:i/\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eecho\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\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/problems/60940-find-the-first-occurence-of-a-given-gap-between-two-consecutive-prime-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 60940. Find the first occurence of a given gap between two consecutive prime numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95630\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePrime numbers properties I\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":193,"title":"Smallest distance between a point and a rectangle","description":"Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another point *z* and every point within this rectangle.\r\n\r\nFor example, the two points\r\n\r\n     x = [-1,-1];\r\n     y = [1,1];\r\n\r\ndefine a square centered at the origin. The distance between the point\r\n\r\n   z = [4,5];\r\n\r\nand this square is\r\n\r\n   d = 5;\r\n\r\n(the closest point in the square is at [1,1])\r\n\r\nThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,1])\r\n\r\nThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\r\n\r\n\r\nNotes: \r\n\r\n* you can always assume that *x* \u003c *y* (element-wise) \r\n* The function should work for points x,y,z in an arbitrary n-dimensional space (with n\u003e1)\r\n\r\n\r\n\r\n ","description_html":"\u003cp\u003eGiven two points \u003cb\u003ex\u003c/b\u003e and \u003cb\u003ey\u003c/b\u003e placed at opposite corners of a rectangle, find the minimal euclidean distance between another point \u003cb\u003ez\u003c/b\u003e and every point within this rectangle.\u003c/p\u003e\u003cp\u003eFor example, the two points\u003c/p\u003e\u003cpre\u003e     x = [-1,-1];\r\n     y = [1,1];\u003c/pre\u003e\u003cp\u003edefine a square centered at the origin. The distance between the point\u003c/p\u003e\u003cpre\u003e   z = [4,5];\u003c/pre\u003e\u003cp\u003eand this square is\u003c/p\u003e\u003cpre\u003e   d = 5;\u003c/pre\u003e\u003cp\u003e(the closest point in the square is at [1,1])\u003c/p\u003e\u003cp\u003eThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,1])\u003c/p\u003e\u003cp\u003eThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\u003c/p\u003e\u003cp\u003eNotes:\u003c/p\u003e\u003cul\u003e\u003cli\u003eyou can always assume that \u003cb\u003ex\u003c/b\u003e \u0026lt; \u003cb\u003ey\u003c/b\u003e (element-wise)\u003c/li\u003e\u003cli\u003eThe function should work for points x,y,z in an arbitrary n-dimensional space (with n\u003e1)\u003c/li\u003e\u003c/ul\u003e","function_template":"function d = distanceRectangle2Point(x,y,z)\r\n  d = 0;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp','regexpi','regexprep','str2num'},'FileName','distanceRectangle2Point.m')\r\n%%\r\nx = [-1,-1];\r\ny = [1,1];\r\nz = [4,5];\r\nassert(isequal(distanceRectangle2Point(x,y,z),5))\r\nd_correct = 5;\r\n%%\r\nx = [-2,-1];\r\ny = [3,1];\r\nz = [1,2];\r\nassert(isequal(distanceRectangle2Point(x,y,z),1))\r\nd_correct = 1;\r\n%%\r\nx = [1,2];\r\ny = [3,4];\r\nz = [-5,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),6))\r\nd_correct = 6;\r\n%%\r\nx = [2,2];\r\ny = [4,4];\r\nz = [3,4];\r\nassert(isequal(distanceRectangle2Point(x,y,z),0))\r\nd_correct = 0;\r\n%%\r\nx = [-1,0,1];\r\ny = [0,2,4];\r\nz = [4,5,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),5))\r\nd_correct = 5;\r\n%%\r\nx = [1,0,1];\r\ny = [2,3,2];\r\nz = [-1,-2,3];\r\nassert(isequal(distanceRectangle2Point(x,y,z),3))\r\nd_correct = 3;\r\n\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":3,"created_by":43,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":280,"test_suite_updated_at":"2017-12-04T00:12:33.000Z","rescore_all_solutions":true,"group_id":17,"created_at":"2012-01-31T06:07:25.000Z","updated_at":"2026-03-31T15:32:49.000Z","published_at":"2012-01-31T08:50:23.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e placed at opposite corners of a rectangle, find the minimal euclidean distance between another point\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and every point within this rectangle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, the two points\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[     x = [-1,-1];\\n     y = [1,1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003edefine a square centered at the origin. The distance between the point\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[   z = [4,5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand this square is\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[   d = 5;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(the closest point in the square is at [1,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance between the point z = [0,2] and this same square is d = 1 (closest point at [0,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance between the point z = [0,0] and this same square is d = 0 (inside the square)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotes:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eyou can always assume that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (element-wise)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe function should work for points x,y,z in an arbitrary n-dimensional space (with n\u0026gt;1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":29,"title":"Nearest Numbers","description":"Given a row vector of numbers, find the indices of the two nearest numbers.\n\nExamples:\n\n [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\n\n index1 =\n      1\n index2 =\n      3\n\n [index1 index2] = nearestNumbers([-40 14 22 17])\n\n index1 =\n      2\n index2 =\n      4\n\nNotes\n\n# The indices should be returned in order such that index2 \u003e index1.\n# There will always be a unique solution.\n","description_html":"\u003cp\u003eGiven a row vector of numbers, find the indices of the two nearest numbers.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\u003c/pre\u003e\u003cpre\u003e index1 =\n      1\n index2 =\n      3\u003c/pre\u003e\u003cpre\u003e [index1 index2] = nearestNumbers([-40 14 22 17])\u003c/pre\u003e\u003cpre\u003e index1 =\n      2\n index2 =\n      4\u003c/pre\u003e\u003cp\u003eNotes\u003c/p\u003e\u003col\u003e\u003cli\u003eThe indices should be returned in order such that index2 \u003e index1.\u003c/li\u003e\u003cli\u003eThere will always be a unique solution.\u003c/li\u003e\u003c/ol\u003e","function_template":"function [index1 index2] = nearestNumbers(A)\nindex1 = 1;\nindex2 = 2;\nend","test_suite":"%%\nA = [30 46 16 -46 35 44 18 26 25 -10];\ncorrect = [8 9];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [1555 -3288 2061 -4681 -2230 -4538 -4028 3235 1949 -1829];\ncorrect = [3 9];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [-1 1 10 -10];\ncorrect = [1 2];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [0 1000 -2000 1001 0];\ncorrect = [1 5];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\nA = [1:1000 0.5];\ncorrect = [1 1001];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\n% Area codes\nA = [847 217 508 312 212];\ncorrect = [2 5];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))\n\n%%\n% Zip codes\nA = [60048 61802 01702 60601 10001];\ncorrect = [1 4];\n[i1 i2] = nearestNumbers(A);\nassert(isequal([i1 i2],correct))","published":true,"deleted":false,"likes_count":46,"comments_count":5,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5049,"test_suite_updated_at":"2012-01-18T01:00:21.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:21.000Z","updated_at":"2026-04-03T07:32:16.000Z","published_at":"2012-01-18T01:00:21.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a row vector of numbers, find the indices of the two nearest numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\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[ [index1 index2] = nearestNumbers([2 5 3 10 0 -3.1])\\n\\n index1 =\\n      1\\n index2 =\\n      3\\n\\n [index1 index2] = nearestNumbers([-40 14 22 17])\\n\\n index1 =\\n      2\\n index2 =\\n      4]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe indices should be returned in order such that index2 \u0026gt; index1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere will always be a unique solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1452,"title":"Minimum Distance between two N-sided Polygons","description":"This Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\r\n\r\n*Input:* polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\r\n\r\n*Output:* 0.5  \r\n\r\n\r\nRelated Challenges:\r\n\r\n1) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment Minimum Distance Point to Segment\u003e\r\n\r\n2) \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice USC Spring 2013 ACM Walking on Thin Ice\u003e","description_html":"\u003cp\u003eThis Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e 0.5\u003c/p\u003e\u003cp\u003eRelated Challenges:\u003c/p\u003e\u003cp\u003e1) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment\"\u003eMinimum Distance Point to Segment\u003c/a\u003e\u003c/p\u003e\u003cp\u003e2) \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\"\u003eUSC Spring 2013 ACM Walking on Thin Ice\u003c/a\u003e\u003c/p\u003e","function_template":"function pdistmin=PolytoPol(polycell)\r\n% Convert [x0 y0 x1 y1 ... xn yn] to nx2 array\r\n% Length of polycell{1} may vary from polycell{2}\r\n p1=reshape(polycell{1},2,[])';\r\n p2=reshape(polycell{2},2,[])';\r\n \r\n pdistmin=0;\r\nend","test_suite":"polycell={[0 0 5 10 10 0] [5 -1 6 -5 5 -5]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-1)\u003c.01);\r\n%%\r\npolycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-0.5)\u003c.01);\r\n%%\r\npolycell={[0 10 0 90 50 50 100 90 100 10] [0 110 100 110 50 70]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-15.617376)\u003c.01);\r\n%%\r\npolycell={[0 110 100 110 50 70] [20 5 50 7 30 5]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-63)\u003c.01);\r\n%%\r\npolycell={[-5 -5 -4 -4 -3 -3 -2 -2 5 5 5 0] [6 10 6 -10 20 0]};\r\np2p_min=PolytoPol(polycell);\r\nassert(abs(p2p_min-1)\u003c.01);\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-24T01:39:41.000Z","updated_at":"2026-02-16T10:57:04.000Z","published_at":"2013-04-24T02:03:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vectors that represent the sequential points of 3 to 100 sided polygons. [x0 y0 x1 y1 ... xn yn]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]};\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 0.5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRelated Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1446-minimum-distance-point-to-segment\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMinimum Distance Point to Segment\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1457-usc-spring-2013-acm-walking-on-thin-ice\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC Spring 2013 ACM Walking on Thin Ice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2242,"title":"Wayfinding 5 - Travel contour","description":"This is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See \r\n\u003chttp://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding search:tag=wayfinding\u003e for the other assignments.\r\n\r\nThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a |2xn| array |F|. The last node of |F| is connected to the first node.\r\n\r\n|a| is the index in |F| of the starting node, and |b| is the goal. \r\n\r\n\u003c\u003chttp://i61.tinypic.com/iq8p69.png\u003e\u003e\r\n\r\nCalculate the shortest distance from |a| to |b| over the contour of the polygon. \r\n\r\nThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.","description_html":"\u003cp\u003eThis is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See  \u003ca href = \"http://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding\"\u003esearch:tag=wayfinding\u003c/a\u003e for the other assignments.\u003c/p\u003e\u003cp\u003eThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a \u003ctt\u003e2xn\u003c/tt\u003e array \u003ctt\u003eF\u003c/tt\u003e. The last node of \u003ctt\u003eF\u003c/tt\u003e is connected to the first node.\u003c/p\u003e\u003cp\u003e\u003ctt\u003ea\u003c/tt\u003e is the index in \u003ctt\u003eF\u003c/tt\u003e of the starting node, and \u003ctt\u003eb\u003c/tt\u003e is the goal.\u003c/p\u003e\u003cimg src = \"http://i61.tinypic.com/iq8p69.png\"\u003e\u003cp\u003eCalculate the shortest distance from \u003ctt\u003ea\u003c/tt\u003e to \u003ctt\u003eb\u003c/tt\u003e over the contour of the polygon.\u003c/p\u003e\u003cp\u003eThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.\u003c/p\u003e","function_template":"function d = polygon_distance(F,a,b)\r\n  d = 0;\r\nend","test_suite":"%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 1;\r\nb = 3;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 2;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 1;\r\nb = 2;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 1;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 4;\r\nb = 1;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 1;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [0 0 1 1;0 1 1 0];\r\na = 3;\r\nb = 3;\r\nd = polygon_distance(F,a,b);\r\nd_correct = 0;\r\nassert(isequal(d,d_correct))\r\n\r\n%%\r\nF = [zeros(1,101) ones(1,101);0:100 100:-1:0];\r\na = 1;\r\nfor b = randi(size(F,2)/2,1,100)\r\n  d = polygon_distance(F,a,b);\r\n  d_correct = b-1;\r\n  assert(isequal(d,d_correct));\r\nend\r\n\r\n%%\r\nF = [zeros(1,101) ones(1,101);0:100 100:-1:0];\r\na = 1;\r\nfor b = randi(size(F,2)/2,1,100)+size(F,2)/2\r\n  s = rand(1)+1;\r\n  d = polygon_distance(F*s,a,b);\r\n  d_correct = (size(F,2)-b+1)*s;\r\n  assert(abs(d-d_correct)\u003c1e-10);\r\nend\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":6556,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2014-03-10T14:22:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-03-10T09:32:11.000Z","updated_at":"2014-03-10T14:22:52.000Z","published_at":"2014-03-10T13:43:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.nl/matlabcentral/cody/?term=tag%3Awayfinding\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esearch:tag=wayfinding\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for the other assignments.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2xn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e array\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The last node of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is connected to the first node.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the index in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of the starting node, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the goal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the shortest distance from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e over the contour of the polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEsASwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD31VG0cUbR/doX7op1AC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TdvH5JnMQ8xk/ulsZx7UAeGafd6tDofgTxKdd1GW8vdSFnOjz5iaISsmNv+6vJqOXxPPPf6Zrml32oL9q1pIfOudUDO8Z+9H9mA2qn3ea9wXQdHW3tbYaTYLBaSeZbx/Z12wtnO5BjCnPpUf/AAi+gee039iab5ryCZn+ypkuOjdOoz1oA8a8i303xV8R2j1S6ivYLR3tka5IaTdGzMcdW29vSn6RfPrWraLpviHW7yw0yPw+lzE63Zi86YkZYtn5iPm/75r2i50TSb24a5utMs553jMTSywKzMhHKkkZx7VFdeGdDvbW3tbrR7Ce3t+IY5LZWWMeijHFAHimj6rr2vr4Ctb3VtSgF3JdwyTRTlJJo1xgk9z1GT/Oup8Da3F4c1bxhp2razL/AGXpt7FFbTX85Ypv8wbdx/3R/OvSjpGmNJayHT7TzLQYtn8lcwg8fIcfL+FRtoWkM1w7aXZlrl1kmP2dcyspyrNxyQemaANOoZPvD6VNUE33/wAKAJV+6KdVVZ22rwP1p/nN7UAT0VB5ze1HnN7UAT0VD5h9BSpIW64oAloqEykdAKd5h9qAJKKh8w+gp28+goAkoqPzD7U7JoAdRTcmjJoAdRUfmH2p2TQA6iofMPoKd5h9qAJKKbk0ZNADqKbk0ZNADqKbk0ZNADqKbk0ZNADqKbk0ZNADqKj3n0FHmH2oAkoqHzD6CpMmgB1FNyab5h9qAJKKh8w+gp3mH2oAkqCb7/4U/efQU0uc9B+VAH//2Q==\"}]}"}],"term":"tag:\"distance\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"distance\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"distance\"","","\"","distance","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d9148c00\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d9148b60\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d9148020\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d9148f20\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d9148e80\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d9148d40\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d9148ca0\u003e":"tag:\"distance\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d9148ca0\u003e":"tag:\"distance\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"distance\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"distance\"","","\"","distance","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d9148c00\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d9148b60\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d9148020\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d9148f20\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d9148e80\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d9148d40\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d9148ca0\u003e":"tag:\"distance\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d9148ca0\u003e":"tag:\"distance\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":45536,"difficulty_rating":"easy"},{"id":264,"difficulty_rating":"easy"},{"id":48965,"difficulty_rating":"easy"},{"id":1693,"difficulty_rating":"easy"},{"id":47139,"difficulty_rating":"easy"},{"id":61268,"difficulty_rating":"easy"},{"id":44762,"difficulty_rating":"easy"},{"id":60939,"difficulty_rating":"easy-medium"},{"id":49337,"difficulty_rating":"easy-medium"},{"id":59711,"difficulty_rating":"easy-medium"},{"id":43007,"difficulty_rating":"easy-medium"},{"id":450,"difficulty_rating":"easy-medium"},{"id":2393,"difficulty_rating":"easy-medium"},{"id":2199,"difficulty_rating":"easy-medium"},{"id":44816,"difficulty_rating":"easy-medium"},{"id":2100,"difficulty_rating":"easy-medium"},{"id":60940,"difficulty_rating":"easy-medium"},{"id":490,"difficulty_rating":"easy-medium"},{"id":190,"difficulty_rating":"medium"},{"id":42319,"difficulty_rating":"medium"},{"id":44815,"difficulty_rating":"medium"},{"id":1446,"difficulty_rating":"medium"},{"id":43642,"difficulty_rating":"medium"},{"id":51,"difficulty_rating":"medium"},{"id":60953,"difficulty_rating":"medium"},{"id":193,"difficulty_rating":"medium"},{"id":29,"difficulty_rating":"medium"},{"id":1452,"difficulty_rating":"medium-hard"},{"id":2242,"difficulty_rating":"unrated"}]}}