Skip to content

Commit 9e6fe4b

Browse files
Abhishek JainAbhishek Jain
authored andcommitted
Fixed Indendation Issues
1 parent 10f664d commit 9e6fe4b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Project-Euler/Problem2.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
const SQ5 = 5 ** 0.5
2-
//Square root of 5
2+
// Square root of 5
33

44
const PHI = (1 + SQ5) / 2
55
// definition of PHI
66

7-
//theoretically it should take O(1) constant amount of time as long
7+
// theoretically it should take O(1) constant amount of time as long
88
// arithmetic calculations are considered to be in constant amount of time
9-
function EvenFibonacci(limit) {
9+
function EvenFibonacci (limit) {
1010
const highestIndex = Math.floor(Math.log(limit * SQ5) / Math.log(PHI))
1111
const n = Math.floor(highestIndex / 3)
1212
return ((PHI ** (3 * n + 3) - 1) / (PHI ** 3 - 1) -
1313
((1 - PHI) ** (3 * n + 3) - 1) / ((1 - PHI) ** 3 - 1)) / SQ5
1414
}
15-
16-
console.log(EvenFibonacci(4e6));
15+
console.log(EvenFibonacci(4e6))
1716
// Sum of Even Fibonnaci upto 4 Million

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy