Problem 3092. Return fibonacci sequence do not use loop and condition
Solution Stats
Problem Comments
-
6 Comments
Solve other problems from the problem set, Basics - Fibonacci, and the answer will reveal itself to you (after a little reflection). I promise.
Could you please tell me how to use recursion without condition?
Nice!
Interesting problem!!
It does require understanding of linear reccurence relations with constant coefficients. Interesting problem overall
Hint Instead using round which is forbidden.Try cast to other data types guys ( ͡° ͜ʖ ͡°)
Solution Comments
-
1 Comment
Go search for Binet fomula, and you will be fine
-
1 Comment
Well, that's me well and truly beaten! The problem specification didn't say that rounding wasn't permitted. I need to do more research, clearly, but I'm really not sure where to go from here. :-)
-
2 Comments
This ran on my computer but it can't be ran over here.
The test suite was testing for strict equality. A tolerance has been added, which now allows your solution to (rightly) pass.
-
1 Comment
this seems a bit silly
-
1 Comment
Just convert the result to uint32 xd
-
3 Comments
-
1 Comment
this is what I want
-
2 Comments
Very nice! At first the problem felt a bit heavy handed with all those restrictions (no "if", no "round"???) but I see now what you were going for and I like it :)
recursion of anonymous is from the blog of Loren.
-
2 Comments
the first test (checking 'for' loops, etc.) is not really doing anything...
Thank you , have fixed it.
-
2 Comments
The thing about these "don't use this don't use that" problems is that there are so many ways around such restrictions.
you are right,it inspires us to create a lot of new idea that is my purpose
-
2 Comments
Problem Recent Solvers422
Suggested Problems
-
5187 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
2512 Solvers
-
384 Solvers
-
Check that number is whole number
3023 Solvers
-
263 Solvers
More from this Author17
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!