{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-26T00:14:02.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-26T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":54775,"title":"Flip the parity of digits in a decimal expansion","description":"The number 349 has the decimal expansion . If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \r\nWrite a function that takes a number  and produces two arrays: a vector  with the even digits of 1 to  with flipped parity and a vector  with the odd digits of 1 to  with flipped parity. \r\nAt first these sequences did not seem interesting, but plotting them--using plot(a,1:n,b,1:n) with , say—convinced me that they are.","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: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72px; transform-origin: 407px 72px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.1px 8px; transform-origin: 138.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe number 349 has the decimal expansion \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVAAAAAmCAYAAACS5MOxAAALW0lEQVR4Xu2dSastRRLH9Qs4r0RcOCxEQRe2iuiiBQcURFBxXLhyRrCxWxx2TqigIDg1LbyFoqJuxHZcuFDEiaYFpRdq07S2K4dWP4DGTyoucfNVZkZmZdWt482C4L53TlYO/4z4Z2TkcPbdpz8dgY5AR6AjUIXAvlVv9Zc6Ah2BjkBHYJ9OoF0JOgIdgY5AJQKdQCuB6691BDoCHYFOoG114AjJ7iSRw0V+FHlR5Lu2RfTcVoTApVKXf4l8sqI69aq0Q+Bcyeq4lC13Am0HNsb0rMgbA4keKH9/ELlS5NV2xfScVoDAaVKHh0VOFDmv9+8KeqRtFY6X7P4m8qUIdn2NyH0i54u8a4vqBNoGeAxqj8jJIupxPib/vm4g0aPN521K7LnsFAIY01cij4gc2Ql0p7ph1nI/Gvr2IFMK9gyZMmj+Wz/vBNqmHwD3FZHQ0/xePsMT7V5KG5zXlMvrUpmze9+uqUua1EVnko9LbtebHJnO/13kXpE7SggUd/YUkf1F/ivyoWXgJlVeJhONTz5XUBye5alDetr+lshYTBNwx6bpm2xkeFrEcUvwKoB2tqQYQImO2rg1lSIE44lpbmLfakyPdqb0ebbOaZTxnLaMvl8icq3Ik6a+lMmUHtmaaaY8UIjzJRGmKeFzq3zwQCMw5s6Ght8iwnT6eREMLPegaEzRiGHePCS+Uf6eJXJbAGwqLzWyQyTRJi0m/UXqe38BXjk8l/iefr170NcT5G+OBA+WNHcNeoGxfCZymAiziTdFiHml8tgkAkWfnxbBq3pNZD+Rm0TwoLHlpzZEP5ew5S8GHRqbNf4yKDKc+Ns0PkagkOfbIozkEMlPIseK/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M0+YdW23fyQXhxWy5lkB1Cl8bdE6BOweJekYtlELrlfJOPGfhc8pb830rAvWU3SIGmurHOUjUS6CtzsJ7cKxJs5QHam2w1hHIbVWag0RXZctjBAoox4h8IzK29UZHLkgmvO7NozAeUFuTqBf0ktuYapXOg9FYmk0iUE//tSZRL4GCrfc2pqW9T+q2BIHa/qmNU+bIU3XYY+8lNrEqWx4jULuCFV62ai8EIJZVurexBEyPEXqA97rzmpeWO3YfqGLTOkbracemEGhJv7UkUe/UHKyt8Ycr7LpSP9cqcq6v5yZQO8va60fScpUbvveSZ2sSXZ0tjxGoHckBAEXiYmUetj6w8brm53pLyDMkM/5fQ1oYAzfIa0Cbtux1mmBEaXSbj71Qmhvpyac2bOHUzWiyTSDQEvLUhk4lUYyKzfnol+5nJIbNfZ+pAZ73nhFhT3N4Iz0neGochKl9zPtzEaj+ygK7K7AlbqEvdYCoXyl5KiY19m/xXKUtp26kt6ctWED4n8iUyzDUuEqnDFPe4xRB7Mlt90FROAvL70LztDxtUmNoSxKobrUpXThSMmRHxdYPbzkaW/tebkHMs93Hbu8h/fsT9dzR3GSSlgSqx7AZDNiutEek5PeiYhWFDNGR0luVat/Lbf3aMVuuXUSqVRIUvmbUq32vtp5rfG+JG+lbtLu2r2rfa1HnNeXR8kZ6MOWpsbkcJrX9Vfterj478v3SBLojjeyFdgQ6Ah2BORDoBDoHqj3PjkBHYFcg0Al0V3Rzb2RHoCMwBwKdQOdAtefZEegI7AoEOoHuim7ujewIdATmQKAT6Byo9jw7Ah2BXYFAJ9Bd0c29kR2BjsAcCHQCnQPVnmdHoCOwKxD4FSfuAGPcgh0eAAAAAElFTkSuQmCC\" alt=\"3*100+4*10+9*1\" style=\"width: 168px; height: 19px;\" width=\"168\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 141.958px 8px; transform-origin: 141.958px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 114.217px 8px; transform-origin: 114.217px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes a number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 109.292px 8px; transform-origin: 109.292px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and produces two arrays: a vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ea\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 84.7833px 8px; transform-origin: 84.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the even digits of 1 to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 57.9583px 8px; transform-origin: 57.9583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with flipped parity and a vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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.2833px 8px; transform-origin: 81.2833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the odd digits of 1 to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 59.3833px 8px; transform-origin: 59.3833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with flipped parity. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 229.875px 8px; transform-origin: 229.875px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAt first these sequences did not seem interesting, but plotting them--using \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: 65.45px 8px; transform-origin: 65.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eplot(a,1:n,b,1:n)\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 16.3333px 8px; transform-origin: 16.3333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG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FpNkZRFdZU2cf9u7piYbNHmgi+9NtECdTdFUPwG3AN7D9JNONpq0QePSGMGhxCq421OZkyQ2ra2Bg8QWoW8SU5dc+uDC+MBU7SIwcVQ3UFIXIkpdjswl9z2CX9+oiyY3DJPWGBOh09ZUcNLvKWwqZk0kgV/WuLtZ+DH/AFB3KBWXzbipv9CRhF1A3SfT7AaLiaDJymVV1ZUvrYKf/u4DpbGhi11eMgYPorlyHS9zh1O65pUALzxZ+s3eJuZSd/tasjhvY6ABJ8JAiRYinAgLLRrIcCIMlGghwomw0KKBDCfCQIkWIpwICy0ayHAiDJRoIcKJsNCigYy/S5j2J0egNlMAAAAASUVORK5CYII=\" alt=\"n = 10^4\" style=\"width: 49px; height: 19px;\" width=\"49\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.775px 8px; transform-origin: 21.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, say—convinced me that they are.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [a,b] = flipDigParity(n)\r\n x = 1:n;\r\n a = x; a(2:2:end) = -a(2:2:end);\r\n b = x; b(1:2:end) = -b(1:2:end);\r\nend","test_suite":"%%\r\nn = 10;\r\na = flipDigParity(n);\r\na_correct = [1 -2 3 -4 5 -6 7 -8 9 10];\r\nassert(isequal(a,a_correct))\r\n\r\n%%\r\nn = 40;\r\n[~,b] = flipDigParity(n);\r\nb11_40 = [-11 -8 -13 -6 -15 -4 -17 -2 -19 20 19 22 17 24 15 26 13 28 11 -30 -31 -28 -33 -26 -35 -24 -37 -22 -39 40];\r\nassert(isequal(b(11:40),b11_40))\r\n\r\n%%\r\nn = 1000;\r\n[a,b] = flipDigParity(n);\r\ny1 = trapz(a);\r\ny1_correct = 55999.5;\r\ny2 = std(b);\r\ny2_correct = 535.282895;\r\nassert(isequal(y1,y1_correct) \u0026\u0026 abs(y2-y2_correct)\u003c1e-6)\r\n\r\n%%\r\nn = 3e5;\r\n[a,b] = flipDigParity(n);\r\na1 = a([123456 145623 234567 273456]);\r\na1_correct = [82644  64383 -173553 -127356];\r\nb1 = b([189432 194328 234891 289431]);\r\nb1_correct = [-28628 -186272 174709 271369];\r\n\r\n%%\r\nn = 4e7;\r\n[a,b] = flipDigParity(n);\r\nc = cumsum(a);\r\ny1 = c([(1:4)*1e7]);\r\ny1_correct = [0.05555565 1.1111109 -0.83333305 2.2222218]*1e14;\r\ny2 = std(b);\r\ny2_correct = 18802537.42144525;\r\nassert(all(abs(y1-y1_correct)\u003c0.1) \u0026\u0026 abs(y2-y2_correct)\u003c1e-6)\r\n\r\n%%\r\na1 = flipDigParity(3456);\r\n[~,b1] = flipDigParity(a1(3221));\r\na2 = flipDigParity(b1(2732));\r\n[~,b2] = flipDigParity(a2(1253));\r\nb2_781_correct = -621;\r\nassert(isequal(b2(781),b2_781_correct))\r\n\r\n%%\r\nfiletext = fileread('flipDigParity.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext,'switch') || contains(filetext,'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-07-06T14:29:49.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-06T05:15:25.000Z","updated_at":"2026-02-02T17:09:39.000Z","published_at":"2022-07-06T05:31:43.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 349 has the decimal expansion \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"3*100+4*10+9*1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3\\\\times 10^2 + 4\\\\times 10^1 + 9\\\\times 10^0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that takes a 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and produces two arrays: a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"a\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with the even digits of 1 to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with flipped parity and a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"b\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with the odd digits of 1 to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with flipped parity. \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\u003eAt first these sequences did not seem interesting, but plotting them--using \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\u003eplot(a,1:n,b,1:n)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n = 10^4\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 10^4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, say—convinced me that they are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":54775,"title":"Flip the parity of digits in a decimal expansion","description":"The number 349 has the decimal expansion . If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \r\nWrite a function that takes a number  and produces two arrays: a vector  with the even digits of 1 to  with flipped parity and a vector  with the odd digits of 1 to  with flipped parity. \r\nAt first these sequences did not seem interesting, but plotting them--using plot(a,1:n,b,1:n) with , say—convinced me that they are.","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: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72px; transform-origin: 407px 72px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.1px 8px; transform-origin: 138.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe number 349 has the decimal expansion \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVAAAAAmCAYAAACS5MOxAAALW0lEQVR4Xu2dSastRRLH9Qs4r0RcOCxEQRe2iuiiBQcURFBxXLhyRrCxWxx2TqigIDg1LbyFoqJuxHZcuFDEiaYFpRdq07S2K4dWP4DGTyoucfNVZkZmZdWt482C4L53TlYO/4z4Z2TkcPbdpz8dgY5AR6AjUIXAvlVv9Zc6Ah2BjkBHYJ9OoF0JOgIdgY5AJQKdQCuB6691BDoCHYFOoG114AjJ7iSRw0V+FHlR5Lu2RfTcVoTApVKXf4l8sqI69aq0Q+Bcyeq4lC13Am0HNsb0rMgbA4keKH9/ELlS5NV2xfScVoDAaVKHh0VOFDmv9+8KeqRtFY6X7P4m8qUIdn2NyH0i54u8a4v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93Hbu8h/fsT9dzR3GSSlgSqx7AZDNiutEek5PeiYhWFDNGR0luVat/Lbf3aMVuuXUSqVRIUvmbUq32vtp5rfG+JG+lbtLu2r2rfa1HnNeXR8kZ6MOWpsbkcJrX9Vfterj478v3SBLojjeyFdgQ6Ah2BORDoBDoHqj3PjkBHYFcg0Al0V3Rzb2RHoCMwBwKdQOdAtefZEegI7AoEOoHuim7ujewIdATmQKAT6Byo9jw7Ah2BXYFAJ9Bd0c29kR2BjsAcCHQCnQPVnmdHoCOwKxD4FSfuAGPcgh0eAAAAAElFTkSuQmCC\" alt=\"3*100+4*10+9*1\" style=\"width: 168px; height: 19px;\" width=\"168\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 141.958px 8px; transform-origin: 141.958px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 114.217px 8px; transform-origin: 114.217px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes a number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 109.292px 8px; transform-origin: 109.292px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and produces two arrays: a vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ea\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 84.7833px 8px; transform-origin: 84.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the even digits of 1 to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 57.9583px 8px; transform-origin: 57.9583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with flipped parity and a vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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.2833px 8px; transform-origin: 81.2833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the odd digits of 1 to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 59.3833px 8px; transform-origin: 59.3833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with flipped parity. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 229.875px 8px; transform-origin: 229.875px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAt first these sequences did not seem interesting, but plotting them--using \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: 65.45px 8px; transform-origin: 65.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eplot(a,1:n,b,1:n)\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 16.3333px 8px; transform-origin: 16.3333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAAAmCAYAAAA/bE50AAAECklEQVRoQ+1ZOasVMRR+7w8oLp0g4lIpaOECooWFKFqJggoWr3LrLFxQQQQVF+Q14lIIFq6gpeJSKoJLoaBYuBTWLj9Bv09zHufmZTKZuYe598EJfMy9meQkOV/OkszoiJeh0MDoUMzCJzHiRAzJJnAinIgh0UC301iD4RYD1+Jh3SK6I2IWhvoMfAVWOBHdKT4e6TIq9gFvnYjBkUCXNA4sdyLSJFBBLC8KOaJ7WQUsCe0/4Pmopi/7vAK2Au+ciF5tkYDjwAZgLzApeCaUewh1R4C7wG1gGnAytDuRIYT9pgPHgD9OxH+NzQfoq0mAlBIixL9fQaf9qq8E4Bmo25wgYynqHgALQx8nIpCwHs9nAJ9Xg3LqiNiEdg9D29l4/lRE8OcO4A7AbIhuS79/g//aWpyISHl0Tc8LifiCdguAJ8DGSA7/0ip+hPozeNIFsdAlzQO0BTkRLYnQ1nAYMs4niGAVdz4zIloF3RBd4FMgthAnoiUREhvYPRUDRKxutwyVjEG7AVqTLqz/DbwGvmlrqTtZM9jMCZIkTaMp0sfOBUrSt4pNNNDqUtf0OCiVk6WC31fMmm7oXHjHmPMRWJ1oyzYk4izwHWAG9q+kiNiD+i1qAmy3M3Siqd4EmCVIye2UeC402W0Vi2lS/RKNS3P/lNxSIuhKpJQSEWdWevxWrkn8HhlcBNAKTgFjAHNoySR0gKpTplZAXdvc+7pMp052GyIYsOlOUoWbV7Kwe/jNTCpVWhEh2QIFXwJuABJ89ELWor50d1pZBDOYKjdRRwLfNyWCm3FmRrCWlyOCLqzHJYnMqhhBhTEDYOHuOwiMKYWLTxRriXPrEmUMsk0bIpgVVVmEnCW4phwRlWuuIkILJiEXAH0NwCCzve2gg2QgjF1KxC+0l3hoESMaEyGKZsfUQUaCWL++elCclBLRNmsqubvqWXuVRchOoOtZB2h/rBeRC2ApJVvFiK6yptNYxNGwkFwsLG3XyCK0olOpmAwqp8gmu3qqZU36ZJ2zfrGc1jEzZRGa3ZRflLRW0lbu8qogFpNkZRFdZU2cf9u7piYbNHmgi+9NtECdTdFUPwG3AN7D9JNONpq0QePSGMGhxCq421OZkyQ2ra2Bg8QWoW8SU5dc+uDC+MBU7SIwcVQ3UFIXIkpdjswl9z2CX9+oiyY3DJPWGBOh09ZUcNLvKWwqZk0kgV/WuLtZ+DH/AFB3KBWXzbipv9CRhF1A3SfT7AaLiaDJymVV1ZUvrYKf/u4DpbGhi11eMgYPorlyHS9zh1O65pUALzxZ+s3eJuZSd/tasjhvY6ABJ8JAiRYinAgLLRrIcCIMlGghwomw0KKBDCfCQIkWIpwICy0ayHAiDJRoIcKJsNCigYy/S5j2J0egNlMAAAAASUVORK5CYII=\" alt=\"n = 10^4\" style=\"width: 49px; height: 19px;\" width=\"49\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 21.775px 8px; transform-origin: 21.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, say—convinced me that they are.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [a,b] = flipDigParity(n)\r\n x = 1:n;\r\n a = x; a(2:2:end) = -a(2:2:end);\r\n b = x; b(1:2:end) = -b(1:2:end);\r\nend","test_suite":"%%\r\nn = 10;\r\na = flipDigParity(n);\r\na_correct = [1 -2 3 -4 5 -6 7 -8 9 10];\r\nassert(isequal(a,a_correct))\r\n\r\n%%\r\nn = 40;\r\n[~,b] = flipDigParity(n);\r\nb11_40 = [-11 -8 -13 -6 -15 -4 -17 -2 -19 20 19 22 17 24 15 26 13 28 11 -30 -31 -28 -33 -26 -35 -24 -37 -22 -39 40];\r\nassert(isequal(b(11:40),b11_40))\r\n\r\n%%\r\nn = 1000;\r\n[a,b] = flipDigParity(n);\r\ny1 = trapz(a);\r\ny1_correct = 55999.5;\r\ny2 = std(b);\r\ny2_correct = 535.282895;\r\nassert(isequal(y1,y1_correct) \u0026\u0026 abs(y2-y2_correct)\u003c1e-6)\r\n\r\n%%\r\nn = 3e5;\r\n[a,b] = flipDigParity(n);\r\na1 = a([123456 145623 234567 273456]);\r\na1_correct = [82644  64383 -173553 -127356];\r\nb1 = b([189432 194328 234891 289431]);\r\nb1_correct = [-28628 -186272 174709 271369];\r\n\r\n%%\r\nn = 4e7;\r\n[a,b] = flipDigParity(n);\r\nc = cumsum(a);\r\ny1 = c([(1:4)*1e7]);\r\ny1_correct = [0.05555565 1.1111109 -0.83333305 2.2222218]*1e14;\r\ny2 = std(b);\r\ny2_correct = 18802537.42144525;\r\nassert(all(abs(y1-y1_correct)\u003c0.1) \u0026\u0026 abs(y2-y2_correct)\u003c1e-6)\r\n\r\n%%\r\na1 = flipDigParity(3456);\r\n[~,b1] = flipDigParity(a1(3221));\r\na2 = flipDigParity(b1(2732));\r\n[~,b2] = flipDigParity(a2(1253));\r\nb2_781_correct = -621;\r\nassert(isequal(b2(781),b2_781_correct))\r\n\r\n%%\r\nfiletext = fileread('flipDigParity.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext,'switch') || contains(filetext,'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-07-06T14:29:49.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-06T05:15:25.000Z","updated_at":"2026-02-02T17:09:39.000Z","published_at":"2022-07-06T05:31:43.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe number 349 has the decimal expansion \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"3*100+4*10+9*1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3\\\\times 10^2 + 4\\\\times 10^1 + 9\\\\times 10^0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. If we change the even digits from positive to negative, then the number becomes 269 (i.e., 300-40+9). A similar operation could be applied to the odd digits. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that takes a 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and produces two arrays: a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"a\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with the even digits of 1 to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with flipped parity and a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"b\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with the odd digits of 1 to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e with flipped parity. \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\u003eAt first these sequences did not seem interesting, but plotting them--using \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\u003eplot(a,1:n,b,1:n)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n = 10^4\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 10^4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, say—convinced me that they are.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"interesting plot\"","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:\"interesting plot\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"interesting plot\"","","\"","interesting plot","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f5056073200\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f5056073160\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f50560728a0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f5056073480\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f50560733e0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f5056073340\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f50560732a0\u003e":"tag:\"interesting plot\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f50560732a0\u003e":"tag:\"interesting plot\""},"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":"cody-search","password":"78X075ddcV44","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:\"interesting plot\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"interesting plot\"","","\"","interesting plot","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f5056073200\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f5056073160\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f50560728a0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f5056073480\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f50560733e0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f5056073340\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f50560732a0\u003e":"tag:\"interesting plot\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f50560732a0\u003e":"tag:\"interesting plot\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":54775,"difficulty_rating":"medium"}]}}