Skip to main content
71 votes

Fibonacci-orial

Mathematica, 10 bytes Fibonorial Another Mathematica built-in soundly beaten by a golfing language without the built-in.
Martin Ender's user avatar
44 votes

Fibonacci reversed!

Mathematica, 25 bytes InverseFunction@Fibonacci Function. Pretty self-explanatory if you ask me.
LegionMammal978's user avatar
37 votes

Extreme Fibonacci

Python 2 + sympy, 72 bytes from sympy import* n=sqrt(5) print'7'+`((.5+n/2)**1e9/n).evalf(1e3)`[2:] Try it online! -10 bytes by removing the practically-0 term ...
hyper-neutrino's user avatar
  • 42.4k
36 votes
Accepted

Am I a Fibonacci Number?

Neim, 2 bytes f𝕚 Explanation: f Push an infinite fibonacci list 𝕚 Is the input in that list? Works the same ...
Okx's user avatar
  • 16.4k
36 votes

Extreme Fibonacci

Python 2, 106 bytes a,b=0,1 for c in bin(10**9): a,b=2*a*b-a*a,a*a+b*b if'1'==c:a,b=b,a+b while a>>3340:a/=10;b/=10 print a Try it online! No libraries,...
xnor's user avatar
  • 145k
33 votes

Extreme Fibonacci

x86 32-bit machine code (with Linux system calls): 106 105 bytes changelog: saved a byte in the fast version because an off-by-one constant doesn't change the result for Fib(1G). Or 102 bytes for an ...
Peter Cordes's user avatar
  • 4,837
28 votes

Fibonacci-orial

Jelly, 6 bytes +С1ḊP Input 100 finishes in 500 ms locally. Try it online! How it works ...
Dennis's user avatar
  • 210k
28 votes

Digital Sum Fibonacci

JavaScript (ES6), 45 bytes f=(n,x=0,y=1)=>n?f(n-1,y,(x%9||x)+(y%9||y)):x ...
Neil's user avatar
  • 172k
26 votes

Fibtraction - Fibonacci but with subtraction

Oasis, 4 bytes c-21 Try it online! 0-indexed. I saw this language used for a similar challenge once, and immediately I knew I should try it here. Can't say I'm ...
PurkkaKoodari's user avatar
23 votes

Negative Fibonacci Numbers

Mathematica, 9 bytes Fibonacci Yes, this built-in function supports negative numbers.
alephalpha's user avatar
  • 48.5k
22 votes

Alternating Power Fibonacci Sequence

Python 2, 30 bytes f=lambda n:n<1or f(n/4)-f(n/2) Try it online! One-indexed. The sequence felt like a puzzle, something that Dennis generated by having a ...
xnor's user avatar
  • 145k
22 votes

Extreme Fibonacci

Haskell, 83 61 bytes p(a,b)(c,d)=(a*d+b*c-a*c,a*c+b*d) t g=g.g.g t(t$t=<<t.p)(1,1) Outputs (F1000000000,F1000000001). On my laptop, it correctly prints ...
Anders Kaseorg's user avatar
21 votes

Fibonacci-orial

Actually, 4 bytes Runs the input 100 within 0.2 seconds. Code: R♂Fπ Explanation: ...
Adnan's user avatar
  • 44.4k
21 votes

Fibonacci-orial

Brainfuck, 1198 1067 817 770 741 657 611 603 ...
primo's user avatar
  • 33.3k
20 votes

Find the closest Fibonacci Number

Python 2, 43 bytes f=lambda n,a=0,b=1:a*(2*n<a+b)or f(n,b,a+b) Try it online! Iterates through pairs of consecutive Fibonacci numbers ...
xnor's user avatar
  • 145k
20 votes
Accepted

Fibonacci Encoding

Japt, 13 bytes @!X¤øB}iU ¤ÔÄ Explanation: ...
Etheryte's user avatar
  • 3,838
19 votes

Fibonacci reversed!

05AB1E, 3 bytes Code: ÅFg Explanation: ÅF # Generate all Fibonacci numbers <= input. g # Get the length of this list. ...
Adnan's user avatar
  • 44.4k
19 votes

Am I a Fibonacci Number?

Regex (ECMAScript), 392 358 328 224 206 165 164 162 161 bytes -1 byte by using ECMAScript non-participating capture group behavior -2 bytes by by calculating \$F_{2n+3}\$ differently -1 byte by moving ...
Deadcode's user avatar
  • 11.6k
19 votes

Converting a number from Zeckendorf Representation to Decimal

Taxi, 1987 1927 bytes -60 bytes due to the realization that linebreaks are optional. ...
JosiahRyanW's user avatar
  • 4,221
19 votes

Previous Fibonacci number

Vyxal, 4 bytes kg/ṙ Try it Online! Port of Unmitigated's JavaScript answer / # Divide by... kg # Phi ṙ # Round
emanresu A's user avatar
  • 38.8k
18 votes

Negative Fibonacci Numbers

Octave, 20 bytes @(n)([1,1;1,0]^n)(2) Try it online! Explanation This makes use of the fact that the fibonacci sequence f(n) ...
flawr's user avatar
  • 43.8k
18 votes
Accepted

Golf a Custom Fibonacci Sequence

Jelly, 3 bytes +¡ạ Takes x, y, and n (0-indexed) as separate command-line arguments, in that order. Try it online! How it works ...
Dennis's user avatar
  • 210k
18 votes

Am I a Fibonacci Number?

JavaScript (ES6), 34 bytes f=(n,x=0,y=1)=>x<n?f(n,y,x+y):x==n Recursively generates the Fibonacci sequence until it finds an item greater than or equal to ...
ETHproductions's user avatar
18 votes

Fibonacci trees

J, 14 bytes (2{.];])^:[&a: Try it online! We use J boxes to represent the trees: ...
Jonah's user avatar
  • 33.6k
17 votes

Alternating Fibonacci

JavaScript (ES6), 25 bytes n=>"334130110314"[n%12]-2 0-indexed. You can shorten the string with a slightly recursive version, though it adds 6 bytes: ...
ETHproductions's user avatar
17 votes

Sum the First n Even Fibonacci Numbers

Python, 33 bytes c=2+5**.5 lambda n:(7-c)*c**n//20 Try it online Magic formula!
xnor's user avatar
  • 145k
16 votes

Fibonacci reversed!

Julia, 27 26 18 bytes !n=log(3n+.7)÷.48 This uses the inverse of Binet's formula, with just enough precision for 32-bit integers; it actually works up to F(153) ...
Dennis's user avatar
  • 210k
15 votes

Fibonacci-orial

Python, 45 Bytes a=b=o=1 exec"o*=a;a,b=b,a+b;"*input() print o Input is taken from stdin. Output for n = 100 finishes too quickly to accurately time. n = 1000 ...
primo's user avatar
  • 33.3k

Only top scored, non community-wiki answers of a minimum length are eligible