{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00: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":18,"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-02-21T13:17:20.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":{"errors":[],"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":18,"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-02-21T13:17:20.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\"}]}"}],"term":"tag:\"fibonacci sequence\"","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:\"fibonacci sequence\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"fibonacci sequence\"","","\"","fibonacci sequence","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f636fad9c40\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f636fad9ba0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f636fad92e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f636fad9ec0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f636fad9e20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f636fad9d80\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f636fad9ce0\u003e":"tag:\"fibonacci sequence\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f636fad9ce0\u003e":"tag:\"fibonacci sequence\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"fibonacci sequence\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"fibonacci sequence\"","","\"","fibonacci sequence","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f636fad9c40\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f636fad9ba0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f636fad92e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f636fad9ec0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f636fad9e20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f636fad9d80\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f636fad9ce0\u003e":"tag:\"fibonacci sequence\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f636fad9ce0\u003e":"tag:\"fibonacci sequence\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44628,"difficulty_rating":"easy-medium"}]}}