{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":44478,"title":"Exponential decay","description":"Many dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See \u003chttps://en.wikipedia.org/wiki/Exponential_decay\u003e for more background. \r\n\r\nAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\r\n\r\nx'(t) = - x(t) / tau\r\n\r\nwhere x'(t) is the first derivative of x(t), and time constant tau is 2.\r\n\r\nWrite a function that returns the value x for a given input t. It should be able to deal with a vector input. ","description_html":"\u003cp\u003eMany dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See \u003ca href = \"https://en.wikipedia.org/wiki/Exponential_decay\"\u003ehttps://en.wikipedia.org/wiki/Exponential_decay\u003c/a\u003e for more background.\u003c/p\u003e\u003cp\u003eAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\u003c/p\u003e\u003cp\u003ex'(t) = - x(t) / tau\u003c/p\u003e\u003cp\u003ewhere x'(t) is the first derivative of x(t), and time constant tau is 2.\u003c/p\u003e\u003cp\u003eWrite a function that returns the value x for a given input t. It should be able to deal with a vector input.\u003c/p\u003e","function_template":"function x = decay(t)\r\n  x = 1 - t;\r\nend","test_suite":"%%\r\nt = 0;\r\nx_correct = 1;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2;\r\nx_correct = exp(-1);\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2000;\r\nx_correct = 0;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2e-5;\r\nx_correct = 1 - 1e-5;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = [0 1 2];\r\nx_correct = [1 exp(-0.5) exp(-1)];\r\nassert(all(abs(decay(t)-x_correct)\u003c1e-10))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":160977,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-03T21:30:22.000Z","updated_at":"2026-04-03T06:48:44.000Z","published_at":"2018-01-03T21:30:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMany dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Exponential_decay\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Exponential_decay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt; for more background.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex'(t) = - x(t) / tau\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere x'(t) is the first derivative of x(t), and time constant tau is 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that returns the value x for a given input t. It should be able to deal with a vector input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1762,"title":"Create incrementing array","description":"Given a and b generate an output matrix as shown in following examples:\r\n\r\n a=2\r\n b=5\r\n output=[2 20 200 2000 20000]\r\n\r\n a=4\r\n b=3\r\n output=[4 40 400]","description_html":"\u003cp\u003eGiven a and b generate an output matrix as shown in following examples:\u003c/p\u003e\u003cpre\u003e a=2\r\n b=5\r\n output=[2 20 200 2000 20000]\u003c/pre\u003e\u003cpre\u003e a=4\r\n b=3\r\n output=[4 40 400]\u003c/pre\u003e","function_template":"function y = your_fcn_name(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nb =3;\r\ny_correct = [1 10 100];\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n%%\r\na = 5;\r\nb =1;\r\ny_correct = [5];\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n\r\n%%\r\na = 7;\r\nb =6;\r\ny_correct = [7 70 700 7000 70000 700000]\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":294,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-30T07:33:22.000Z","updated_at":"2026-02-18T15:45:17.000Z","published_at":"2013-07-30T07:33:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a and b generate an output matrix as shown in following examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ a=2\\n b=5\\n output=[2 20 200 2000 20000]\\n\\n a=4\\n b=3\\n output=[4 40 400]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1172,"title":"Wheat on a chessboard pt 1","description":"If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\r\n\r\nAssume the chess board is n by n squares.","description_html":"\u003cp\u003eIf a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\u003c/p\u003e\u003cp\u003eAssume the chess board is n by n squares.\u003c/p\u003e","function_template":"function y = wheat_chess(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 0;\r\ny_correct = 0;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = -1;\r\ny_correct = 'NaN';\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 4;\r\ny_correct = 65535;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 8;\r\ny_correct = 18446744073709551615;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 10;\r\ny_correct = 1267650600228229401496703205375;\r\nassert(isequal(wheat_chess(n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":7,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":192,"test_suite_updated_at":"2013-01-08T15:42:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-04T15:52:05.000Z","updated_at":"2026-03-31T14:13:16.000Z","published_at":"2013-01-04T15:52:05.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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\u003eAssume the chess board is n by n squares.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42848,"title":"Lambert's W","description":"Matlab cody does not support lambertw. Try to create a lambert's w function yourself.\r\n\r\nLambert's W is the function that solves \r\n\r\n  x*exp(x) = A;\r\n\r\ngiven the value of A.\r\n\r\nRead more about Lambert's W \u003chttps://en.wikipedia.org/wiki/Lambert_W_function here\u003e.\r\n\r\nThough it is not particularly appropriate for this particular function, consider using \u003chttps://en.wikipedia.org/wiki/Newton's_method Newton-Raphson's method\u003e. Since all test cases will converge if starting with 0.\r\n\r\nThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.","description_html":"\u003cp\u003eMatlab cody does not support lambertw. Try to create a lambert's w function yourself.\u003c/p\u003e\u003cp\u003eLambert's W is the function that solves\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex*exp(x) = A;\r\n\u003c/pre\u003e\u003cp\u003egiven the value of A.\u003c/p\u003e\u003cp\u003eRead more about Lambert's W \u003ca href = \"https://en.wikipedia.org/wiki/Lambert_W_function\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThough it is not particularly appropriate for this particular function, consider using \u003ca href = \"https://en.wikipedia.org/wiki/Newton's_method\"\u003eNewton-Raphson's method\u003c/a\u003e. Since all test cases will converge if starting with 0.\u003c/p\u003e\u003cp\u003eThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.\u003c/p\u003e","function_template":"function x = LambertW(A)\r\n  y = log(x);\r\nend","test_suite":"%%\r\nA = 1;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n\r\n%%\r\nA = 6.8;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n\r\n%%\r\nA = 14;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12767,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-05-05T14:37:35.000Z","updated_at":"2025-12-07T18:24:23.000Z","published_at":"2016-05-05T14:38:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMatlab cody does not support lambertw. Try to create a lambert's w function yourself.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLambert's W is the function that solves\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x*exp(x) = A;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003egiven the value of A.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRead more about Lambert's W\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Lambert_W_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThough it is not particularly appropriate for this particular function, consider using\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Newton's_method\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eNewton-Raphson's method\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Since all test cases will converge if starting with 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1174,"title":"Wheat on a chessboard pt 2","description":"If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\r\n\r\nAssume the chess board is n by n squares.","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: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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: 136px 8px; transform-origin: 136px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume the chess board is n by n squares.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function A = wheat_chess(x,y,n)\r\n  A = x + y + n;\r\nend","test_suite":"%%\r\nx = 56;\r\ny = 1;\r\nn = 1;\r\nA_correct = 56;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 2;\r\nn = 8;\r\nA_correct = 18446744073709551615;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 5;\r\ny = 3;\r\nn = 2;\r\nA_correct = 200;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 10;\r\ny = 5;\r\nn = 3;\r\nA_correct = 4882810;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\nn = 1;\r\nA_correct = 1;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 12;\r\ny = 1;\r\nn = 3;\r\nA_correct = 108;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 0;\r\ny = 1e5;\r\nn = 7;\r\nA_correct = 0;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 6;\r\ny = 2;\r\nn = 4;\r\nA_correct = 393210;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":6,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":"2021-05-05T10:17:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-04T18:21:52.000Z","updated_at":"2026-02-15T07:12:03.000Z","published_at":"2013-01-04T18:21:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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\u003eAssume the chess board is n by n squares.\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":441,"title":"Drying sweater?","description":"* A sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes. \r\n* Veronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer. \r\n* How many minutes she should wait so that the sweater weighs w times its dry weight? \r\n* Please try a general solution, the test suite may expand later.","description_html":"\u003cul\u003e\u003cli\u003eA sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes.\u003c/li\u003e\u003cli\u003eVeronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer.\u003c/li\u003e\u003cli\u003eHow many minutes she should wait so that the sweater weighs w times its dry weight?\u003c/li\u003e\u003cli\u003ePlease try a general solution, the test suite may expand later.\u003c/li\u003e\u003c/ul\u003e","function_template":"function m = drying(x,w)\r\n   m=x/w;\r\nend","test_suite":"%%\r\nx=2; w=1.5; m=drying(x,w);\r\nm_correct = 69;\r\nassert(round(m)==m_correct)\r\n%%\r\nx=3; w=2; m=drying(x,w);\r\nm_correct = 69;\r\nassert(round(m)==m_correct)\r\n%%\r\nx=5; w=2; m=drying(x,w);\r\nm_correct = 139;\r\nassert(round(m)==m_correct)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2012-03-06T17:52:02.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-02T17:09:51.000Z","updated_at":"2025-05-13T14:59:54.000Z","published_at":"2012-03-13T16:01:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eVeronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHow many minutes she should wait so that the sweater weighs w times its dry weight?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease try a general solution, the test suite may expand later.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":49788,"title":"Carmichael Number","description":"Car    michael number is a composite number  which satisfy following relation:\r\n    \r\nfor all integers  which are coprime to .\r\nFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation  is true for all integers  that are not divisible by 3, 11, or 17 (coprime to 561).\r\nBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\r\nHint: Since  can become a big number, using a modular exponentiation algorithm may help.","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: 213px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 106.5px; transform-origin: 407px 106.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Carmichael_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCar    michael number\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: 75px 8px; transform-origin: 75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a composite number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 98px 8px; transform-origin: 98px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e which satisfy following relation:\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: 8px 8px; transform-origin: 8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e    \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN8AAAAnCAYAAACPOJ1YAAAIPklEQVR4Xu2cS+htUxzH752TMGKAYkB5lWdkIo8SCeWdFHkMJIliIEmIgaS8om7S9ZgYkEJRRB4TzxgwIDHyijm/T63v7Xd367XP2Y9z9l2rfp39/++91+O7ft/1e6x1zs4drTQEGgKzILBzllZbow2BhsCORr6mBA2BmR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9tFWbJH2m+yxPufu+1Mu3YSdFB0SxJTbW076puNvjIdzpRQdbcOKfWxSOpfs9T6Ww/ALCdbueJOc8VEfs+SPgYpC3mBCwPmLCUdqOIPHTw48bzL2t6zXUaxtehfXinODnJOUsqj/TDDfyB7jF8VKX6ZFca434XCyCiEIh5Z1ygP98McLUfLdQT/ISt5pomNY1KH7uGp+0aYt/fQDsZ0OSb9u17kv+lI3beiQN/3DmuMSPhU6TR3gWGMkPLlihPHfkKdO2smFWyymnIfNHjypyXq5OWiXC0EA68JCWrJ+CxnupMOoxraRb9J52ajGev3S1kb1fHM7I6+C35PFHc6WRr4SQsu+j3u0y2SJv+Uyx8z1wrORb44p2qw2sYDvNwKuPSm9cWzkWxvzRVRAnDL09ywXAUzlIEjI4HL2SkY28lWi2x5rCAyNQCPf0Ii2+hoClQg08lUC1R5rCAyNQCPf0Ii2+hoClQg08lUC1R5rCAyNwP9OrFhG4Buw9QAAAABJRU5ErkJggg==\" width=\"111.5\" height=\"19.5\" style=\"width: 111.5px; height: 19.5px;\"\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: 47px 8px; transform-origin: 47px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efor all integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 69px 8px; transform-origin: 69px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e which are coprime to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 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=\"\"\u003eFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation \u003c/span\u003e\u003c/span\u003e\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6ProFpiYXrNV4mTX/1wzDqhfvxQertmyNvV0q2XawT19PcFDV78xc/rsWPsVEo0RYZQele3/EeDai7puAYRxVW/MrBuun7UiDgySY/fcK5LSCm6LBz/VaIovS1wBO5d+y8Hy6+BeuoxWekMKW7k3eq50cv3mWQ5glGteALFzkA7urlGdAxPlQAf3RAXbl9U50MHddaBzYKIc6OCeqGD7sjoHOri7DnQOTJQD/wFLmQVV/jzgrwAAAABJRU5ErkJggg==\" width=\"123.5\" height=\"19.5\" style=\"width: 123.5px; height: 19.5px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 70.5px 8px; transform-origin: 70.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is true for all integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 150.533px 8px; transform-origin: 150.533px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that are not divisible by 3, 11, or 17 (coprime to 561).\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: 304px 8px; transform-origin: 304px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\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: 35.5px 8px; transform-origin: 35.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHint: Since \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAAmCAYAAAB+mDPLAAACq0lEQVRoQ+1YSytFURRmroSRCYoBpRh4DGSIkhHlMSaPgWRAMZAMEAMZecRMefwDlIGRx0QZMGAiMSJizvdpr1rd9jl299zTPYez6+se136sb61vrbXPzc35ByP3H3DMSUj+lSgnkYxJJHtg5wowDuzbbI5zJFtBqAsYNMR6/yLJepC6BM6ARiAjJLnpK3AfMRkHIkk5zAH5QOVvksgi8UAkxe4bRbLIRNOL0xL+UQOUAKfAFLAGdAO3QFUIzsgISdnE1Uh9aCdIbQOrxlEVIcg9MMlCGPVivL+Mz0mHSHxgDvEAzABHwJNZ1xxFkuxBe8bANmOwH08WpwszYRqfC0A5cGfWcg8ZEgEHv/lKPXAk2VyZT59AKcDq6jeYkxMApd1k5g/jk3kppGU9HVLgwtDMoSJsIzBJyqzYEgUv2+TAEUxYN5PEUQ34m30t0yMQSZEZjZIoMCpjgLSUczyPKuO/8PwMVJsocq3kI79rAaxXrwDMA5Fk+Z83h7Mq8pmFYwegdCljGWwtdcAhQFlJ7kmOHuC7N+AkBJLS4tK68dBgXgiYX6yUNJIylLyU/CNRRroM4D1SH0Y1XBlPMFdFwso/aT/SgQPmTG5CO2eBY2Xjz+Z+F3RKj4Pyuwb6UhbTAXQExyYwlLa5IS/0IqlbBytrLZB6Z9UkXXtoyHTs23uR3FAySC39spOWq0sPzQpBP7lK60itlNpQSXjdE7NGxO9gWyR16/DKNS1V3RNjQ1JuKDTYq4FLFNkadMWNDUlpHV5SlXylTDssBSlyRG1y5RtEHmB7tZIox4agrfDotwhNkq9cuwBzke1iEfjtsh6ZiNoiSSL9QDvwCLwD/AmEb/pbQBiX7FAdEuefJJ0dk5B0dlXEJyaRjHiAnM1LIunsqohPTCIZ8QA5m/cNCF+eJwmYmggAAAAASUVORK5CYII=\" width=\"28.5\" height=\"19\" style=\"width: 28.5px; height: 19px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 112.5px 8px; transform-origin: 112.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can become a big number, using a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Modular_exponentiation\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003emodular exponentiation\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: 63.5px 8px; transform-origin: 63.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e algorithm may help.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isCarmichael(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 13;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 561;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 560;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 561;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 1105;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 1729; % This is also Ramanujan number :D\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 8911;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 9871;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 41041;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 999959;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":392030,"edited_by":223089,"edited_at":"2023-08-22T07:18:33.000Z","deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2023-08-22T07:18:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-01-07T09:29:19.000Z","updated_at":"2026-01-02T13:01:52.000Z","published_at":"2021-01-07T09:30:13.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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Carmichael_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCar    michael number\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a composite number \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e which satisfy following relation:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e    \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{n-1} \\\\equiv 1\\\\ (\\\\textnormal{mod}\\\\; n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor all integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e which are coprime to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{560} \\\\equiv 1\\\\ (\\\\textnormal{mod}\\\\; 561)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is true for all integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that are not divisible by 3, 11, or 17 (coprime to 561).\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\u003eBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: Since \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{n-1}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e can become a big number, using a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Modular_exponentiation\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emodular exponentiation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e algorithm may help.\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":52432,"title":"tetration","description":"About tetration.\r\n\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 90.0276px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.491px 45.0138px; transform-origin: 406.497px 45.0138px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.5882px; 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: 383.49px 10.2941px; text-align: left; transform-origin: 383.496px 10.2941px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAbout \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Tetration\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003etetration\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 23.7247px; 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: 383.49px 11.8566px; text-align: left; transform-origin: 383.496px 11.8624px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAAAtCAYAAAA+w/DiAAAAAXNSR0IArs4c6QAAB4ZJREFUeF7tnGWoLVUUx3/PxG5ERVRQREVFFFHs/qBioNgtdovdhYXdid1ioagYmBiIior4ycJCRUXs5KdrHnPnndjn3FNz797wPrxz5+y9Zq3/rPivNWcKeWUN1EADU2ogYxYxa4AM1AyCWmggA7UWZspCZqBmDNRCAxmogzfTvMA+wBbAcsBLwHXAw8CfgxenHidmoA7WTgsAVwJfAo8CqwKHAjMC+wF3Av8MVqR6nJaBOlg77QXMD1xQ8p7rA7cBbwO7AN8MVqR6nJaBOjg7zQIcE2H+s9KxcwHXA0sB2wEfDE6k+pyUgTo4W6lrwfpLJbz72UXA0sBOwOeDE6k+J2WgDt9WhUcVoEcDvw1fpNGTIAN1+Dax8r8ZOAJ4fvjijKYEGajDtcsMwLHAH5UCa7hSjeDpzYC6PHB4cH2KfT9wBvDpCN7DqIjUDT+6Tuj4JOC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" width=\"85\" height=\"22.5\" style=\"width: 85px; height: 22.5px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 27.7229px; 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: 383.49px 13.8557px; text-align: left; transform-origin: 383.496px 13.8614px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASoAAAA1CAYAAAD2zabVAAAAAXNSR0IArs4c6QAADPpJREFUeF7tnXWsPjsRhp+LE9zd3SEQ3N09uLs7XNwu7u7uroEEd/fgEDy4BHfL80tLepfVb/fb3e+caXL+Od92207bt9OZd2YPIkpIICQQEli5BA5aef+ieyGBkEBIgACqWAQhgZDA6iUQQLX6KYoOhgRCAgFUsQZCAiGB1UsggGq9U3Rs4DbA1YCzAB8Dng+8DfjnersdPQsJTC+BAKrpZTrFG48HPAv4GfAO4LzAXYHDA7cDXg38Z4qG4h0hgV2QQADVOmfplsBxgScW2tMlgVcAXwJuDPxqnV2PXoUEppdAANX0Mh37xiMDB6dr3o+Llx0DeAFwOuC6wDfHNhT1QwK7IoEAqvXNlHMiWP2lcr3zf08GzgDcEPjJ+roePQoJbEcCAVTbkes23po1KgHqPsDfttFIvDMksEYJBFCtcVbq+6Tn76XAPYAP7063o6chgfESCKAaL8M53nA44L7APyoG9jnajjZCAotLIIBq/inYhB91scSnehDwp/m7HC2GBJaVQADVvPLfhB91JuCewAOAn8/b3WgtJLAOCQRQzTsPQ/lRJwAema57X5+3q9FaSGA9Egigmm8uhvKj1L4emPhUXym6qb3qZsDbQ8Oab/KipWUlEEA1n/yH8KOOAjwOOA7whUoXT5s4VA8H/jVf96OlkMByEgigWk72ue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qAbvqcR9T1/7YX6+FZqcwFrjUjv1drUks0OZWp7BsMt7/TesYoCpJaV3rZBe+RZdtKV5h+5Smk7BP3b38TJWP0zVWNfEyDKbr+b3ye5mk0Y19r0RoVX7aegSpD1TCUnK0h+lWLDLiPQgMTM7B8Dqx1GyqoSxj6mpf9HaR0zZpLNfM89l0bZdfaJ/0+jURTDcZ72igUksy5YknQZ/SRmzrU3+OZ2RBexpVmbZ1bbelJ5mjr2tu44pJU6jLkFrX770SB7rpnMgtM+zHtNcWc0tJ4ZCTZCxjNfHd2VLmBT8N5vXQItD5iTA1nW+1XKHH1D1ZsjOqJQt6asmCkm0b/qPTqS5JX1UuQ8d7oP4YjWrTiYl6IYGQQEhgkAQCqAaJKx4OCYQElpBAANUSUo82QwIhgUESCKAaJK54OCQQElhCAgFUS0g92gwJhAQGSSCAapC44uGQQEhgCQkEUC0h9WgzJBASGCSBAKpB4oqHQwIhgSUkEEC1hNSjzZBASGCQBP4L40GbYwD48+oAAAAASUVORK5CYII=\" width=\"149\" height=\"26.5\" style=\"width: 149px; height: 26.5px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = tetration(a,n)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 2;\r\nn = 2;\r\ny_correct = '4';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n%%\r\na = 2;\r\nn = 3;\r\ny_correct = '16';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 2;\r\nn = 4;\r\nassert(rem(str2num(tetration(a,n)),2)==0)\r\n\r\n\r\n%%\r\na = 1;\r\nn = 20;\r\ny_correct = '1';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 1;\r\ny_correct = '3';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 99;\r\nn = 1;\r\ny_correct = '99';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 2;\r\ny_correct = '27';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 3;\r\ny_correct = '7625597484987';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 4;\r\nn = 2;\r\ny_correct = '256';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 4;\r\nn = 3;\r\ny_correct = '13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 1;\r\ny_correct = '5';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 2;\r\ny_correct = '3125';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 3;\r\ny_correct = '1911012597945477520356404559703964599198081048990094337139512789246520530242615803012059386519739850265586440155794462235359212788673806972288410146915986602087961896757195701839281660338047611225975533626101001482651123413147768252411493094447176965282756285196737514395357542479093219206641883011787169122552421070050709064674382870851449950256586194461543183511379849133691779928127433840431549236855526783596374102105331546031353725325748636909159778690328266459182983815230286936572873691422648131291743762136325730321645282979486862576245362218017673224940567642819360078720713837072355305446356153946401185348493792719514594505508232749221605848912910945189959948686199543147666938013037176163592594479746164220050885079469804487133205133160739134230540198872570038329801246050197013467397175909027389493923817315786996845899794781068042822436093783946335265422815704302832442385515082316490967285712171708123232790481817268327510112746782317410985888683708522000711733492253913322300756147180429007527677793352306200618286012455254243061006894805446584704820650982664319360960388736258510747074340636286976576702699258649953557976318173902550891331223294743930343956161328334072831663498258145226862004307799084688103804187368324800903873596212919633602583120781673673742533322879296907205490595621406888825991244581842379597863476484315673760923625090371511798941424262270220066286486867868710182980872802560693101949280830825044198424796792058908817112327192301455582916746795197430548026404646854002733993860798594465961501752586965811447568510041568687730903712482535343839285397598749458497050038225012489284001826590056251286187629938044407340142347062055785305325034918189589707199305662188512963187501743535960282201038211616048545121039313312256332260766436236688296850208839496142830484739113991669622649948563685234712873294796680884509405893951104650944137909502276545653133018670633521323028460519434381399810561400652595300731790772711065783494174642684720956134647327748584238274899668755052504394218232191357223054066715373374248543645663782045701654593218154053548393614250664498585403307466468541890148134347714650315037954175778622811776585876941680908203125';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 6;\r\nn = 2;\r\ny_correct = '46656';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 7;\r\nn = 2;\r\ny_correct = '823543';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 8;\r\nn = 2;\r\ny_correct = '16777216';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 9;\r\nn = 2;\r\ny_correct = '387420489';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 10;\r\nn = 2;\r\ny_correct = '10000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 11;\r\nn = 2;\r\ny_correct = '285311670611';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 12;\r\nn = 2;\r\ny_correct = '8916100448256';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 13;\r\nn = 2;\r\ny_correct = '302875106592253';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 14\r\nn = 2;\r\ny_correct = '11112006825558016';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 15;\r\nn = 2;\r\ny_correct = '437893890380859375';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 16;\r\nn = 2;\r\ny_correct = '18446744073709551616';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 17;\r\nn = 2;\r\ny_correct = '827240261886336764177';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 30;\r\nn = 2;\r\ny_correct = '205891132094649000000000000000000000000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 50;\r\nn = 2;\r\ny_correct = '8881784197001252323389053344726562500000000000000000000000000000000000000000000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-05T16:24:50.000Z","updated_at":"2025-08-01T13:46:38.000Z","published_at":"2021-08-05T16:24:50.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\u003eAbout \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Tetration\\\"\u003e\u003cw:r\u003e\u003cw:t\u003etetration\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e^3 2= 2^{2^2} = 16\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e^4 2 = 2^{2^{2^2}} = 2^{16} = 65536\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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":44478,"title":"Exponential decay","description":"Many dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See \u003chttps://en.wikipedia.org/wiki/Exponential_decay\u003e for more background. \r\n\r\nAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\r\n\r\nx'(t) = - x(t) / tau\r\n\r\nwhere x'(t) is the first derivative of x(t), and time constant tau is 2.\r\n\r\nWrite a function that returns the value x for a given input t. It should be able to deal with a vector input. ","description_html":"\u003cp\u003eMany dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See \u003ca href = \"https://en.wikipedia.org/wiki/Exponential_decay\"\u003ehttps://en.wikipedia.org/wiki/Exponential_decay\u003c/a\u003e for more background.\u003c/p\u003e\u003cp\u003eAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\u003c/p\u003e\u003cp\u003ex'(t) = - x(t) / tau\u003c/p\u003e\u003cp\u003ewhere x'(t) is the first derivative of x(t), and time constant tau is 2.\u003c/p\u003e\u003cp\u003eWrite a function that returns the value x for a given input t. It should be able to deal with a vector input.\u003c/p\u003e","function_template":"function x = decay(t)\r\n  x = 1 - t;\r\nend","test_suite":"%%\r\nt = 0;\r\nx_correct = 1;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2;\r\nx_correct = exp(-1);\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2000;\r\nx_correct = 0;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = 2e-5;\r\nx_correct = 1 - 1e-5;\r\nassert(abs(decay(t)-x_correct)\u003c1e-10)\r\n%%\r\nt = [0 1 2];\r\nx_correct = [1 exp(-0.5) exp(-1)];\r\nassert(all(abs(decay(t)-x_correct)\u003c1e-10))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":160977,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-03T21:30:22.000Z","updated_at":"2026-04-03T06:48:44.000Z","published_at":"2018-01-03T21:30:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMany dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Exponential_decay\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Exponential_decay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt; for more background.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex'(t) = - x(t) / tau\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere x'(t) is the first derivative of x(t), and time constant tau is 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that returns the value x for a given input t. It should be able to deal with a vector input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1762,"title":"Create incrementing array","description":"Given a and b generate an output matrix as shown in following examples:\r\n\r\n a=2\r\n b=5\r\n output=[2 20 200 2000 20000]\r\n\r\n a=4\r\n b=3\r\n output=[4 40 400]","description_html":"\u003cp\u003eGiven a and b generate an output matrix as shown in following examples:\u003c/p\u003e\u003cpre\u003e a=2\r\n b=5\r\n output=[2 20 200 2000 20000]\u003c/pre\u003e\u003cpre\u003e a=4\r\n b=3\r\n output=[4 40 400]\u003c/pre\u003e","function_template":"function y = your_fcn_name(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nb =3;\r\ny_correct = [1 10 100];\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n%%\r\na = 5;\r\nb =1;\r\ny_correct = [5];\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n\r\n%%\r\na = 7;\r\nb =6;\r\ny_correct = [7 70 700 7000 70000 700000]\r\nassert(isequal(your_fcn_name(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":294,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-30T07:33:22.000Z","updated_at":"2026-02-18T15:45:17.000Z","published_at":"2013-07-30T07:33:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a and b generate an output matrix as shown in following examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ a=2\\n b=5\\n output=[2 20 200 2000 20000]\\n\\n a=4\\n b=3\\n output=[4 40 400]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1172,"title":"Wheat on a chessboard pt 1","description":"If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\r\n\r\nAssume the chess board is n by n squares.","description_html":"\u003cp\u003eIf a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\u003c/p\u003e\u003cp\u003eAssume the chess board is n by n squares.\u003c/p\u003e","function_template":"function y = wheat_chess(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 0;\r\ny_correct = 0;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = -1;\r\ny_correct = 'NaN';\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 4;\r\ny_correct = 65535;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 8;\r\ny_correct = 18446744073709551615;\r\nassert(isequal(wheat_chess(n),y_correct))\r\n\r\n%%\r\nn = 10;\r\ny_correct = 1267650600228229401496703205375;\r\nassert(isequal(wheat_chess(n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":7,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":192,"test_suite_updated_at":"2013-01-08T15:42:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-04T15:52:05.000Z","updated_at":"2026-03-31T14:13:16.000Z","published_at":"2013-01-04T15:52:05.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successive square after had double the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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\u003eAssume the chess board is n by n squares.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42848,"title":"Lambert's W","description":"Matlab cody does not support lambertw. Try to create a lambert's w function yourself.\r\n\r\nLambert's W is the function that solves \r\n\r\n  x*exp(x) = A;\r\n\r\ngiven the value of A.\r\n\r\nRead more about Lambert's W \u003chttps://en.wikipedia.org/wiki/Lambert_W_function here\u003e.\r\n\r\nThough it is not particularly appropriate for this particular function, consider using \u003chttps://en.wikipedia.org/wiki/Newton's_method Newton-Raphson's method\u003e. Since all test cases will converge if starting with 0.\r\n\r\nThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.","description_html":"\u003cp\u003eMatlab cody does not support lambertw. Try to create a lambert's w function yourself.\u003c/p\u003e\u003cp\u003eLambert's W is the function that solves\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex*exp(x) = A;\r\n\u003c/pre\u003e\u003cp\u003egiven the value of A.\u003c/p\u003e\u003cp\u003eRead more about Lambert's W \u003ca href = \"https://en.wikipedia.org/wiki/Lambert_W_function\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThough it is not particularly appropriate for this particular function, consider using \u003ca href = \"https://en.wikipedia.org/wiki/Newton's_method\"\u003eNewton-Raphson's method\u003c/a\u003e. Since all test cases will converge if starting with 0.\u003c/p\u003e\u003cp\u003eThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.\u003c/p\u003e","function_template":"function x = LambertW(A)\r\n  y = log(x);\r\nend","test_suite":"%%\r\nA = 1;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n\r\n%%\r\nA = 6.8;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n\r\n%%\r\nA = 14;\r\nx = LambertW(A);\r\nA_correct = x*exp(x);\r\nassert(abs(A_correct/A-1)\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12767,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-05-05T14:37:35.000Z","updated_at":"2025-12-07T18:24:23.000Z","published_at":"2016-05-05T14:38:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMatlab cody does not support lambertw. Try to create a lambert's w function yourself.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLambert's W is the function that solves\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x*exp(x) = A;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003egiven the value of A.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRead more about Lambert's W\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Lambert_W_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThough it is not particularly appropriate for this particular function, consider using\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Newton's_method\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eNewton-Raphson's method\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Since all test cases will converge if starting with 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe relative tolerance for the result of x*exp(x) compared to A is 1e-5.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1174,"title":"Wheat on a chessboard pt 2","description":"If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\r\n\r\nAssume the chess board is n by n squares.","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: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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: 136px 8px; transform-origin: 136px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume the chess board is n by n squares.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function A = wheat_chess(x,y,n)\r\n  A = x + y + n;\r\nend","test_suite":"%%\r\nx = 56;\r\ny = 1;\r\nn = 1;\r\nA_correct = 56;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 2;\r\nn = 8;\r\nA_correct = 18446744073709551615;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 5;\r\ny = 3;\r\nn = 2;\r\nA_correct = 200;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 10;\r\ny = 5;\r\nn = 3;\r\nA_correct = 4882810;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\nn = 1;\r\nA_correct = 1;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 12;\r\ny = 1;\r\nn = 3;\r\nA_correct = 108;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n\r\n%%\r\nx = 0;\r\ny = 1e5;\r\nn = 7;\r\nA_correct = 0;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))\r\n\r\n%%\r\nx = 6;\r\ny = 2;\r\nn = 4;\r\nA_correct = 393210;\r\nassert(isequal(wheat_chess(x,y,n),A_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":6,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":"2021-05-05T10:17:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-04T18:21:52.000Z","updated_at":"2026-02-15T07:12:03.000Z","published_at":"2013-01-04T18:21:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successive square after had y times the amount of grains as the square before. How many grains of wheat would be on the chessboard at the finish?\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\u003eAssume the chess board is n by n squares.\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":441,"title":"Drying sweater?","description":"* A sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes. \r\n* Veronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer. \r\n* How many minutes she should wait so that the sweater weighs w times its dry weight? \r\n* Please try a general solution, the test suite may expand later.","description_html":"\u003cul\u003e\u003cli\u003eA sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes.\u003c/li\u003e\u003cli\u003eVeronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer.\u003c/li\u003e\u003cli\u003eHow many minutes she should wait so that the sweater weighs w times its dry weight?\u003c/li\u003e\u003cli\u003ePlease try a general solution, the test suite may expand later.\u003c/li\u003e\u003c/ul\u003e","function_template":"function m = drying(x,w)\r\n   m=x/w;\r\nend","test_suite":"%%\r\nx=2; w=1.5; m=drying(x,w);\r\nm_correct = 69;\r\nassert(round(m)==m_correct)\r\n%%\r\nx=3; w=2; m=drying(x,w);\r\nm_correct = 69;\r\nassert(round(m)==m_correct)\r\n%%\r\nx=5; w=2; m=drying(x,w);\r\nm_correct = 139;\r\nassert(round(m)==m_correct)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2012-03-06T17:52:02.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-02T17:09:51.000Z","updated_at":"2025-05-13T14:59:54.000Z","published_at":"2012-03-13T16:01:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA sweater is revolving in a slow low power dryer and losing moisture at any moment at the constant rate 100% of its current moisture content in 100 minutes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eVeronica knew the sweater was x times its dry weight when she put her wet sweater from the washer to the dryer.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHow many minutes she should wait so that the sweater weighs w times its dry weight?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease try a general solution, the test suite may expand later.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":49788,"title":"Carmichael Number","description":"Car    michael number is a composite number  which satisfy following relation:\r\n    \r\nfor all integers  which are coprime to .\r\nFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation  is true for all integers  that are not divisible by 3, 11, or 17 (coprime to 561).\r\nBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\r\nHint: Since  can become a big number, using a modular exponentiation algorithm may help.","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: 213px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 106.5px; transform-origin: 407px 106.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Carmichael_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eCar    michael number\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: 75px 8px; transform-origin: 75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a composite number \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 98px 8px; transform-origin: 98px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e which satisfy following relation:\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: 8px 8px; transform-origin: 8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e    \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN8AAAAnCAYAAACPOJ1YAAAIPklEQVR4Xu2cS+htUxzH752TMGKAYkB5lWdkIo8SCeWdFHkMJIliIEmIgaS8om7S9ZgYkEJRRB4TzxgwIDHyijm/T63v7Xd367XP2Y9z9l2rfp39/++91+O7ft/1e6x1zs4drTQEGgKzILBzllZbow2BhsCORr6mBA2BmRBo5JsJ+NZsQ6CRr+lAQ2AmBJZAvisMu8dN7jB5dSYcW7MNgd4IbDP5zrPRXmZyUxj1lY18veefFw4yudnk4ZXebi+BwJEmJ/fVv20m3yk22M9NPjE5zaSRrz8RIN5bJrcFLPvX0N4QAo/axeEmeGJVpQ/5UPY/TH6sqnm6hxr5VsMa4n1kct0CiQcBzjbBok9ZFPZUETBHPty6B0wOMDk6jGATrctSyHeLYXyfycUTkQHcPjC5e0rtHLEt8LvEBL2l/Guy/4jtpaoG110mz5TarrF83znyHWzXWL9UwfSeYHJYmNh77PNpk8tNvjc5ptShFe5vO/lEukPC2E+1T9zpMQvzdK3JoWM2MkPdxF5fmOxnMhf58BDfMznRJOsl1pBPyl1LHk+GS60DL5g8YYL1PKrUoRUmbFvJxyTdGMZ7dVAY/hybfLibP5ncZVJcnVeYj7lfkT7MRT7Gj/tJ/Hd6DowS+Zio30MFj9lnjYvyjz2H/GyCG/WOya+hjrMa+fZMB6u0VkYsEWSYgnxLtXoCdhPIh+v7dmkhLZGPwPGVMKrzA5FyZGY1/yw8cK99kr5GyX4I71JHF6RcfbqXs7rbavn8uKckHwvjbpOpkxE18zzEM5tAPsaBwfnQJJl8KZEP80m8h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rPYjJVOpQGrMP1FNS5KEgkEKX9ndpr2RBSn1O3ZfrWMpGdtuvtZqlfqew9HrPwuDdTd5RvFd74ET9TWbhY5Pgg8rUBqFWiG4Keigl2dfqKSnyUHionZpkQUmJS31O3ffWJWdB5H15C+mTgENnO73exyyrkj0ld1lzVcQ6Rj41knI5fdBJKnbTvlw7lKJOWU9JkYfqi/Zda/ZExyKfV/KUZ+WtkO+rdDPnepb6ncJSdacsmxJAIiaHETA+Kf2nvuNMkl/bipFPjcQ2OAUc95ZAvH0t4YLiYVGyB36DdpaUuLRg5O77eC5mhfVu18p056vrmfmD/QyjxsKLjNL7mGXz2X/q5KQWR++622+e2Fjp7C5Al3y+8558ZG5eNmHwVPiISemQ9VCr9Zj1bAr5vDLWWKV1MEGxidNLB+Xl9tFWbJH2m+yxPufu+1Mu3YSdFB0SxJTbW076puNvjIdzpRQdbcOKfWxSOpfs9T6Ww/ALCdbueJOc8VEfs+SPgYpC3mBCwPmLCUdqOIPHTw48bzL2t6zXUaxtehfXinODnJOUsqj/TDDfyB7jF8VKX6ZFca434XCyCiEIh5Z1ygP98McLUfLdQT/ISt5pomNY1KH7uGp+0aYt/fQDsZ0OSb9u17kv+lI3beiQN/3DmuMSPhU6TR3gWGMkPLlihPHfkKdO2smFWyymnIfNHjypyXq5OWiXC0EA68JCWrJ+CxnupMOoxraRb9J52ajGev3S1kb1fHM7I6+C35PFHc6WRr4SQsu+j3u0y2SJv+Uyx8z1wrORb44p2qw2sYDvNwKuPSm9cWzkWxvzRVRAnDL09ywXAUzlIEjI4HL2SkY28lWi2x5rCAyNQCPf0Ii2+hoClQg08lUC1R5rCAyNQCPf0Ii2+hoClQg08lUC1R5rCAyNwP9OrFhG4Buw9QAAAABJRU5ErkJggg==\" width=\"111.5\" height=\"19.5\" style=\"width: 111.5px; height: 19.5px;\"\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: 47px 8px; transform-origin: 47px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efor all integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 69px 8px; transform-origin: 69px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e which are coprime to \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 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=\"\"\u003eFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPcAAAAnCAYAAADTst58AAAJ90lEQVR4Xu2dW8htUxTHnXcSnkgID0Qo14giUSKh3NMpcnmQJMLTSeJEnjy4hCS5hkTKJYqc3Mo9HigkntzinfGr/T+Npnlbe+6197fXN1eNzrf3XmuuOccY/3GbY62zZZd+dA50DkySA1smuaq+qM6BzoFdOri7EnQOTJQDHdwTFWxfVufAMsF9kbH72c7yzoHOgeVwYCxwA+ILgyW8YZ/PTCzrWvv+PKMfjD41es7o99m5e9q/D7jr9re/rzf6eDks6nfpHFhPDowBbsD4ldGTAUvess8A3B/H2oeXjf4y2mYUenbG+tFoh9ElM8DfZv/eZXRcB/hgpYN3DznDOXiAfsHKOIDs7h5y9zHAfY9N4EijlJfW/AD220Y/G51t9H1k4ooAGMsbhr9n1x06ZLGb/Fx4+Y7Rg5ucD+u6fNLaG43OqjXOQ8ANGAmVYyD0DAN4Xxs9bvRm4nx5971nRiD06IzHOb/NBt4rWNAH9vn4zLXrKsCx5g2wPzMaZPnHmswCx0UnrzLCoZT0cp7bMv6BRkNqRbrmaLvujwXznPT1BqOTAj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Fsws7FjgZngPwFgUIbmEjiTs/Q5DYN88w31qIpQwHw7bavW7dDwVbajtk/NjobmMGuPHjIN3bC3gRm4cyfcZhOD2E/fghplPGzEZFr3daN6HSFbhtTcKuL2yj90boDWXdjL8PnPM2Psmllj+WPt7GKL6l2PSBhu2n+ode+r4Qh/pRacTTG88UbMIOoWX9N1zKT0LW1cZd5sRrbW84YVWUt5AlHsM1KeunidqYtnXrvfttqm5zKsPVY+rxoSJUug1NrSH0qwPQ+kieyQihFWAdd3uiRB9n7bmj0LC17GMJdY99bIGFHSrke+rxoPeb8R2lPTAtxkDUEJ99IC+bB7o4Dwd+l1v09H3oU7R8YhO8aop0ryUo4g9pLLDzqdDkd5w+sIZg9y49k0zajX1ffFqrUUWzKdmLD831smaOOA3Hj03Rqs+6ProFpiYXrNV4mTX/1wzDqhfvxQertmyNvV0q2XawT19PcFDV78xc/rsWPsVEo0RYZQele3/EeDai7puAYRxVW/MrBuun7UiDgySY/fcK5LSCm6LBz/VaIovS1wBO5d+y8Hy6+BeuoxWekMKW7k3eq50cv3mWQ5glGteALFzkA7urlGdAxPlQAf3RAXbl9U50MHddaBzYKIc6OCeqGD7sjoHOri7DnQOTJQD/wFLmQVV/jzgrwAAAABJRU5ErkJggg==\" width=\"123.5\" height=\"19.5\" style=\"width: 123.5px; height: 19.5px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 70.5px 8px; transform-origin: 70.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is true for all integers \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eb\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 150.533px 8px; transform-origin: 150.533px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e that are not divisible by 3, 11, or 17 (coprime to 561).\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: 304px 8px; transform-origin: 304px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\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: 35.5px 8px; transform-origin: 35.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHint: Since \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAAmCAYAAAB+mDPLAAACq0lEQVRoQ+1YSytFURRmroSRCYoBpRh4DGSIkhHlMSaPgWRAMZAMEAMZecRMefwDlIGRx0QZMGAiMSJizvdpr1rd9jl299zTPYez6+se136sb61vrbXPzc35ByP3H3DMSUj+lSgnkYxJJHtg5wowDuzbbI5zJFtBqAsYNMR6/yLJepC6BM6ARiAjJLnpK3AfMRkHIkk5zAH5QOVvksgi8UAkxe4bRbLIRNOL0xL+UQOUAKfAFLAGdAO3QFUIzsgISdnE1Uh9aCdIbQOrxlEVIcg9MMlCGPVivL+Mz0mHSHxgDvEAzABHwJNZ1xxFkuxBe8bANmOwH08WpwszYRqfC0A5cGfWcg8ZEgEHv/lKPXAk2VyZT59AKcDq6jeYkxMApd1k5g/jk3kppGU9HVLgwtDMoSJsIzBJyqzYEgUv2+TAEUxYN5PEUQ34m30t0yMQSZEZjZIoMCpjgLSUczyPKuO/8PwMVJsocq3kI79rAaxXrwDMA5Fk+Z83h7Mq8pmFYwegdCljGWwtdcAhQFlJ7kmOHuC7N+AkBJLS4tK68dBgXgiYX6yUNJIylLyU/CNRRroM4D1SH0Y1XBlPMFdFwso/aT/SgQPmTG5CO2eBY2Xjz+Z+F3RKj4Pyuwb6UhbTAXQExyYwlLa5IS/0IqlbBytrLZB6Z9UkXXtoyHTs23uR3FAySC39spOWq0sPzQpBP7lK60itlNpQSXjdE7NGxO9gWyR16/DKNS1V3RNjQ1JuKDTYq4FLFNkadMWNDUlpHV5SlXylTDssBSlyRG1y5RtEHmB7tZIox4agrfDotwhNkq9cuwBzke1iEfjtsh6ZiNoiSSL9QDvwCLwD/AmEb/pbQBiX7FAdEuefJJ0dk5B0dlXEJyaRjHiAnM1LIunsqohPTCIZ8QA5m/cNCF+eJwmYmggAAAAASUVORK5CYII=\" width=\"28.5\" height=\"19\" style=\"width: 28.5px; height: 19px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 112.5px 8px; transform-origin: 112.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can become a big number, using a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Modular_exponentiation\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003emodular exponentiation\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: 63.5px 8px; transform-origin: 63.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e algorithm may help.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isCarmichael(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 13;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 561;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 560;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 561;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 1105;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 1729; % This is also Ramanujan number :D\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 8911;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 9871;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 41041;\r\ny_correct = true;\r\nassert(isequal(isCarmichael(x),y_correct))\r\n\r\n%%\r\nx = 999959;\r\ny_correct = false;\r\nassert(isequal(isCarmichael(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":392030,"edited_by":223089,"edited_at":"2023-08-22T07:18:33.000Z","deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2023-08-22T07:18:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-01-07T09:29:19.000Z","updated_at":"2026-01-02T13:01:52.000Z","published_at":"2021-01-07T09:30:13.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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Carmichael_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCar    michael number\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a composite number \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e which satisfy following relation:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e    \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{n-1} \\\\equiv 1\\\\ (\\\\textnormal{mod}\\\\; n)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor all integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e which are coprime to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, the smallest Carmichael number is 561. It has prime factors 3, 11, and 17, thus it is a composite number (not prime and not 1). The relation \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{560} \\\\equiv 1\\\\ (\\\\textnormal{mod}\\\\; 561)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is true for all integers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e that are not divisible by 3, 11, or 17 (coprime to 561).\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\u003eBuild a function isCarmichael(x) that returns true if x is a Carmichael number and false otherwise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: Since \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eb^{n-1}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e can become a big number, using a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Modular_exponentiation\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emodular exponentiation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e algorithm may help.\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":52432,"title":"tetration","description":"About tetration.\r\n\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 90.0276px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.491px 45.0138px; transform-origin: 406.497px 45.0138px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.5882px; 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: 383.49px 10.2941px; text-align: left; transform-origin: 383.496px 10.2941px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAbout \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Tetration\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003etetration\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 23.7247px; 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: 383.49px 11.8566px; text-align: left; transform-origin: 383.496px 11.8624px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAAAtCAYAAAA+w/DiAAAAAXNSR0IArs4c6QAAB4ZJREFUeF7tnGWoLVUUx3/PxG5ERVRQREVF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ga8441K7WqM9aFmONc0d0aOQtfehkNOz1Ox1WHSTv1uh1/F4nQFW3vtJkZ9PhHp1BmYsWJ84920yxY1VU/+MO/VbDJsW2R9utOsxaCkCVaAqTsrxWPrDu8wsp99rsGmePpZBM/Yyo7X6XoBi0d1DJEVEjsRy7IHYuVQ5VnlX6aky61W3VL/p9KjwwZbXKS1K+P4hrVJQVvjMK7dY0hHS7L0ygv5tv+srRptEAMfVz2a8XtHae7Ns3G4E0t18rxiXNSf2tLV8Xt7lk8VS8qzdGZd0CdQLpPd9KHTSQgVoHK2UZ+9KZymrNGui5BrJH7blK84b90EAGaj+0mvfsuQYyUHuu0rxhPzSQgdoPreY9e66BDNSeqzRv2A8NZKD2Q6t5z55r4F/8/bE9EnLWeAAAAABJRU5ErkJggg==\" width=\"85\" height=\"22.5\" style=\"width: 85px; height: 22.5px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 27.7229px; 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: 383.49px 13.8557px; text-align: left; transform-origin: 383.496px 13.8614px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASoAAAA1CAYAAAD2zabVAAAAAXNSR0IArs4c6QAADPpJREFUeF7tnXWsPjsRhp+LE9zd3SEQ3N09uLs7XNwu7u7uroEEd/fgEDy4BHfL80tLepfVb/fb3e+caXL+Od92207bt9OZd2YPIkpIICQQEli5BA5aef+ieyGBkEBIgACqWAQhgZDA6iUQQLX6KYoOhgRCAgFUsQZCAiGB1UsggGq9U3Rs4DbA1YCzAB8Dng+8DfjnersdPQsJTC+BAKrpZTrFG48HPAv4GfAO4LzAXYHD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xknGOxVQaVDTdS8npClTgjR8CZ99NvzSQCVIqcIaBd6UKUFPiWNacx6kpYFKkDKpnemE/fRXXRyba1BPX11sWJ9NOfaZuYHK/mZDuXSEphCiUhNxLaod9SmZJW4a56EpcMbUtW85q0WVdjJ6vFMAlcYz+RpGwTcZmvOCNabJ+MA1F08yPZVunLZrisHbR60Exa55XHP3zTnXEyQZ8eCWYFs1cQNeNbDveuRCXxmXBm+N5B6G1bHnwzrng+/71aGcuUJtbWhCwTF1PWzUmM9dky1l9HjHApXUeXkrsoEletWVoycSnh6AtX+LLrNsj5m0wzptyQ2oh8NYMrND7FpiwL6bacxzapuGsEg0VWOps8H4jMxqyY0eDF8d0+AO1pWmoY1KDliVoJrJq4K3DHN5ZN5EjH54OqAtyKwLT6gEMmuA16aqAbvqcR9T1/7YX6+FZqcwFrjUjv1drUks0OZWp7BsMt7/TesYoCpJaV3rZBe+RZdtKV5h+5Smk7BP3b38TJWP0zVWNfEyDKbr+b3ye5mk0Y19r0RoVX7aegSpD1TCUnK0h+lWLDLiPQgMTM7B8Dqx1GyqoSxj6mpf9HaR0zZpLNfM89l0bZdfaJ/0+jURTDcZ72igUksy5YknQZ/SRmzrU3+OZ2RBexpVmbZ1bbelJ5mjr2tu44pJU6jLkFrX770SB7rpnMgtM+zHtNcWc0tJ4ZCTZCxjNfHd2VLmBT8N5vXQItD5iTA1nW+1XKHH1D1ZsjOqJQt6asmCkm0b/qPTqS5JX1UuQ8d7oP4YjWrTiYl6IYGQQEhgkAQCqAaJKx4OCYQElpBAANUSUo82QwIhgUESCKAaJK54OCQQElhCAgFUS0g92gwJhAQGSSCAapC44uGQQEhgCQkEUC0h9WgzJBASGCSBAKpB4oqHQwIhgSUkEEC1hNSjzZBASGCQBP4L40GbYwD48+oAAAAASUVORK5CYII=\" width=\"149\" height=\"26.5\" style=\"width: 149px; height: 26.5px;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = tetration(a,n)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 2;\r\nn = 2;\r\ny_correct = '4';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n%%\r\na = 2;\r\nn = 3;\r\ny_correct = '16';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 2;\r\nn = 4;\r\nassert(rem(str2num(tetration(a,n)),2)==0)\r\n\r\n\r\n%%\r\na = 1;\r\nn = 20;\r\ny_correct = '1';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 1;\r\ny_correct = '3';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 99;\r\nn = 1;\r\ny_correct = '99';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 2;\r\ny_correct = '27';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 3;\r\nn = 3;\r\ny_correct = '7625597484987';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 4;\r\nn = 2;\r\ny_correct = '256';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 4;\r\nn = 3;\r\ny_correct = '13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 1;\r\ny_correct = '5';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 2;\r\ny_correct = '3125';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n\r\n%%\r\na = 5;\r\nn = 3;\r\ny_correct = '1911012597945477520356404559703964599198081048990094337139512789246520530242615803012059386519739850265586440155794462235359212788673806972288410146915986602087961896757195701839281660338047611225975533626101001482651123413147768252411493094447176965282756285196737514395357542479093219206641883011787169122552421070050709064674382870851449950256586194461543183511379849133691779928127433840431549236855526783596374102105331546031353725325748636909159778690328266459182983815230286936572873691422648131291743762136325730321645282979486862576245362218017673224940567642819360078720713837072355305446356153946401185348493792719514594505508232749221605848912910945189959948686199543147666938013037176163592594479746164220050885079469804487133205133160739134230540198872570038329801246050197013467397175909027389493923817315786996845899794781068042822436093783946335265422815704302832442385515082316490967285712171708123232790481817268327510112746782317410985888683708522000711733492253913322300756147180429007527677793352306200618286012455254243061006894805446584704820650982664319360960388736258510747074340636286976576702699258649953557976318173902550891331223294743930343956161328334072831663498258145226862004307799084688103804187368324800903873596212919633602583120781673673742533322879296907205490595621406888825991244581842379597863476484315673760923625090371511798941424262270220066286486867868710182980872802560693101949280830825044198424796792058908817112327192301455582916746795197430548026404646854002733993860798594465961501752586965811447568510041568687730903712482535343839285397598749458497050038225012489284001826590056251286187629938044407340142347062055785305325034918189589707199305662188512963187501743535960282201038211616048545121039313312256332260766436236688296850208839496142830484739113991669622649948563685234712873294796680884509405893951104650944137909502276545653133018670633521323028460519434381399810561400652595300731790772711065783494174642684720956134647327748584238274899668755052504394218232191357223054066715373374248543645663782045701654593218154053548393614250664498585403307466468541890148134347714650315037954175778622811776585876941680908203125';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 6;\r\nn = 2;\r\ny_correct = '46656';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 7;\r\nn = 2;\r\ny_correct = '823543';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 8;\r\nn = 2;\r\ny_correct = '16777216';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 9;\r\nn = 2;\r\ny_correct = '387420489';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 10;\r\nn = 2;\r\ny_correct = '10000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 11;\r\nn = 2;\r\ny_correct = '285311670611';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 12;\r\nn = 2;\r\ny_correct = '8916100448256';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 13;\r\nn = 2;\r\ny_correct = '302875106592253';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 14\r\nn = 2;\r\ny_correct = '11112006825558016';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 15;\r\nn = 2;\r\ny_correct = '437893890380859375';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 16;\r\nn = 2;\r\ny_correct = '18446744073709551616';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 17;\r\nn = 2;\r\ny_correct = '827240261886336764177';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 30;\r\nn = 2;\r\ny_correct = '205891132094649000000000000000000000000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n\r\n\r\n%%\r\na = 50;\r\nn = 2;\r\ny_correct = '8881784197001252323389053344726562500000000000000000000000000000000000000000000000000';\r\nassert(strcmp(tetration(a,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-05T16:24:50.000Z","updated_at":"2025-08-01T13:46:38.000Z","published_at":"2021-08-05T16:24:50.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\u003eAbout \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Tetration\\\"\u003e\u003cw:r\u003e\u003cw:t\u003etetration\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e^3 2= 2^{2^2} = 16\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e^4 2 = 2^{2^{2^2}} = 2^{16} = 65536\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:\"exponential\"","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:\"exponential\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"exponential\"","","\"","exponential","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c308\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fa2be62c268\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fa2be62b9a8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c588\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fa2be62c4e8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fa2be62c448\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fa2be62c3a8\u003e":"tag:\"exponential\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c3a8\u003e":"tag:\"exponential\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"exponential\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"exponential\"","","\"","exponential","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c308\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fa2be62c268\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fa2be62b9a8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c588\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fa2be62c4e8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fa2be62c448\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fa2be62c3a8\u003e":"tag:\"exponential\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fa2be62c3a8\u003e":"tag:\"exponential\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44478,"difficulty_rating":"easy"},{"id":1762,"difficulty_rating":"easy"},{"id":1172,"difficulty_rating":"easy-medium"},{"id":42848,"difficulty_rating":"easy-medium"},{"id":1174,"difficulty_rating":"easy-medium"},{"id":441,"difficulty_rating":"easy-medium"},{"id":49788,"difficulty_rating":"easy-medium"},{"id":52432,"difficulty_rating":"medium"}]}}