{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-05-26T00:16:20.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-05-26T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":44628,"title":"The other half of the Fibonacci sequence","description":"The \u003chttp://mathworld.wolfram.com/FibonacciNumber.html \"Fibonacci sequence\"\u003e — \r\nF = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from _circa_ 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \"Fibonacci\") _circa_ 1202 CE. \r\n\r\nThis sequence can be defined by \r\n\r\n*F(n+2) = F(n+1) + F(n)*\r\n\r\nin which F(1) = 1, F(2) = 1, F(3) = 2, ....\r\n\r\nLater in history, it was recognised that F(0) = 0.  Of course, this still satisfies the formula in bold above [for n=0]:  F(2) = F(1) + F(0).  \r\n\r\nYour job in this Cody Problem is to 'create history'(?) by extending this sequence to _negative values of n_, to discover the missing half of this sequence!\r\n\r\nEXAMPLE:\r\n\r\nIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\r\n\r\nYou are only required to provide outputs for n \u003c 3 that can be represented by an \u003chttps://au.mathworks.com/help/matlab/ref/int64.html |int64|\u003e \u003chttps://au.mathworks.com/help/matlab/numeric-types.html data type\u003e.  To enforce this, your output needs to be of this data type.  ","description_html":"\u003cp\u003eThe \u003ca href = \"http://mathworld.wolfram.com/FibonacciNumber.html\"\u003e\"Fibonacci sequence\"\u003c/a\u003e — \r\nF = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from \u003ci\u003ecirca\u003c/i\u003e 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \"Fibonacci\") \u003ci\u003ecirca\u003c/i\u003e 1202 CE.\u003c/p\u003e\u003cp\u003eThis sequence can be defined by\u003c/p\u003e\u003cp\u003e\u003cb\u003eF(n+2) = F(n+1) + F(n)\u003c/b\u003e\u003c/p\u003e\u003cp\u003ein which F(1) = 1, F(2) = 1, F(3) = 2, ....\u003c/p\u003e\u003cp\u003eLater in history, it was recognised that F(0) = 0.  Of course, this still satisfies the formula in bold above [for n=0]:  F(2) = F(1) + F(0).\u003c/p\u003e\u003cp\u003eYour job in this Cody Problem is to 'create history'(?) by extending this sequence to \u003ci\u003enegative values of n\u003c/i\u003e, to discover the missing half of this sequence!\u003c/p\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cp\u003eIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\u003c/p\u003e\u003cp\u003eYou are only required to provide outputs for n \u0026lt; 3 that can be represented by an \u003ca href = \"https://au.mathworks.com/help/matlab/ref/int64.html\"\u003e\u003ctt\u003eint64\u003c/tt\u003e\u003c/a\u003e \u003ca href = \"https://au.mathworks.com/help/matlab/numeric-types.html\"\u003edata type\u003c/a\u003e.  To enforce this, your output needs to be of this data type.\u003c/p\u003e","function_template":"% This was my logic:  ...\r\nfunction F = negativeRabbits(n)\r\n    % Here's how I implemented that conceptual logic in code:\r\n    n = F\r\nend","test_suite":"%% Ban str2num \u0026 str2double;  regexp \u0026 regexpi\r\n% Banning these to discourage hard-coded answers and silly 'scoring cheats'.  Sorry if it disrupts some legitimate usage.  \r\n% Please don't try any other hacks or workarounds.  \r\nassessFunctionAbsence({'str2num','str2double','regexp', 'regexpi'}, 'FileName','negativeRabbits.m');\r\nFR = fileread('negativeRabbits.m');\r\nmsg = 'Don''t hard-code your ''solution''.';\r\nassert( ~any( cellfun( @(z) contains(FR, z) , {'54800875592', '716768017756', '9845401187926'} ) ) , msg )\r\n\r\n%% Ban \"ans\" and a few hard-coded values (digits stripped)\r\n% I don't think it's very good style to be using \"ans\". \r\nRE = regexp(fileread('negativeRabbits.m'), '\\w+', 'match');\r\ntabooWords = {'ans'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not include the following banned strings in your code!' char([10 13]) ...\r\n    strjoin(RE(testResult)) char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\n%% Check data type\r\n% This is important.\r\nassert( isequal( class(negativeRabbits(0)) , 'int64' ) , 'Wrong data type.')\r\n\r\n%% Initial conditions and other such key values.  \r\n% Test Suite shall ensure it only ever checks n \u003c 3.  \r\nassert( isequal(negativeRabbits(+2), 1) , 'Failed at n =+2.' )\r\nassert( isequal(negativeRabbits(+1), 1) , 'Failed at n =+1.' )\r\nassert( isequal(negativeRabbits( 0), 0) , 'Failed at n = 0.' )\r\nassert( isequal(negativeRabbits(-1), 1) , 'Failed at n =-1.' )\r\n\r\n%% Terms from 0 down to -10\r\nfor n = 0 : -1 : -10\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -10 down to -20\r\nfor n = -10 : -1 : -20\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -20 down to -40\r\nfor n = -20 : -1 : -40\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -40 down to -77\r\nfor n = -40 : -1 : -77\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -77 down to -92\r\n% This is difficult, but feasible within the parameters of the problem.  \r\nfor n = -77 : -1 : -92\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2018-05-03T02:41:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-28T14:33:34.000Z","updated_at":"2026-05-29T04:27:18.000Z","published_at":"2018-04-28T16:25:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/FibonacciNumber.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\\\"Fibonacci sequence\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e — F = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecirca\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \\\"Fibonacci\\\")\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecirca\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 1202 CE.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis sequence can be defined by\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF(n+2) = F(n+1) + F(n)\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\u003ein which F(1) = 1, F(2) = 1, F(3) = 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\u003eLater in history, it was recognised that F(0) = 0. Of course, this still satisfies the formula in bold above [for n=0]: F(2) = F(1) + F(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\u003eYour job in this Cody Problem is to 'create history'(?) by extending this sequence to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enegative values of n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, to discover the missing half of this sequence!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\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\u003eYou are only required to provide outputs for n \u0026lt; 3 that can be represented by an\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://au.mathworks.com/help/matlab/ref/int64.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eint64\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/numeric-types.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edata type\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. To enforce this, your output needs to be of this data type.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"problems":[{"id":44628,"title":"The other half of the Fibonacci sequence","description":"The \u003chttp://mathworld.wolfram.com/FibonacciNumber.html \"Fibonacci sequence\"\u003e — \r\nF = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from _circa_ 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \"Fibonacci\") _circa_ 1202 CE. \r\n\r\nThis sequence can be defined by \r\n\r\n*F(n+2) = F(n+1) + F(n)*\r\n\r\nin which F(1) = 1, F(2) = 1, F(3) = 2, ....\r\n\r\nLater in history, it was recognised that F(0) = 0.  Of course, this still satisfies the formula in bold above [for n=0]:  F(2) = F(1) + F(0).  \r\n\r\nYour job in this Cody Problem is to 'create history'(?) by extending this sequence to _negative values of n_, to discover the missing half of this sequence!\r\n\r\nEXAMPLE:\r\n\r\nIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\r\n\r\nYou are only required to provide outputs for n \u003c 3 that can be represented by an \u003chttps://au.mathworks.com/help/matlab/ref/int64.html |int64|\u003e \u003chttps://au.mathworks.com/help/matlab/numeric-types.html data type\u003e.  To enforce this, your output needs to be of this data type.  ","description_html":"\u003cp\u003eThe \u003ca href = \"http://mathworld.wolfram.com/FibonacciNumber.html\"\u003e\"Fibonacci sequence\"\u003c/a\u003e — \r\nF = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from \u003ci\u003ecirca\u003c/i\u003e 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \"Fibonacci\") \u003ci\u003ecirca\u003c/i\u003e 1202 CE.\u003c/p\u003e\u003cp\u003eThis sequence can be defined by\u003c/p\u003e\u003cp\u003e\u003cb\u003eF(n+2) = F(n+1) + F(n)\u003c/b\u003e\u003c/p\u003e\u003cp\u003ein which F(1) = 1, F(2) = 1, F(3) = 2, ....\u003c/p\u003e\u003cp\u003eLater in history, it was recognised that F(0) = 0.  Of course, this still satisfies the formula in bold above [for n=0]:  F(2) = F(1) + F(0).\u003c/p\u003e\u003cp\u003eYour job in this Cody Problem is to 'create history'(?) by extending this sequence to \u003ci\u003enegative values of n\u003c/i\u003e, to discover the missing half of this sequence!\u003c/p\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cp\u003eIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\u003c/p\u003e\u003cp\u003eYou are only required to provide outputs for n \u0026lt; 3 that can be represented by an \u003ca href = \"https://au.mathworks.com/help/matlab/ref/int64.html\"\u003e\u003ctt\u003eint64\u003c/tt\u003e\u003c/a\u003e \u003ca href = \"https://au.mathworks.com/help/matlab/numeric-types.html\"\u003edata type\u003c/a\u003e.  To enforce this, your output needs to be of this data type.\u003c/p\u003e","function_template":"% This was my logic:  ...\r\nfunction F = negativeRabbits(n)\r\n    % Here's how I implemented that conceptual logic in code:\r\n    n = F\r\nend","test_suite":"%% Ban str2num \u0026 str2double;  regexp \u0026 regexpi\r\n% Banning these to discourage hard-coded answers and silly 'scoring cheats'.  Sorry if it disrupts some legitimate usage.  \r\n% Please don't try any other hacks or workarounds.  \r\nassessFunctionAbsence({'str2num','str2double','regexp', 'regexpi'}, 'FileName','negativeRabbits.m');\r\nFR = fileread('negativeRabbits.m');\r\nmsg = 'Don''t hard-code your ''solution''.';\r\nassert( ~any( cellfun( @(z) contains(FR, z) , {'54800875592', '716768017756', '9845401187926'} ) ) , msg )\r\n\r\n%% Ban \"ans\" and a few hard-coded values (digits stripped)\r\n% I don't think it's very good style to be using \"ans\". \r\nRE = regexp(fileread('negativeRabbits.m'), '\\w+', 'match');\r\ntabooWords = {'ans'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not include the following banned strings in your code!' char([10 13]) ...\r\n    strjoin(RE(testResult)) char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\n%% Check data type\r\n% This is important.\r\nassert( isequal( class(negativeRabbits(0)) , 'int64' ) , 'Wrong data type.')\r\n\r\n%% Initial conditions and other such key values.  \r\n% Test Suite shall ensure it only ever checks n \u003c 3.  \r\nassert( isequal(negativeRabbits(+2), 1) , 'Failed at n =+2.' )\r\nassert( isequal(negativeRabbits(+1), 1) , 'Failed at n =+1.' )\r\nassert( isequal(negativeRabbits( 0), 0) , 'Failed at n = 0.' )\r\nassert( isequal(negativeRabbits(-1), 1) , 'Failed at n =-1.' )\r\n\r\n%% Terms from 0 down to -10\r\nfor n = 0 : -1 : -10\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -10 down to -20\r\nfor n = -10 : -1 : -20\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -20 down to -40\r\nfor n = -20 : -1 : -40\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -40 down to -77\r\nfor n = -40 : -1 : -77\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n\r\n%% Terms from -77 down to -92\r\n% This is difficult, but feasible within the parameters of the problem.  \r\nfor n = -77 : -1 : -92\r\n    assert( isequal(negativeRabbits(n)+negativeRabbits(n+1), negativeRabbits(n+2)) , ['Failed at n =' num2str(n) '.'])\r\nend;\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2018-05-03T02:41:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-28T14:33:34.000Z","updated_at":"2026-05-29T04:27:18.000Z","published_at":"2018-04-28T16:25:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://mathworld.wolfram.com/FibonacciNumber.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\\\"Fibonacci sequence\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e — F = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...] — appeared in Indian mathematical expositions from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecirca\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 700 CE or earlier, and in the writings of Leonardo of Pisa (a.k.a. \\\"Fibonacci\\\")\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecirca\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 1202 CE.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis sequence can be defined by\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF(n+2) = F(n+1) + F(n)\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\u003ein which F(1) = 1, F(2) = 1, F(3) = 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\u003eLater in history, it was recognised that F(0) = 0. Of course, this still satisfies the formula in bold above [for n=0]: F(2) = F(1) + F(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\u003eYour job in this Cody Problem is to 'create history'(?) by extending this sequence to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enegative values of n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, to discover the missing half of this sequence!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf n=-1, then F(-1) must be 1, to ensure that F(1) = F(0) + F(-1) — thus satisfying the formula in bold above.\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\u003eYou are only required to provide outputs for n \u0026lt; 3 that can be represented by an\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://au.mathworks.com/help/matlab/ref/int64.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eint64\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/numeric-types.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edata type\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. To enforce this, your output needs to be of this data type.\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\"}]}"}],"errors":[],"facets":[[],[{"value":"medium","count":1,"selected":false}]],"term":"tag:\"int64\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}