Cody

# Problem 12. Fibonacci sequence

Solution 1874645

Submitted on 15 Jul 2019 by Rory Hughes
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
n = 1; f = 1; assert(isequal(fib(n),f))

a = 1 b = 1 f = 1

2   Pass
n = 6; f = 8; assert(isequal(fib(n),f))

a = 1 b = 1 temp = 2 b = 1 a = 2 temp = 3 b = 2 a = 3 temp = 5 b = 3 a = 5 temp = 8 b = 5 a = 8 f = 8

3   Pass
n = 10; f = 55; assert(isequal(fib(n),f))

a = 1 b = 1 temp = 2 b = 1 a = 2 temp = 3 b = 2 a = 3 temp = 5 b = 3 a = 5 temp = 8 b = 5 a = 8 temp = 13 b = 8 a = 13 temp = 21 b = 13 a = 21 temp = 34 b = 21 a = 34 temp = 55 b = 34 a = 55 f = 55

4   Pass
n = 20; f = 6765; assert(isequal(fib(n),f))

a = 1 b = 1 temp = 2 b = 1 a = 2 temp = 3 b = 2 a = 3 temp = 5 b = 3 a = 5 temp = 8 b = 5 a = 8 temp = 13 b = 8 a = 13 temp = 21 b = 13 a = 21 temp = 34 b = 21 a = 34 temp = 55 b = 34 a = 55 temp = 89 b = 55 a = 89 temp = 144 b = 89 a = 144 temp = 233 b = 144 a = 233 temp = 377 b = 233 a = 377 temp = 610 b = 377 a = 610 temp = 987 b = 610 a = 987 temp = 1597 b = 987 a = 1597 temp = 2584 b = 1597 a = 2584 temp = 4181 b = 2584 a = 4181 temp = 6765 b = 4181 a = 6765 f = 6765
{"ft_lang_label":"__label__en","ft_lang_prob":0.574142,"math_prob":1.00001,"size":1185,"snap":"2019-51-2020-05","text_gpt3_token_len":567,"char_repetition_ratio":0.26502964,"word_repetition_ratio":0.51336896,"special_character_ratio":0.6472574,"punctuation_ratio":0.04109589,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000087,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-08T22:32:35Z\",\"WARC-Record-ID\":\"<urn:uuid:0e3f503a-5ff1-4fe8-9705-c06521c9e394>\",\"Content-Length\":\"75379\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d73c3c6b-5ca8-4ad7-8d74-921b0fc23d57>\",\"WARC-Concurrent-To\":\"<urn:uuid:0662e5e4-f3fe-443d-ad16-aa5b0df703b6>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/cody/problems/12-fibonacci-sequence/solutions/1874645\",\"WARC-Payload-Digest\":\"sha1:NAYWSBNHXSSUI7R444D5FLDB23WBZIY7\",\"WARC-Block-Digest\":\"sha1:G66YMY4DQGHOOIDRXD5ZN37R25T6X43B\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540514893.41_warc_CC-MAIN-20191208202454-20191208230454-00486.warc.gz\"}"}