A very nice test is that N is a Fibonacci number if and only if 5 N^2 + 4
or 5N^2 – 4
is a square number. For ideas on how to efficiently test that a number is square refer to the SO discussion.
Hope this helps
More Related Contents:
- Finding out nth fibonacci number for very large ‘n’
- An inverse Fibonacci algorithm?
- Custom Weighted Scale [closed]
- How to find nth prime with complexity o(1)
- Calculate distance between two latitude-longitude points? (Haversine formula)
- How to determine if a point is in a 2D triangle? [closed]
- Algorithm to find Largest prime factor of a number
- Is log(n!) = Θ(n·log(n))?
- nth fibonacci number in sublinear time
- How to calculate an angle from three points? [closed]
- Select k random elements from a list whose elements have weights
- How to make rounded percentages add up to 100%
- Writing your own square root function
- What is the fastest integer factorization algorithm?
- Computing set intersection in linear time?
- Modulus power of big numbers
- Why is the complexity of computing the Fibonacci series 2^n and not n^2?
- How to find the smallest number with just 0 and 1 which is divided by a given number?
- How to calculate the index (lexicographical order) when the combination is given
- Determining if two line segments intersect? [duplicate]
- How do I find a factorial? [closed]
- Fastest algorithm for circle shift N sized array for M position
- Strategies for simplifying math expressions
- How to express tetration function, for complex numbers
- What is the method for converting radians to degrees?
- Given Prime Number N, Compute the Next Prime?
- Find out which combinations of numbers in a set add up to a given total
- Why is my recursive function so slow in R?
- determine if a point sits inside an arbitrary shape?
- Location of highest density on a sphere