Title: Fibonacci sequence should start with [0, 1] and not [1, 1] · Issue #708 · TheAlgorithms/Java · GitHub
Open Graph Title: Fibonacci sequence should start with [0, 1] and not [1, 1] · Issue #708 · TheAlgorithms/Java
X Title: Fibonacci sequence should start with [0, 1] and not [1, 1] · Issue #708 · TheAlgorithms/Java
Description: Summary The Fibonacci sequence is defined by following statement: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. For reference, please see The online encyclopedia of integer sequences as primary reference, leading to other references...
Open Graph Description: Summary The Fibonacci sequence is defined by following statement: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. For reference, please see The online encyclopedia of integer sequences as primar...
X Description: Summary The Fibonacci sequence is defined by following statement: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. For reference, please see The online encyclopedia of integer sequences as primar...
Opengraph URL: https://github.com/TheAlgorithms/Java/issues/708
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fibonacci sequence should start with [0, 1] and not [1, 1]","articleBody":"# Summary\r\nThe Fibonacci sequence is defined by following statement:\r\n_F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1_. For reference, please see [The online encyclopedia of integer sequences](https://oeis.org/A000045) as primary reference, leading to other references with more detailed description.\r\n(Older) books sometimes omit the preceding _0_, but this representation is deprecated.\r\n\r\n## Current status\r\n### fibMemo\r\nWhen calling the function [Fibonacci.fibMemo](https://github.com/TheAlgorithms/Java/blob/e4a9d38ee39767711784f1d5c21029ce2341846f/Dynamic%20Programming/Fibonacci.java#L30), the result of _F(0)_ = _1_. This is incorrect since _F(0) = 0_. Furthermore this leads to the following sequence for the first few integers: _[1, 1, 1, 2, 3, 5, ...]_ for _input=[0, 1, 2, 3, 4, 5, ...]_.\r\n### fibBotUp\r\nWhen calling the function [Fibonacci.fibBotUp](https://github.com/TheAlgorithms/Java/blob/e4a9d38ee39767711784f1d5c21029ce2341846f/Dynamic%20Programming/Fibonacci.java#L53), the program throws an exception when trying to get the value for _F(0)_ from the map. Therefore _F(0)_ is not supported by this implementation.\r\n\r\n## Task\r\nFix both implementation(s) to\r\na) Return correct values for _F(x)_\r\nb) Do not throw exceptions\r\nAcceptance criteria is met when both functions return _[0, 1, 1, 2, 3, 5]_ for _input=[0, 1, 2, 3, 4, 5]_.","author":{"url":"https://github.com/cchexcode","@type":"Person","name":"cchexcode"},"datePublished":"2019-02-20T12:03:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/708/Java/issues/708"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dd1115a3-60dd-7b16-d183-77f6c7bf2591 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C754:2F98EE:885B01:AF8B1E:6A5C0C3D |
| html-safe-nonce | 9347abbd080c745fc0d289df9a4465f4c610024f9851ff56294a71e5d9b30949 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzU0OjJGOThFRTo4ODVCMDE6QUY4QjFFOjZBNUMwQzNEIiwidmlzaXRvcl9pZCI6IjE4Mzc5MjU0MTk1MjM1MDkzMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 014c2e60be7efc008d5e7a09ed1a11f0300a0c12cab0483939f102ce8120235f |
| hovercard-subject-tag | issue:412391280 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/Java/708/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e16e21cbceea39cc619ae7543d778649351e1c82a5b0167d049b7be3183d35a6/TheAlgorithms/Java/issues/708 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e16e21cbceea39cc619ae7543d778649351e1c82a5b0167d049b7be3183d35a6/TheAlgorithms/Java/issues/708 |
| og:image:alt | Summary The Fibonacci sequence is defined by following statement: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. For reference, please see The online encyclopedia of integer sequences as primar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cchexcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/TheAlgorithms/Java git https://github.com/TheAlgorithms/Java.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 63477660 |
| octolytics-dimension-repository_nwo | TheAlgorithms/Java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 63477660 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/Java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width