https://github.com/wmartinmimi/fibonacci-java
Calculate the nth fibonacci number using java
https://github.com/wmartinmimi/fibonacci-java
fibonacci fibonacci-sequence gplv3 java
Last synced: 9 months ago
JSON representation
Calculate the nth fibonacci number using java
- Host: GitHub
- URL: https://github.com/wmartinmimi/fibonacci-java
- Owner: wmartinmimi
- License: gpl-3.0
- Created: 2023-01-21T09:50:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T19:19:34.000Z (almost 3 years ago)
- Last Synced: 2025-02-01T13:15:51.086Z (11 months ago)
- Topics: fibonacci, fibonacci-sequence, gplv3, java
- Language: Java
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fibonacci-java
## Description
Calculate the nth Fibonacci number using java.
A fun simple project I played with.
## Files
- Fib.java
First version of the calculation.
Fn(n + 1) = F(n) + F(n - 1)
- FibN.java
Second version of the calculation.
F(2n) = (2F(n) + F(n - 1)) * F(n)
F(2n - 1) = F(n - 1)² + F(n)²
- FibT.java
Third version of the calculation.
Does essentially the same as FibN.java,
but first generate quick path from top to bottom
before calculating from bottom to top using the path.
Now also work with negative nth Fibonacci.
## Usage
```bash
java Fib.java
```
or
```bash
java FibN.java
```
or
```bash
java FibT.java
```
Example
```bash
java FibT.java 10000
```
## Last Readme update
- Date: 03-02-2023 dd-MM-yyyy