{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-16T00:12:35.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-16T00: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":2738,"title":"Sideways sum","description":"Given natural number calculate its _population count_.","description_html":"\u003cp\u003eGiven natural number calculate its \u003ci\u003epopulation count\u003c/i\u003e.\u003c/p\u003e","function_template":"function population = popcount(n)\r\n  binary = dec2bin(n);\r\n  population = ???\r\nend","test_suite":"%%\r\nN = 1; \r\nnum_ones = 1;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 2; \r\nnum_ones = 1;\r\nassert(isequal(popcount(N),num_ones))\r\n%%\r\nN = 3; \r\nnum_ones = 2;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nfor num_ones = 3:10\r\n  N = 2^num_ones-1;\r\n  assert(isequal(popcount(N),num_ones))\r\nend\r\n\r\n%%\r\n\r\nfor num_ones = 1:50\r\n  N = sum(2.^(find(randperm(50)\u003c=num_ones)-1));\r\n  assert(isequal(popcount(N),num_ones))\r\nend\r\n\r\n%%\r\nN = 23; \r\nnum_ones = 4;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 123; \r\nnum_ones = 6;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 123456; \r\nnum_ones = 6;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 1234567; \r\nnum_ones = 11;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 1125899906842501;\r\nnum_ones = 45;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2015-01-19T23:10:17.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-12-08T11:59:42.000Z","updated_at":"2026-03-09T20:12:46.000Z","published_at":"2015-01-19T11:07:48.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 natural number calculate 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epopulation count\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\"}]}"},{"id":2733,"title":"Evil Number","description":"Check if a given natural number is evil or not. \r\n\r\nRead more at \u003chttps://oeis.org/A001969 OEIS\u003e.","description_html":"\u003cp\u003eCheck if a given natural number is evil or not.\u003c/p\u003e\u003cp\u003eRead more at \u003ca href = \"https://oeis.org/A001969\"\u003eOEIS\u003c/a\u003e.\u003c/p\u003e","function_template":"function tf = isevil(n)\r\n  tf = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(isevil(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = true;\r\nassert(isequal(isevil(x),y_correct))\r\n%%\r\nx = [18, 20, 23, 24, 27, 45, 46, 48, 96, 99, 123,];\r\ny_correct = true;\r\nassert(isequal(all(arrayfun(@isevil,x)),y_correct))\r\n%%\r\nx = [14, 16, 19, 37, 38, 55, 56, 59, 62,  79, 82, 91, 93, 94, 97, 98, 117, 118, 121];\r\ny_correct = false;\r\nassert(isequal(any(arrayfun(@isevil,x)),y_correct))\r\n%%\r\nx = 2^randi([5 10])+1;\r\ny_correct = true;\r\nassert(isequal(isevil(x),y_correct))\r\n\r\n%%\r\n% more test cases may be introduced\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\n% disable:\r\nassert(false) \r\n%\r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('isevil.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":274,"test_suite_updated_at":"2016-12-26T10:21:47.000Z","rescore_all_solutions":true,"group_id":8,"created_at":"2014-12-07T21:50:01.000Z","updated_at":"2026-03-11T15:15:47.000Z","published_at":"2015-01-19T12:47:58.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\u003eCheck if a given natural number is evil or not.\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\u003eRead more at\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://oeis.org/A001969\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEIS\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"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":2734,"title":"N-th Odious","description":"Given index n return n-th \u003chttps://oeis.org/A000069 odious number\u003e.","description_html":"\u003cp\u003eGiven index n return n-th \u003ca href = \"https://oeis.org/A000069\"\u003eodious number\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = nthodious(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 2;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 4;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 9;\r\ny_correct = 16;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 17;\r\ny_correct = 32;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 33;\r\ny_correct = 64;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 65;\r\ny_correct = 128;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 3387;\r\ny_correct = 6772;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 22;\r\ny_correct = 42;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 1e5;\r\ny_correct = 2e5-1;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\n% more test cases may be introduced\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\nassert(false)\r\n% \r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('nthodious.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":182,"test_suite_updated_at":"2015-01-19T23:07:07.000Z","rescore_all_solutions":true,"group_id":8,"created_at":"2014-12-07T21:50:54.000Z","updated_at":"2026-02-16T10:22:49.000Z","published_at":"2015-01-19T13:39:11.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 index n return n-th\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://oeis.org/A000069\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eodious number\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"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":2848,"title":"Digital Neighbourhood","description":"Given a natural number reorder its digits to create another number, closest to the given one.\r\n\r\nExamples:\r\n\r\n* 123 gives 132,\r\n* 1 gives 10,\r\n* 1099 gives 991 ","description_html":"\u003cp\u003eGiven a natural number reorder its digits to create another number, closest to the given one.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cul\u003e\u003cli\u003e123 gives 132,\u003c/li\u003e\u003cli\u003e1 gives 10,\u003c/li\u003e\u003cli\u003e1099 gives 991\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = find_neighbour(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 132;\r\ny_correct = 123;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 182;\r\ny_correct = 218;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 172;\r\ny_correct = [127; 217];\r\n% there are two such numbers, one of them is enough, but you can return both\r\ny = sort(find_neighbour(x));\r\nfprintf('%d founded.\\n',y)\r\ny = y(:);\r\nassert(any(y_correct==y))\r\n%%\r\nx = 1;\r\ny_correct = 10;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 10;\r\ny_correct = 1;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 10;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 99;\r\ny_correct = 909;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 199;\r\ny_correct = 919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 1099;\r\ny_correct = 991;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 123455;\r\ny_correct = 123545;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 56565656;\r\ny_correct = 56565665;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 8761199;\r\ny_correct = 8761919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 820199;\r\ny_correct = 819920;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 991;\r\ny_correct = 919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 911;\r\ny_correct = 1019;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 7001;\r\ny_correct = 7010;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 1192999;\r\ny_correct = 1199299;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 8713222;\r\ny_correct = 8712322;\r\nassert(isequal(find_neighbour(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":"2015-01-19T23:07:40.000Z","rescore_all_solutions":false,"group_id":45,"created_at":"2015-01-19T12:06:43.000Z","updated_at":"2026-04-10T21:21:57.000Z","published_at":"2015-01-19T12:07:58.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 natural number reorder its digits to create another number, closest to the given one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e123 gives 132,\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\u003e1 gives 10,\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\u003e1099 gives 991\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":2735,"title":"Binary Neighbourhood","description":"Given a natural number reorder its binary form to create another number, closest to the given one.\r\n\r\nExamples:\r\n\r\n* 1 gives 2, ( 1(dec) \u003e 1 \u003e 01 \u003e 10 \u003e 2(dec) )\r\n* 2 gives 1, ( 2(dec) \u003e 10 \u003e 01 \u003e 1(dec) )\r\n* 5 gives 6, ( 5(dec) \u003e 101 \u003e 110 \u003e 6(dec) )","description_html":"\u003cp\u003eGiven a natural number reorder its binary form to create another number, closest to the given one.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1 gives 2, ( 1(dec) \u0026gt; 1 \u0026gt; 01 \u0026gt; 10 \u0026gt; 2(dec) )\u003c/li\u003e\u003cli\u003e2 gives 1, ( 2(dec) \u0026gt; 10 \u0026gt; 01 \u0026gt; 1(dec) )\u003c/li\u003e\u003cli\u003e5 gives 6, ( 5(dec) \u0026gt; 101 \u0026gt; 110 \u0026gt; 6(dec) )\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = binary_neighbour(x)\r\n  bin = dec2bin(x);\r\n  y = bin2dec(bin);\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 2;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 1;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 5;\r\ny_correct = 6;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 5;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 2;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 16;\r\ny_correct = 8;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 17;\r\ny_correct = 18;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 11;\r\ny_correct = 13;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 23;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 92;\r\ny_correct = 90;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\n% \r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('binary_neighbour_disabled.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":100,"test_suite_updated_at":"2015-01-19T22:59:13.000Z","rescore_all_solutions":false,"group_id":45,"created_at":"2014-12-07T21:51:56.000Z","updated_at":"2026-04-10T20:40:52.000Z","published_at":"2015-01-19T12:34: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\u003eGiven a natural number reorder its binary form to create another number, closest to the given one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1 gives 2, ( 1(dec) \u0026gt; 1 \u0026gt; 01 \u0026gt; 10 \u0026gt; 2(dec) )\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\u003e2 gives 1, ( 2(dec) \u0026gt; 10 \u0026gt; 01 \u0026gt; 1(dec) )\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\u003e5 gives 6, ( 5(dec) \u0026gt; 101 \u0026gt; 110 \u0026gt; 6(dec) )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":2738,"title":"Sideways sum","description":"Given natural number calculate its _population count_.","description_html":"\u003cp\u003eGiven natural number calculate its \u003ci\u003epopulation count\u003c/i\u003e.\u003c/p\u003e","function_template":"function population = popcount(n)\r\n  binary = dec2bin(n);\r\n  population = ???\r\nend","test_suite":"%%\r\nN = 1; \r\nnum_ones = 1;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 2; \r\nnum_ones = 1;\r\nassert(isequal(popcount(N),num_ones))\r\n%%\r\nN = 3; \r\nnum_ones = 2;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nfor num_ones = 3:10\r\n  N = 2^num_ones-1;\r\n  assert(isequal(popcount(N),num_ones))\r\nend\r\n\r\n%%\r\n\r\nfor num_ones = 1:50\r\n  N = sum(2.^(find(randperm(50)\u003c=num_ones)-1));\r\n  assert(isequal(popcount(N),num_ones))\r\nend\r\n\r\n%%\r\nN = 23; \r\nnum_ones = 4;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 123; \r\nnum_ones = 6;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 123456; \r\nnum_ones = 6;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 1234567; \r\nnum_ones = 11;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n%%\r\nN = 1125899906842501;\r\nnum_ones = 45;\r\nassert(isequal(popcount(N),num_ones))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2015-01-19T23:10:17.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-12-08T11:59:42.000Z","updated_at":"2026-03-09T20:12:46.000Z","published_at":"2015-01-19T11:07:48.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 natural number calculate 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epopulation count\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\"}]}"},{"id":2733,"title":"Evil Number","description":"Check if a given natural number is evil or not. \r\n\r\nRead more at \u003chttps://oeis.org/A001969 OEIS\u003e.","description_html":"\u003cp\u003eCheck if a given natural number is evil or not.\u003c/p\u003e\u003cp\u003eRead more at \u003ca href = \"https://oeis.org/A001969\"\u003eOEIS\u003c/a\u003e.\u003c/p\u003e","function_template":"function tf = isevil(n)\r\n  tf = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(isevil(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = true;\r\nassert(isequal(isevil(x),y_correct))\r\n%%\r\nx = [18, 20, 23, 24, 27, 45, 46, 48, 96, 99, 123,];\r\ny_correct = true;\r\nassert(isequal(all(arrayfun(@isevil,x)),y_correct))\r\n%%\r\nx = [14, 16, 19, 37, 38, 55, 56, 59, 62,  79, 82, 91, 93, 94, 97, 98, 117, 118, 121];\r\ny_correct = false;\r\nassert(isequal(any(arrayfun(@isevil,x)),y_correct))\r\n%%\r\nx = 2^randi([5 10])+1;\r\ny_correct = true;\r\nassert(isequal(isevil(x),y_correct))\r\n\r\n%%\r\n% more test cases may be introduced\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\n% disable:\r\nassert(false) \r\n%\r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('isevil.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":274,"test_suite_updated_at":"2016-12-26T10:21:47.000Z","rescore_all_solutions":true,"group_id":8,"created_at":"2014-12-07T21:50:01.000Z","updated_at":"2026-03-11T15:15:47.000Z","published_at":"2015-01-19T12:47:58.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\u003eCheck if a given natural number is evil or not.\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\u003eRead more at\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://oeis.org/A001969\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEIS\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"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":2734,"title":"N-th Odious","description":"Given index n return n-th \u003chttps://oeis.org/A000069 odious number\u003e.","description_html":"\u003cp\u003eGiven index n return n-th \u003ca href = \"https://oeis.org/A000069\"\u003eodious number\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = nthodious(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 2;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 4;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 9;\r\ny_correct = 16;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 17;\r\ny_correct = 32;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 33;\r\ny_correct = 64;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 65;\r\ny_correct = 128;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 3387;\r\ny_correct = 6772;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 22;\r\ny_correct = 42;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\nx = 1e5;\r\ny_correct = 2e5-1;\r\nassert(isequal(nthodious(x),y_correct))\r\n%%\r\n% more test cases may be introduced\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\nassert(false)\r\n% \r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('nthodious.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":182,"test_suite_updated_at":"2015-01-19T23:07:07.000Z","rescore_all_solutions":true,"group_id":8,"created_at":"2014-12-07T21:50:54.000Z","updated_at":"2026-02-16T10:22:49.000Z","published_at":"2015-01-19T13:39:11.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 index n return n-th\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://oeis.org/A000069\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eodious number\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"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":2848,"title":"Digital Neighbourhood","description":"Given a natural number reorder its digits to create another number, closest to the given one.\r\n\r\nExamples:\r\n\r\n* 123 gives 132,\r\n* 1 gives 10,\r\n* 1099 gives 991 ","description_html":"\u003cp\u003eGiven a natural number reorder its digits to create another number, closest to the given one.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cul\u003e\u003cli\u003e123 gives 132,\u003c/li\u003e\u003cli\u003e1 gives 10,\u003c/li\u003e\u003cli\u003e1099 gives 991\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = find_neighbour(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 132;\r\ny_correct = 123;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 182;\r\ny_correct = 218;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 172;\r\ny_correct = [127; 217];\r\n% there are two such numbers, one of them is enough, but you can return both\r\ny = sort(find_neighbour(x));\r\nfprintf('%d founded.\\n',y)\r\ny = y(:);\r\nassert(any(y_correct==y))\r\n%%\r\nx = 1;\r\ny_correct = 10;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 10;\r\ny_correct = 1;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 10;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 99;\r\ny_correct = 909;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 199;\r\ny_correct = 919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 1099;\r\ny_correct = 991;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 123455;\r\ny_correct = 123545;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 56565656;\r\ny_correct = 56565665;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 8761199;\r\ny_correct = 8761919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 820199;\r\ny_correct = 819920;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 991;\r\ny_correct = 919;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 911;\r\ny_correct = 1019;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 7001;\r\ny_correct = 7010;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 1192999;\r\ny_correct = 1199299;\r\nassert(isequal(find_neighbour(x),y_correct))\r\n%%\r\nx = 8713222;\r\ny_correct = 8712322;\r\nassert(isequal(find_neighbour(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":"2015-01-19T23:07:40.000Z","rescore_all_solutions":false,"group_id":45,"created_at":"2015-01-19T12:06:43.000Z","updated_at":"2026-04-10T21:21:57.000Z","published_at":"2015-01-19T12:07:58.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 natural number reorder its digits to create another number, closest to the given one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e123 gives 132,\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\u003e1 gives 10,\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\u003e1099 gives 991\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":2735,"title":"Binary Neighbourhood","description":"Given a natural number reorder its binary form to create another number, closest to the given one.\r\n\r\nExamples:\r\n\r\n* 1 gives 2, ( 1(dec) \u003e 1 \u003e 01 \u003e 10 \u003e 2(dec) )\r\n* 2 gives 1, ( 2(dec) \u003e 10 \u003e 01 \u003e 1(dec) )\r\n* 5 gives 6, ( 5(dec) \u003e 101 \u003e 110 \u003e 6(dec) )","description_html":"\u003cp\u003eGiven a natural number reorder its binary form to create another number, closest to the given one.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1 gives 2, ( 1(dec) \u0026gt; 1 \u0026gt; 01 \u0026gt; 10 \u0026gt; 2(dec) )\u003c/li\u003e\u003cli\u003e2 gives 1, ( 2(dec) \u0026gt; 10 \u0026gt; 01 \u0026gt; 1(dec) )\u003c/li\u003e\u003cli\u003e5 gives 6, ( 5(dec) \u0026gt; 101 \u0026gt; 110 \u0026gt; 6(dec) )\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = binary_neighbour(x)\r\n  bin = dec2bin(x);\r\n  y = bin2dec(bin);\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 2;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 1;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 5;\r\ny_correct = 6;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 5;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 2;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 16;\r\ny_correct = 8;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 17;\r\ny_correct = 18;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 11;\r\ny_correct = 13;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 23;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\nx = 92;\r\ny_correct = 90;\r\nassert(isequal(binary_neighbour(x),y_correct))\r\n%%\r\n% DISABLED\r\n% ________'FAIR'_SCORING_SYSTEM______________\r\n%\r\n% This section scores for usage of ans\r\n% and strings, which are common methods \r\n% to reduce cody size of solution.\r\n% Here, strings are threated like vectors.\r\n% Please do not hack it, as this problem\r\n% is not mentioned to be a hacking problem.\r\n% \r\n  try\r\n% \r\n  size_old = feval(@evalin,'caller','score');\r\n%\r\n  all_nodes = mtree('binary_neighbour_disabled.m','-file');\r\n  str_nodes = mtfind(all_nodes,'Kind','STRING');\r\n   eq_nodes = mtfind(all_nodes,'Kind','EQUALS');\r\nprint_nodes = mtfind(all_nodes,'Kind','PRINT');\r\n expr_nodes = mtfind(all_nodes,'Kind','EXPR');\r\n%\r\n       size = count(all_nodes)           ...\r\n              +sum(str_nodes.nodesize-1) ...\r\n              +2*(count(expr_nodes)      ...\r\n                  +count(print_nodes)    ...\r\n                  -count(eq_nodes));\r\n%\r\n  feval(@assignin,'caller','score',size);\r\n%\r\n  fprintf('Size in standard cody scoring is %i.\\n',size_old);\r\n  fprintf('Here it is %i.\\n',size);\r\n  end\r\n%\r\n%_________RESULT_____________________________","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":100,"test_suite_updated_at":"2015-01-19T22:59:13.000Z","rescore_all_solutions":false,"group_id":45,"created_at":"2014-12-07T21:51:56.000Z","updated_at":"2026-04-10T20:40:52.000Z","published_at":"2015-01-19T12:34: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\u003eGiven a natural number reorder its binary form to create another number, closest to the given one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1 gives 2, ( 1(dec) \u0026gt; 1 \u0026gt; 01 \u0026gt; 10 \u0026gt; 2(dec) )\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\u003e2 gives 1, ( 2(dec) \u0026gt; 10 \u0026gt; 01 \u0026gt; 1(dec) )\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\u003e5 gives 6, ( 5(dec) \u0026gt; 101 \u0026gt; 110 \u0026gt; 6(dec) )\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\"}]}"}],"term":"tag:\"pop series\"","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:\"pop series\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"pop series\"","","\"","pop series","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f24a1cddfd0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f24a1cddf30\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f24a1cdd670\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f24a1cde250\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f24a1cde1b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f24a1cde110\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f24a1cde070\u003e":"tag:\"pop series\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f24a1cde070\u003e":"tag:\"pop series\""},"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:\"pop series\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"pop series\"","","\"","pop series","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f24a1cddfd0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f24a1cddf30\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f24a1cdd670\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f24a1cde250\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f24a1cde1b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f24a1cde110\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f24a1cde070\u003e":"tag:\"pop series\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f24a1cde070\u003e":"tag:\"pop series\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2738,"difficulty_rating":"easy"},{"id":2733,"difficulty_rating":"easy-medium"},{"id":2734,"difficulty_rating":"easy-medium"},{"id":2848,"difficulty_rating":"medium"},{"id":2735,"difficulty_rating":"medium"}]}}