{"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":2494,"title":"What is the nth step in Conway's Life?","description":"Based on \u003cProblem 52. What is the next step in Conway's Life?\u003e\r\n\r\nGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\r\n\r\nNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 40.5px; vertical-align: baseline; perspective-origin: 332px 40.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eBased on\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/52\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e52. What is the next step in Conway's Life?\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M = life(L,n)\r\n\r\n function L = conway(L)\r\n end\r\n\r\n while t\u003cn\r\n end\r\n\r\nend","test_suite":"%%\r\nL = [\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 6;\r\nM_correct = [\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 \r\n0 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 \r\n0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 \r\n0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 \r\n0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 0 1 1 0 \r\n1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 \r\n1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 13;\r\nM_correct = [\r\n 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1\r\n 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1\r\n 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1\r\n 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0\r\n 1 1 0 0 0 0 0 0 0 1 1 0 1 1 0 1 1 1 0\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0\r\n 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0\r\n 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0\r\n 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0\r\n 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 9;\r\nM_correct = [\r\n 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0\r\n 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0\r\n 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0\r\n 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0\r\n 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0\r\n 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0\r\n 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0\r\n 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n];\r\nn = 1;\r\nM_correct = [\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n];\r\nassert(isequal(life(L,n),M_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":379,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-08-09T05:29:47.000Z","updated_at":"2026-04-08T14:56:31.000Z","published_at":"2014-08-09T05:31:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/52\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e52. What is the next step in Conway's Life?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":48075,"title":"Play PRIMEGAME","description":"Have you ever used the Sieve of Eratosthenes and said, \"I wonder whether there’s a less efficient way to find prime numbers.\"? No? Neither have I. \r\nNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the Game of Life. PRIMEGAME uses the fractions\r\n17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1\r\nYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \r\nIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\r\n2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4\r\nNotice that the 20th number is --that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\r\nWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.","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: 380.867px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 190.433px; transform-origin: 407.5px 190.433px; 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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75.85px 7.66667px; transform-origin: 75.85px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHave you ever used the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45367\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eSieve of Eratosthenes\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 119.042px 7.66667px; transform-origin: 119.042px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and said, \"I wonder whether there’s a \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: 12.45px 7.66667px; transform-origin: 12.45px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eless\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: 82.7167px 7.66667px; transform-origin: 82.7167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e efficient way to find prime numbers.\"? No? Neither have I. \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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 351.1px 7.66667px; transform-origin: 351.1px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/groups/2/problems/52\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 103.442px 7.66667px; transform-origin: 103.442px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. PRIMEGAME uses the fractions\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404.5px 10.2167px; transform-origin: 404.5px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.666667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.666667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.666667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.666667px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 8px; tab-size: 4; transform-origin: 350.35px 8px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 367.708px 7.66667px; transform-origin: 367.708px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 380.75px 7.66667px; transform-origin: 380.75px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404.5px 10.2167px; transform-origin: 404.5px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.666667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.666667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.666667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.666667px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 8px; tab-size: 4; transform-origin: 361.9px 8px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384.5px 42px; text-align: left; transform-origin: 384.5px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 54.8417px 7.66667px; transform-origin: 54.8417px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNotice that the 20\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 5.83333px 7.66667px; transform-origin: 5.83333px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eth\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: 34.6167px 7.66667px; transform-origin: 34.6167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e number is \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAmCAYAAAA820BcAAACFklEQVRYR+1WOy9EQRTe/QvodOiJ0NEoEEoS/AKh02yC2vMHeFVKEi1BoyASoVEpPP6BV/wAvk9mZO65Z+6dnd2bLexNTmb3zJnznfnO495yqYFPuYHYpSZ4EewPGKcPWF81gCJoXwHQkgP2jt+LkCMZRL3BCdxpwD+xTkJ2TCAzWA9cBuoJ3grHj5AWQbFl4gz60WrAO0z0Q+bQB9YLjULouiHtkBMBztxfQu4g/aHgFRhuaIUC3TNkAnLv2XfVFnwbyvkQ8FmTK4LsmQO9WKecw9wbhrzkBGB9jUtWtJyTalLESJeFY+4dQvqMflWxkbGcGkUi39Rp4KSbOU4ZGyeWRv5N5VEgW9s26FO9roHfwnABcpVB5xP22FLsYVnd9hir/wbirQ0NnFWbV0ikcgTCvHd5gqTNPiTR265tbJ9b8FQFG+db5gK7IrDExWLBv43TQSU9BOaTaCv8JzAr/08fAz4GB8cQVv20uJmdDZxm8mGaetyUxoBbyllwbo/zZr6hxEBoGzRklMB/VfbWqYHhO5Clr+bmdvisw+FmDJg8EwrOniXd5xA59aLjCAEvBJgR54EXBhwCzun0JqtUaa9r6LLGsZqarJtzWPDln/gAEF44NNYgvvmeWQ8+cALPBVZSyGs1+ObVANOpHDaBMesFZ7+3Q5x8wSjvDej1k1ftIQFE2zTBo6mr5WCT9lrYiz77f2n/AQK+XSdneCf8AAAAAElFTkSuQmCC\" alt=\"2^2\" style=\"width: 15.5px; height: 19px;\" width=\"15.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 275.35px 7.66667px; transform-origin: 275.35px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e--that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 276.783px 7.66667px; transform-origin: 276.783px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = PRIMEGAME(n)\r\n  y = f(n);\r\nend","test_suite":"% Clean user's function from some known jailbreaking mechanisms--from Binbin Qi\r\nfunctions={'!','feval','eval','regex','system','assert','assignin','urlread'};\r\nfid = fopen('PRIMEGAME.m');\r\n  st = char(fread(fid)');\r\n  for n = 1:numel(functions)\r\n    st = regexprep(st, functions{n}, 'error(''No fancy functions!''); %','ignorecase');\r\n  end\r\n  st = regexprep(st, 'function', 'error(''No fancy functions!''); %','ignorecase',2);\r\nfclose(fid);\r\nfid = fopen('PRIMEGAME.m', 'w');\r\nfwrite(fid,st);\r\nfclose(fid);\r\n\r\n%%\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 825;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 5;\r\ny_correct = 1925;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 11;\r\ny_correct = 770;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 17;\r\ny_correct = 550800;\r\nassert(isequal(PRIMEGAME(PRIMEGAME(n)),y_correct))\r\n\r\n%%\r\nn = 20;\r\ny_correct = 2^2;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 37;\r\ny_correct = 10780;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 53;\r\ny_correct = 1650;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 70;\r\ny_correct = 2^3;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 101;\r\ny_correct = 5320;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 179;\r\ny_correct = 11790625;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 282;\r\ny_correct = 2^5;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 353;\r\ny_correct = 1705200;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 467;\r\ny_correct = 91238000;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 547;\r\ny_correct = 314496;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 711;\r\ny_correct = 2^7;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 956;\r\ny_correct = 123853146484375;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1293;\r\ny_correct = 25088;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1553;\r\ny_correct = 2225664;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1637;\r\ny_correct = 197791083984375;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 2376;\r\ny_correct = 2^11;\r\nassert(isequal(PRIMEGAME(n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2022-01-29T15:31:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-18T03:10:48.000Z","updated_at":"2025-11-15T17:21:00.000Z","published_at":"2020-12-18T03:53:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave you ever used the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45367\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSieve of Eratosthenes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and said, \\\"I wonder whether there’s a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eless\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e efficient way to find prime numbers.\\\"? No? Neither have I. \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\u003eNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/groups/2/problems/52\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. PRIMEGAME uses the fractions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotice that the 20\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eth\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number is \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"2^2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e2^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e--that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":57535,"title":"Find patterns in subprime Fibonacci sequences","description":"Lots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with a different formula, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \r\nThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \r\nJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from this paper, is that a repeating pattern is reached for all starting values. \r\nWrite a function that takes a vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture?  ","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: 321px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 160.5px; transform-origin: 407px 160.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.042px 8px; transform-origin: 373.042px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/21\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration-line: underline; \"\u003ea different formula\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 226px 8px; transform-origin: 226px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 375.758px 8px; transform-origin: 375.758px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://arxiv.org/pdf/1207.5099.pdf\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration-line: underline; \"\u003ethis paper\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 187.475px 8px; transform-origin: 187.475px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is that a repeating pattern is reached for all starting values. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371.7px 8px; transform-origin: 371.7px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes a vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture? \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q,n0,len] = subprimeFib(y12)\r\n%  y12  = two starting values of the sequence\r\n%  q    = repeating pattern\r\n%  n0   = first index where the pattern starts\r\n%  len  = length of the pattern\r\n   q = arrayfun(@(x) sum(x),y12);\r\n   n0 = find(q==y12);\r\n   len = length(q);  \r\nend","test_suite":"%%\r\nq18 = [48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 43];\r\ny12 = [1 1];\r\nq_correct = q18;\r\nn0_correct = 38;\r\nlen_correct = 18;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\na = randi(10000)+1;\r\ny12 = [a a];\r\nq_correct = a;\r\nn0_correct = 1;\r\nlen_correct = 1;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n\r\n%%\r\nq136 = [11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16];\r\ny12 = [1 5];\r\nq_correct = q136;\r\nn0_correct = 6;\r\nlen_correct = 136;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq136 = [11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16];\r\ny12 = [37 38];\r\nq_correct = q136;\r\nn0_correct = 29;\r\nlen_correct = 136;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,circshift(q_correct,16)))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq18 = [48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 43];\r\ny12 = [432 198];\r\nq_correct = q18;\r\nn0_correct = 113;\r\nlen_correct = 18;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq11 = [37 199 118 317 145 231 188 419 607 513 560];\r\ny12 = [7883 16174];\r\nq_correct = q11;\r\nn0_correct = 37;\r\nlen_correct = 11;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq56 = [119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426];\r\ny12 = [1009 1013];\r\nq_correct = q56;\r\nn0_correct = 47;\r\nlen_correct = 56;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq19 = [23 27 25 26 17 43 30 73 103 88 191 93 142 47 63 55 59 57 58];\r\ny12 = [9109 9127];\r\nq_correct = q19;\r\nn0_correct = 95;\r\nlen_correct = 19;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq10 = [757 257 507 382 127 509 318 827 229 528];\r\ny12 = [649631 591771];\r\nq_correct = q10;\r\nn0_correct = 37;\r\nlen_correct = 10;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq56 = [119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426];\r\ny12 = [672493 557263];\r\nq_correct = q56;\r\nn0_correct = 92;\r\nlen_correct = 56;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq10 = [757 257 507 382 127 509 318 827 229 528];\r\ny12 = [688268 688360];\r\nq_correct = q10;\r\nn0_correct = 22;\r\nlen_correct = 10;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq11 = [37 199 118 317 145 231 188 419 607 513 560];\r\ny12 = [749919 535108];\r\nq_correct = q11;\r\nn0_correct = 23;\r\nlen_correct = 11;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq19 = [23 27 25 26 17 43 30 73 103 88 191 93 142 47 63 55 59 57 58];\r\ny12 = [3747276 73729705];\r\nq_correct = q19;\r\nn0_correct = 137;\r\nlen_correct = 19;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nfiletext = fileread('subprimeFib.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":4,"created_by":46909,"edited_by":46909,"edited_at":"2023-01-12T12:42:42.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2023-01-12T12:42:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-01-12T03:08:22.000Z","updated_at":"2023-01-12T12:42:42.000Z","published_at":"2023-01-12T03:08:42.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\u003eLots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/21\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea different formula\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \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\u003eJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://arxiv.org/pdf/1207.5099.pdf\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethis paper\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, is that a repeating pattern is reached for all starting values. \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 vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture? \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\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46686,"title":"Kaggle: Planetoid Game of Life - Solve 3000 of 50000 Puzzles","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 419.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 209.583px; transform-origin: 407px 209.583px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 271.517px 7.91667px; transform-origin: 271.517px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve at least 3000 of the 50K puzzles per these revised Life Laws.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 354.317px 7.91667px; transform-origin: 354.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (3000)\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 347.317px 7.91667px; transform-origin: 347.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of at least 3000 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 7.91667px; transform-origin: 0px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 250.483px 7.91667px; transform-origin: 250.483px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e There are 3726 trivial solutions where the  Finish state is the Start state solution.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest,numtosolve)\r\n  mstart=zeros(numtosolve,626)\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\ntic\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\ntoc\r\n\r\nnumtosolve=3000;\r\nmstart = solveLife(mtest,numtosolve);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\nvalid=0;\r\nfor i=1:size(mstart,1)  % \u003c0.5sec to process 3K cases\r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if isequal(A(:)',mtest(icase-49999,3:end)) % mtest [case, iter, data1:625]\r\n  valid=valid+1;\r\n else\r\n  valid=0;\r\n  break;\r\n end\r\nend %main loop i\r\ntoc\r\n\r\nassert(valid\u003e=3000)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2020-10-06T15:37:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-06T14:46:29.000Z","updated_at":"2020-10-06T15:37:58.000Z","published_at":"2020-10-06T15:37:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve at least 3000 of the 50K puzzles per these revised Life Laws.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (3000)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of at least 3000 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e There are 3726 trivial solutions where the  Finish state is the Start state solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46691,"title":"Kaggle: Planetoid Game of Life - Solve 40 non-trivial Puzzles","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 482.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 241.083px; transform-origin: 407px 241.083px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\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: 384px 7.91667px; transform-origin: 384px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve at least 40, excluding trivials, of the 50K puzzles per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 354.317px 7.91667px; transform-origin: 354.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (40)\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 339.533px 7.91667px; transform-origin: 339.533px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of at least 40 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 7.91667px; transform-origin: 0px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 364.467px 7.91667px; transform-origin: 364.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e There are 40 non-trivial solutions for iterations 1 and 2 where a solving Start state has a single bit flip that is adjacent to a set bit or is a set bit. Cases where there are more than 40 set bits in the final state may consume significant time for no solutions. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest,numtosolve)\r\n  mstart=zeros(numtosolve,626)\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\ntic\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\ntoc\r\n\r\nnumtosolve=40;\r\nmstart = solveLife(mtest,numtosolve);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\n%Check for Trivial solutions; Life(mtest(case))==mtest(case)\r\nvalid=1;\r\nfor i=1:size(mstart,1)  % \r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mtest(icase-49999,3:end),25,25);\r\n Abase=A;\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if isequal(Abase,A) % mtest [case, iter, data1:625]\r\n  valid=0; %Trivial solution entered\r\n  break;\r\n end\r\nend %main loop i\r\ntoc  % Trivial check timer\r\n\r\nLprocess=size(mstart,1)*valid;\r\nvalid=0; % Reset valid as counter for solutions\r\nfor i=1:Lprocess  % skip if any were trivial\r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if ~isequal(A(:)',mtest(icase-49999,3:end)) % mtest [case, iter, data1:625]\r\n  valid=0; %Evolved does not match goal\r\n  break;\r\n else\r\n  valid=valid+1;\r\n end\r\nend %main loop i\r\ntoc\r\n\r\nassert(valid\u003e=40)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-06T18:14:45.000Z","updated_at":"2020-10-06T18:41:35.000Z","published_at":"2020-10-06T18:41:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve at least 40, excluding trivials, of the 50K puzzles per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (40)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of at least 40 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e There are 40 non-trivial solutions for iterations 1 and 2 where a solving Start state has a single bit flip that is adjacent to a set bit or is a set bit. Cases where there are more than 40 set bits in the final state may consume significant time for no solutions. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46706,"title":"Kaggle: Planetoid Game of Life - Total Score 0.10","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 482.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 241.083px; transform-origin: 407px 241.083px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\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: 379.783px 7.91667px; transform-origin: 379.783px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve the 50K puzzles with a Score \u0026lt;= 0.10, Kaggle Top 25 result, per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 254.75px 7.91667px; transform-origin: 254.75px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 233.35px 7.91667px; transform-origin: 233.35px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of 50K puzzles, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 39.9333px 7.91667px; transform-origin: 39.9333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTop Scores:\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: 96.8667px 7.91667px; transform-origin: 96.8667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Zapor: 0.0818, 2556293 errors\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 105px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 52.5px; text-align: left; transform-origin: 384px 52.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 356.9px 7.91667px; transform-origin: 356.9px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e A Greedy Complete Single Adjacent bit flip can score \u0026lt;.0.09. Non-optimized processing time for Greedy Complete was 25Ksec. Candidate bits to flip are all wrap-convolve of Goal matrix with kernel ones(3). First test for trivial solution. Process all  bit flips on current optimal solution starting with Goal matrix. Make first best scoring solution the new optimal solution. Iterate on optimal solutions until no improvement on any single candidate bit flip. Greedy Complete for iterations=1 creates 176 solves not counting the 532 Trivial iteration 1 cases.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest)\r\n  %mstart=zeros(50000,626);  column 1 values should range from 50000:99999, other columns 0/1\r\n  urlname='';\r\n  urlwrite(urlname,'mstart.mat')\r\n  load('mstart.mat'); \r\n  \r\n  %Processing to \u003c0.10 Score is unlikely in Cody's 60 seconds\r\n  %Process offline mtest.mat file below.\r\n  %Create an mstart.mat file   using save('mstart.mat','mstart')  about 5.6MB\r\n  %Post the mstart.mat file in the cloud to download\r\n  %Copy the link location into urlname=''; above\r\n  \r\n  %Source data arrray to process mtest\r\n  %fname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n  %urlwrite(fname,'mtest.mat') %1.22s\r\n  %load('mtest.mat'); %0.42s\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\n\r\ncerr=zeros(50000,1);\r\nfor i=1:50000\r\n cerr(i)=nnz(mtest(i,3:end));\r\nend\r\n\r\ntic\r\nmstart = solveLife(mtest);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\n%Calc errors for each case submitted, otherwise use 0 input errors\r\ntic\r\nfor i=1:size(mstart,1)  % \r\n icase=mstart(i,1); %50000:99999\r\n Abase=reshape(mtest(icase-49999,3:end),25,25);;\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n \r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n cerr(icase-49999)=nnz(Abase-A);\r\n \r\nend %main loop i\r\ntoc  % 4.5s\r\n\r\nScore=sum(cerr)/50000/625;\r\nfprintf('Score %.4f  Total Errors: %i\\n',Score,sum(cerr));\r\n\r\nassert(Score\u003c=0.10)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-07T15:47:15.000Z","updated_at":"2026-04-21T14:54:44.000Z","published_at":"2020-10-07T16:39:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve the 50K puzzles with a Score \u0026lt;= 0.10, Kaggle Top 25 result, per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of 50K puzzles, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTop Scores:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Zapor: 0.0818, 2556293 errors\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e A Greedy Complete Single Adjacent bit flip can score \u0026lt;.0.09. Non-optimized processing time for Greedy Complete was 25Ksec. Candidate bits to flip are all wrap-convolve of Goal matrix with kernel ones(3). First test for trivial solution. Process all  bit flips on current optimal solution starting with Goal matrix. Make first best scoring solution the new optimal solution. Iterate on optimal solutions until no improvement on any single candidate bit flip. Greedy Complete for iterations=1 creates 176 solves not counting the 532 Trivial iteration 1 cases.\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":2494,"title":"What is the nth step in Conway's Life?","description":"Based on \u003cProblem 52. What is the next step in Conway's Life?\u003e\r\n\r\nGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\r\n\r\nNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 40.5px; vertical-align: baseline; perspective-origin: 332px 40.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eBased on\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/52\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e52. What is the next step in Conway's Life?\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M = life(L,n)\r\n\r\n function L = conway(L)\r\n end\r\n\r\n while t\u003cn\r\n end\r\n\r\nend","test_suite":"%%\r\nL = [\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 6;\r\nM_correct = [\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 \r\n0 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 \r\n0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 \r\n0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 \r\n0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 \r\n0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 0 1 1 0 \r\n1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 \r\n1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 13;\r\nM_correct = [\r\n 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1\r\n 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1\r\n 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1\r\n 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0\r\n 0 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0\r\n 1 1 0 0 0 0 0 0 0 1 1 0 1 1 0 1 1 1 0\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0\r\n 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0\r\n 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0\r\n 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0\r\n 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0\r\n];\r\nn = 9;\r\nM_correct = [\r\n 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0\r\n 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0\r\n 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\r\n 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0\r\n 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0\r\n 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0\r\n 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0\r\n 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0\r\n 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0\r\n 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0\r\n 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0\r\n 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0\r\n 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0\r\n];\r\nassert(isequal(life(L,n),M_correct))\r\n%%\r\nL = [\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n];\r\nn = 1;\r\nM_correct = [\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \r\n];\r\nassert(isequal(life(L,n),M_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":379,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-08-09T05:29:47.000Z","updated_at":"2026-04-08T14:56:31.000Z","published_at":"2014-08-09T05:31:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/52\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e52. What is the next step in Conway's Life?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGeneralize your solution to Problem 52 - Give the state of the game at nth step for any size board.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: This problem uses the MATLAB convention for indexing (t=1 is the initial state).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":48075,"title":"Play PRIMEGAME","description":"Have you ever used the Sieve of Eratosthenes and said, \"I wonder whether there’s a less efficient way to find prime numbers.\"? No? Neither have I. \r\nNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the Game of Life. PRIMEGAME uses the fractions\r\n17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1\r\nYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \r\nIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\r\n2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4\r\nNotice that the 20th number is --that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\r\nWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.","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: 380.867px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 190.433px; transform-origin: 407.5px 190.433px; 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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75.85px 7.66667px; transform-origin: 75.85px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHave you ever used the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/45367\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eSieve of Eratosthenes\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 119.042px 7.66667px; transform-origin: 119.042px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and said, \"I wonder whether there’s a \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: 12.45px 7.66667px; transform-origin: 12.45px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eless\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: 82.7167px 7.66667px; transform-origin: 82.7167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e efficient way to find prime numbers.\"? No? Neither have I. \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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 351.1px 7.66667px; transform-origin: 351.1px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/groups/2/problems/52\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 103.442px 7.66667px; transform-origin: 103.442px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. PRIMEGAME uses the fractions\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404.5px 10.2167px; transform-origin: 404.5px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.666667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.666667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.666667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.666667px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 8px; tab-size: 4; transform-origin: 350.35px 8px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 367.708px 7.66667px; transform-origin: 367.708px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \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: 384.5px 21px; text-align: left; transform-origin: 384.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 380.75px 7.66667px; transform-origin: 380.75px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404.5px 10.2167px; transform-origin: 404.5px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.666667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.666667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.666667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.666667px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 8px; tab-size: 4; transform-origin: 361.9px 8px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384.5px 42px; text-align: left; transform-origin: 384.5px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 54.8417px 7.66667px; transform-origin: 54.8417px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNotice that the 20\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 5.83333px 7.66667px; transform-origin: 5.83333px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eth\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: 34.6167px 7.66667px; transform-origin: 34.6167px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e number is \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAmCAYAAAA820BcAAACFklEQVRYR+1WOy9EQRTe/QvodOiJ0NEoEEoS/AKh02yC2vMHeFVKEi1BoyASoVEpPP6BV/wAvk9mZO65Z+6dnd2bLexNTmb3zJnznfnO495yqYFPuYHYpSZ4EewPGKcPWF81gCJoXwHQkgP2jt+LkCMZRL3BCdxpwD+xTkJ2TCAzWA9cBuoJ3grHj5AWQbFl4gz60WrAO0z0Q+bQB9YLjULouiHtkBMBztxfQu4g/aHgFRhuaIUC3TNkAnLv2XfVFnwbyvkQ8FmTK4LsmQO9WKecw9wbhrzkBGB9jUtWtJyTalLESJeFY+4dQvqMflWxkbGcGkUi39Rp4KSbOU4ZGyeWRv5N5VEgW9s26FO9roHfwnABcpVB5xP22FLsYVnd9hir/wbirQ0NnFWbV0ikcgTCvHd5gqTNPiTR265tbJ9b8FQFG+db5gK7IrDExWLBv43TQSU9BOaTaCv8JzAr/08fAz4GB8cQVv20uJmdDZxm8mGaetyUxoBbyllwbo/zZr6hxEBoGzRklMB/VfbWqYHhO5Clr+bmdvisw+FmDJg8EwrOniXd5xA59aLjCAEvBJgR54EXBhwCzun0JqtUaa9r6LLGsZqarJtzWPDln/gAEF44NNYgvvmeWQ8+cALPBVZSyGs1+ObVANOpHDaBMesFZ7+3Q5x8wSjvDej1k1ftIQFE2zTBo6mr5WCT9lrYiz77f2n/AQK+XSdneCf8AAAAAElFTkSuQmCC\" alt=\"2^2\" style=\"width: 15.5px; height: 19px;\" width=\"15.5\" height=\"19\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 275.35px 7.66667px; transform-origin: 275.35px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e--that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 276.783px 7.66667px; transform-origin: 276.783px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = PRIMEGAME(n)\r\n  y = f(n);\r\nend","test_suite":"% Clean user's function from some known jailbreaking mechanisms--from Binbin Qi\r\nfunctions={'!','feval','eval','regex','system','assert','assignin','urlread'};\r\nfid = fopen('PRIMEGAME.m');\r\n  st = char(fread(fid)');\r\n  for n = 1:numel(functions)\r\n    st = regexprep(st, functions{n}, 'error(''No fancy functions!''); %','ignorecase');\r\n  end\r\n  st = regexprep(st, 'function', 'error(''No fancy functions!''); %','ignorecase',2);\r\nfclose(fid);\r\nfid = fopen('PRIMEGAME.m', 'w');\r\nfwrite(fid,st);\r\nfclose(fid);\r\n\r\n%%\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 825;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 5;\r\ny_correct = 1925;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 11;\r\ny_correct = 770;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 17;\r\ny_correct = 550800;\r\nassert(isequal(PRIMEGAME(PRIMEGAME(n)),y_correct))\r\n\r\n%%\r\nn = 20;\r\ny_correct = 2^2;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 37;\r\ny_correct = 10780;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 53;\r\ny_correct = 1650;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 70;\r\ny_correct = 2^3;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 101;\r\ny_correct = 5320;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 179;\r\ny_correct = 11790625;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 282;\r\ny_correct = 2^5;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 353;\r\ny_correct = 1705200;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 467;\r\ny_correct = 91238000;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 547;\r\ny_correct = 314496;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 711;\r\ny_correct = 2^7;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 956;\r\ny_correct = 123853146484375;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1293;\r\ny_correct = 25088;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1553;\r\ny_correct = 2225664;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 1637;\r\ny_correct = 197791083984375;\r\nassert(isequal(PRIMEGAME(n),y_correct))\r\n\r\n%%\r\nn = 2376;\r\ny_correct = 2^11;\r\nassert(isequal(PRIMEGAME(n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2022-01-29T15:31:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-18T03:10:48.000Z","updated_at":"2025-11-15T17:21:00.000Z","published_at":"2020-12-18T03:53:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave you ever used the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45367\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSieve of Eratosthenes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and said, \\\"I wonder whether there’s a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eless\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e efficient way to find prime numbers.\\\"? No? Neither have I. \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\u003eNevertheless, let’s consider PRIMEGAME, a creation of John Conway that is somewhat less well known than the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/groups/2/problems/52\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. PRIMEGAME uses the fractions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/2, 1/7, 55/1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou start with a number and choose the first fraction in the list that—when multiplied by the starting number—yields an integer. If the starting number is 2, then the first fraction fitting the rule is 15/2, and the product is 15. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the third step, the next fraction is 55/1, and the product is 825. In the fourth, the fraction is 29/33, and the product is 725. The first twenty steps give\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910, 170, 156, 132, 116, 308, 364, 68, 4]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNotice that the 20\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eth\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number is \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"2^2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e2^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e--that is, 2 raised to the first prime number. If you continue another 50 steps, you get 2 to the second prime number (3), or 8. Another 210 steps give 2 raised to the third prime number (5), or 32. In fact, all exponents in powers of 2 that appear in the sequence are prime numbers. So, PRIMEGAME generates the primes! Painfully slowly!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to find the nth number generated by PRIMEGAME if the first number is 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":57535,"title":"Find patterns in subprime Fibonacci sequences","description":"Lots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with a different formula, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \r\nThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \r\nJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from this paper, is that a repeating pattern is reached for all starting values. \r\nWrite a function that takes a vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture?  ","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: 321px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 160.5px; transform-origin: 407px 160.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.042px 8px; transform-origin: 373.042px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/21\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration-line: underline; \"\u003ea different formula\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 226px 8px; transform-origin: 226px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 375.758px 8px; transform-origin: 375.758px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://arxiv.org/pdf/1207.5099.pdf\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"text-decoration-line: underline; \"\u003ethis paper\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 187.475px 8px; transform-origin: 187.475px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, is that a repeating pattern is reached for all starting values. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371.7px 8px; transform-origin: 371.7px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes a vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture? \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q,n0,len] = subprimeFib(y12)\r\n%  y12  = two starting values of the sequence\r\n%  q    = repeating pattern\r\n%  n0   = first index where the pattern starts\r\n%  len  = length of the pattern\r\n   q = arrayfun(@(x) sum(x),y12);\r\n   n0 = find(q==y12);\r\n   len = length(q);  \r\nend","test_suite":"%%\r\nq18 = [48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 43];\r\ny12 = [1 1];\r\nq_correct = q18;\r\nn0_correct = 38;\r\nlen_correct = 18;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\na = randi(10000)+1;\r\ny12 = [a a];\r\nq_correct = a;\r\nn0_correct = 1;\r\nlen_correct = 1;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n\r\n%%\r\nq136 = [11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16];\r\ny12 = [1 5];\r\nq_correct = q136;\r\nn0_correct = 6;\r\nlen_correct = 136;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq136 = [11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16];\r\ny12 = [37 38];\r\nq_correct = q136;\r\nn0_correct = 29;\r\nlen_correct = 136;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,circshift(q_correct,16)))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq18 = [48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 43];\r\ny12 = [432 198];\r\nq_correct = q18;\r\nn0_correct = 113;\r\nlen_correct = 18;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq11 = [37 199 118 317 145 231 188 419 607 513 560];\r\ny12 = [7883 16174];\r\nq_correct = q11;\r\nn0_correct = 37;\r\nlen_correct = 11;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq56 = [119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426];\r\ny12 = [1009 1013];\r\nq_correct = q56;\r\nn0_correct = 47;\r\nlen_correct = 56;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq19 = [23 27 25 26 17 43 30 73 103 88 191 93 142 47 63 55 59 57 58];\r\ny12 = [9109 9127];\r\nq_correct = q19;\r\nn0_correct = 95;\r\nlen_correct = 19;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq10 = [757 257 507 382 127 509 318 827 229 528];\r\ny12 = [649631 591771];\r\nq_correct = q10;\r\nn0_correct = 37;\r\nlen_correct = 10;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq56 = [119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426];\r\ny12 = [672493 557263];\r\nq_correct = q56;\r\nn0_correct = 92;\r\nlen_correct = 56;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq10 = [757 257 507 382 127 509 318 827 229 528];\r\ny12 = [688268 688360];\r\nq_correct = q10;\r\nn0_correct = 22;\r\nlen_correct = 10;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq11 = [37 199 118 317 145 231 188 419 607 513 560];\r\ny12 = [749919 535108];\r\nq_correct = q11;\r\nn0_correct = 23;\r\nlen_correct = 11;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nq19 = [23 27 25 26 17 43 30 73 103 88 191 93 142 47 63 55 59 57 58];\r\ny12 = [3747276 73729705];\r\nq_correct = q19;\r\nn0_correct = 137;\r\nlen_correct = 19;\r\n[q,n0,len] = subprimeFib(y12);\r\nassert(isequal(q,q_correct))\r\nassert(isequal(n0,n0_correct))\r\nassert(isequal(len,len_correct))\r\n\r\n%%\r\nfiletext = fileread('subprimeFib.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":4,"created_by":46909,"edited_by":46909,"edited_at":"2023-01-12T12:42:42.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2023-01-12T12:42:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-01-12T03:08:22.000Z","updated_at":"2023-01-12T12:42:42.000Z","published_at":"2023-01-12T03:08:42.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\u003eLots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are computed by summing the previous two terms. The terms continue to increase, of course. Terms in Collatz sequences are computed with \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/21\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea different formula\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and for the initial values that have been tried, the sequences eventually reach a 1. An unsolved problem is whether Collatz sequences reach 1 for any initial value. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe problem combines ideas from these two sequences by examining subprime Fibonacci sequences. The sequence starts with two given values, and the next term is computed as the sum of the previous two. However, if the sum is composite, it is divided by the smallest prime factor. If the starting values are [1 1], then the sequence is 1, 1, 2, 3, 5, 4, 3, 7, 5, etc. \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\u003eJust as all Collatz sequences reach 1 (so far), all subprime Fibonacci sequences reach a repeating pattern. However, the pattern changes with the starting values. With starting values [1 1], the repeating pattern is 18 terms long, and it starts on term 38. With starting values [7 37], the repeating pattern is 136 terms long, and it starts on term 37. The subprime Fibonacci conjecture, from \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://arxiv.org/pdf/1207.5099.pdf\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:u/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethis paper\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, is that a repeating pattern is reached for all starting values. \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 vector of two starting values and produces the repeating pattern, the number of the starting term, and the length of the pattern. Can you find patterns of lengths other than those in the test suite? Can you prove the subprime Fibonacci conjecture? \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\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46686,"title":"Kaggle: Planetoid Game of Life - Solve 3000 of 50000 Puzzles","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 419.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 209.583px; transform-origin: 407px 209.583px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 271.517px 7.91667px; transform-origin: 271.517px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve at least 3000 of the 50K puzzles per these revised Life Laws.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 354.317px 7.91667px; transform-origin: 354.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (3000)\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 347.317px 7.91667px; transform-origin: 347.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of at least 3000 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 7.91667px; transform-origin: 0px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 250.483px 7.91667px; transform-origin: 250.483px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e There are 3726 trivial solutions where the  Finish state is the Start state solution.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest,numtosolve)\r\n  mstart=zeros(numtosolve,626)\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\ntic\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\ntoc\r\n\r\nnumtosolve=3000;\r\nmstart = solveLife(mtest,numtosolve);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\nvalid=0;\r\nfor i=1:size(mstart,1)  % \u003c0.5sec to process 3K cases\r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if isequal(A(:)',mtest(icase-49999,3:end)) % mtest [case, iter, data1:625]\r\n  valid=valid+1;\r\n else\r\n  valid=0;\r\n  break;\r\n end\r\nend %main loop i\r\ntoc\r\n\r\nassert(valid\u003e=3000)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2020-10-06T15:37:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-06T14:46:29.000Z","updated_at":"2020-10-06T15:37:58.000Z","published_at":"2020-10-06T15:37:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve at least 3000 of the 50K puzzles per these revised Life Laws.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (3000)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of at least 3000 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e There are 3726 trivial solutions where the  Finish state is the Start state solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46691,"title":"Kaggle: Planetoid Game of Life - Solve 40 non-trivial Puzzles","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 482.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 241.083px; transform-origin: 407px 241.083px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\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: 384px 7.91667px; transform-origin: 384px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve at least 40, excluding trivials, of the 50K puzzles per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 354.317px 7.91667px; transform-origin: 354.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (40)\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 339.533px 7.91667px; transform-origin: 339.533px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of at least 40 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 7.91667px; transform-origin: 0px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 364.467px 7.91667px; transform-origin: 364.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e There are 40 non-trivial solutions for iterations 1 and 2 where a solving Start state has a single bit flip that is adjacent to a set bit or is a set bit. Cases where there are more than 40 set bits in the final state may consume significant time for no solutions. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest,numtosolve)\r\n  mstart=zeros(numtosolve,626)\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\ntic\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\ntoc\r\n\r\nnumtosolve=40;\r\nmstart = solveLife(mtest,numtosolve);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\n%Check for Trivial solutions; Life(mtest(case))==mtest(case)\r\nvalid=1;\r\nfor i=1:size(mstart,1)  % \r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mtest(icase-49999,3:end),25,25);\r\n Abase=A;\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if isequal(Abase,A) % mtest [case, iter, data1:625]\r\n  valid=0; %Trivial solution entered\r\n  break;\r\n end\r\nend %main loop i\r\ntoc  % Trivial check timer\r\n\r\nLprocess=size(mstart,1)*valid;\r\nvalid=0; % Reset valid as counter for solutions\r\nfor i=1:Lprocess  % skip if any were trivial\r\n icase=mstart(i,1); %50000:99999\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n\r\n if ~isequal(A(:)',mtest(icase-49999,3:end)) % mtest [case, iter, data1:625]\r\n  valid=0; %Evolved does not match goal\r\n  break;\r\n else\r\n  valid=valid+1;\r\n end\r\nend %main loop i\r\ntoc\r\n\r\nassert(valid\u003e=40)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-06T18:14:45.000Z","updated_at":"2020-10-06T18:41:35.000Z","published_at":"2020-10-06T18:41:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve at least 40, excluding trivials, of the 50K puzzles per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest,numtosolve) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values], number of case to solve (40)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of at least 40 puzzles all with perfect zero error solutions, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e There are 40 non-trivial solutions for iterations 1 and 2 where a solving Start state has a single bit flip that is adjacent to a set bit or is a set bit. Cases where there are more than 40 set bits in the final state may consume significant time for no solutions. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":46706,"title":"Kaggle: Planetoid Game of Life - Total Score 0.10","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 482.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 241.083px; transform-origin: 407px 241.083px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 203.05px 7.91667px; transform-origin: 203.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://mathworld.wolfram.com/GameofLife.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGame of Life at Wolfram\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eWiki Life\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 138.467px 7.91667px; transform-origin: 138.467px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\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: 379.783px 7.91667px; transform-origin: 379.783px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to Solve the 50K puzzles with a Score \u0026lt;= 0.10, Kaggle Top 25 result, per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 350.35px 7.91667px; transform-origin: 350.35px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e1. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 188.65px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 188.65px 7.91667px; \"\u003elive cell with fewer than two live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 115.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 115.5px 7.91667px; \"\u003eif caused by under-population.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 315.7px 7.91667px; transform-origin: 315.7px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e2. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 288.75px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 288.75px 7.91667px; \"\u003elive cell with two or three live neighbors lives on to the next generation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 311.85px 7.91667px; transform-origin: 311.85px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e3. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 192.5px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 192.5px 7.91667px; \"\u003elive cell with more than three live neighbors dies\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by overcrowding.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 361.9px 7.91667px; transform-origin: 361.9px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 7.91667px; transform-origin: 26.95px 7.91667px; \"\u003e4. Any \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 242.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 242.55px 7.91667px; \"\u003edead cell with exactly three live neighbors becomes a live cell\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 19.25px 7.91667px; transform-origin: 19.25px 7.91667px; \"\u003e, as \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 73.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 73.15px 7.91667px; \"\u003eif by reproduction.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 265.65px 7.91667px; transform-origin: 265.65px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 7.91667px; transform-origin: 34.65px 7.91667px; \"\u003e5. Edges \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 231px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 231px 7.91667px; \"\u003ewrap around. Eight Neighbors. (Change to normal planar life)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 221.317px 7.91667px; transform-origin: 221.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 254.75px 7.91667px; transform-origin: 254.75px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mtest) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 233.35px 7.91667px; transform-origin: 233.35px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (mstart) the Starting state matrix of 50K puzzles, [casenumber, 625 values]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 39.9333px 7.91667px; transform-origin: 39.9333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTop Scores:\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: 96.8667px 7.91667px; transform-origin: 96.8667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Zapor: 0.0818, 2556293 errors\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 105px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 52.5px; text-align: left; transform-origin: 384px 52.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 15.95px 7.91667px; transform-origin: 15.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHint:\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: 356.9px 7.91667px; transform-origin: 356.9px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e A Greedy Complete Single Adjacent bit flip can score \u0026lt;.0.09. Non-optimized processing time for Greedy Complete was 25Ksec. Candidate bits to flip are all wrap-convolve of Goal matrix with kernel ones(3). First test for trivial solution. Process all  bit flips on current optimal solution starting with Goal matrix. Make first best scoring solution the new optimal solution. Iterate on optimal solutions until no improvement on any single candidate bit flip. Greedy Complete for iterations=1 creates 176 solves not counting the 532 Trivial iteration 1 cases.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function mstart = solveLife(mtest)\r\n  %mstart=zeros(50000,626);  column 1 values should range from 50000:99999, other columns 0/1\r\n  urlname='';\r\n  urlwrite(urlname,'mstart.mat')\r\n  load('mstart.mat'); \r\n  \r\n  %Processing to \u003c0.10 Score is unlikely in Cody's 60 seconds\r\n  %Process offline mtest.mat file below.\r\n  %Create an mstart.mat file   using save('mstart.mat','mstart')  about 5.6MB\r\n  %Post the mstart.mat file in the cloud to download\r\n  %Copy the link location into urlname=''; above\r\n  \r\n  %Source data arrray to process mtest\r\n  %fname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n  %urlwrite(fname,'mtest.mat') %1.22s\r\n  %load('mtest.mat'); %0.42s\r\nend","test_suite":"%%\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\n%mtest format is [casenumer, iterations, start1:625,finish1:625] for 50K cases 0:49999\r\n%'https://sites.google.com/site/razapor/matlab_cody/mtrain.mat?attredirects=0\u0026d=1';\r\nfname='https://sites.google.com/site/razapor/matlab_cody/mtest.mat?attredirects=0\u0026d=1';\r\nurlwrite(fname,'mtest.mat') %1.22s\r\nload('mtest.mat'); %0.42s\r\n\r\ncerr=zeros(50000,1);\r\nfor i=1:50000\r\n cerr(i)=nnz(mtest(i,3:end));\r\nend\r\n\r\ntic\r\nmstart = solveLife(mtest);\r\ntoc\r\nmstart=unique(mstart,'rows'); % remove exact duplicate solutions\r\n\r\n%Calc errors for each case submitted, otherwise use 0 input errors\r\ntic\r\nfor i=1:size(mstart,1)  % \r\n icase=mstart(i,1); %50000:99999\r\n Abase=reshape(mtest(icase-49999,3:end),25,25);;\r\n iter=mtest(icase-49999,2); %Test cases start at 50000\r\n \r\n A=reshape(mstart(i,2:end),25,25);\r\n \r\n for j=1:iter\r\n  C=0;\r\n  for r=-1:1 % -1 Up   Using circshift to perform wrap convolution\r\n   Ar=circshift(A,r,1);\r\n   for c=-1:1 % -1 Left\r\n     Arc=circshift(Ar,c,2);\r\n     C=C+Arc;\r\n   end\r\n  end\r\n  A = C==3 | A\u0026C==4;\r\n end %j\r\n cerr(icase-49999)=nnz(Abase-A);\r\n \r\nend %main loop i\r\ntoc  % 4.5s\r\n\r\nScore=sum(cerr)/50000/625;\r\nfprintf('Score %.4f  Total Errors: %i\\n',Score,sum(cerr));\r\n\r\nassert(Score\u003c=0.10)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-07T15:47:15.000Z","updated_at":"2026-04-21T14:54:44.000Z","published_at":"2020-10-07T16:39:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.kaggle.com/c/conways-reverse-game-of-life-2020\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKaggle's Conway's Reverse Game of Life 2020 \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003econtest inspires this Life challenge. The kaggle contest runs from Oct-01-2020 thru Nov-30-2020. References:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/GameofLife.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGame of Life at Wolfram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWiki Life\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Kaggle event is 50K cases to solve for a state 1 to 5 iterations prior to a given state. Imperfect solutions are allowed but penalized. Input file to Kaggle is a csv so Matlab solutions can be posted at the Kaggle site for this event.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to Solve the 50K puzzles with a Score \u0026lt;= 0.10, Kaggle Top 25 result, per these revised Life Laws. Trivial solutions are where the Final state may match the Start State.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.\\n2. Any live cell with two or three live neighbors lives on to the next generation.\\n3. Any live cell with more than three live neighbors dies, as if by overcrowding.\\n4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\\n5. Edges wrap around. Eight Neighbors. (Change to normal planar life)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The edges wrap so the matrix represents the surface of a sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mtest) the Finish state matrix of 50K rows of [casenumber, iterations, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (mstart) the Starting state matrix of 50K puzzles, [casenumber, 625 values]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTop Scores:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Zapor: 0.0818, 2556293 errors\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e A Greedy Complete Single Adjacent bit flip can score \u0026lt;.0.09. Non-optimized processing time for Greedy Complete was 25Ksec. Candidate bits to flip are all wrap-convolve of Goal matrix with kernel ones(3). First test for trivial solution. Process all  bit flips on current optimal solution starting with Goal matrix. Make first best scoring solution the new optimal solution. Iterate on optimal solutions until no improvement on any single candidate bit flip. Greedy Complete for iterations=1 creates 176 solves not counting the 532 Trivial iteration 1 cases.\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:\"conway\"","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:\"conway\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"conway\"","","\"","conway","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02e60\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f75ecd02dc0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02500\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f75ecd030e0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f75ecd03040\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f75ecd02fa0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f75ecd02f00\u003e":"tag:\"conway\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02f00\u003e":"tag:\"conway\""},"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:\"conway\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"conway\"","","\"","conway","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02e60\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f75ecd02dc0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02500\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f75ecd030e0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f75ecd03040\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f75ecd02fa0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f75ecd02f00\u003e":"tag:\"conway\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f75ecd02f00\u003e":"tag:\"conway\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2494,"difficulty_rating":"medium"},{"id":48075,"difficulty_rating":"medium"},{"id":57535,"difficulty_rating":"medium"},{"id":46686,"difficulty_rating":"medium"},{"id":46691,"difficulty_rating":"medium"},{"id":46706,"difficulty_rating":"hard"}]}}