Kaishav65 / Hacktoberfest2023

Join Hactoberfest 2023, Make you Pull Request and contribute to open source. Raise Genuine PRs, Your PRs will be accepted. Don't forget to spread love and if you like give us a ⭐️
25 stars 217 forks source link

Create Check if a Number is Fibonacci Number #130

Open Vedprakashdubey528 opened 11 months ago

Vedprakashdubey528 commented 11 months ago

A simple way is to generate Fibonacci numbers until the generated number is greater than or equal to ‘n’. Following is an interesting property about Fibonacci numbers that can also be used to check if a given number is Fibonacci or not. A number is Fibonacci if and only if one or both of (5n2 + 4) or (5n2 – 4) is a perfect square

Vedprakashdubey528 commented 11 months ago

Please review and accept my commited changes