71
votes
Fibonacci-orial
Mathematica, 10 bytes
Fibonorial
Another Mathematica built-in soundly beaten by a golfing language without the built-in.
49
votes
Fibonacci + Fizz Buzz = Fibo Nacci!
Python 2, 62 bytes
a=b=1;exec"print~a%2*'Fibo'+~a%3/2*'Nacci'or a;a,b=b,a+b;"*100
Not much different from the standard FizzBuzz, really.
44
votes
Fibonacci reversed!
Mathematica, 25 bytes
InverseFunction@Fibonacci
Function. Pretty self-explanatory if you ask me.
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 ...
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 ...
35
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,...
32
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 ...
29
votes
Accepted
Print the N-bonacci sequence
Boolfuck, 6 bytes
,,[;+]
You can safely assume no N-Bonacci numbers will exceed the default number type in your language.
The default number type in Boolfuck ...
28
votes
Fibonacci-orial
Jelly, 6 bytes
+С1ḊP
Input 100 finishes in 500 ms locally. Try it online!
How it works
...
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
...
26
votes
Fibonacci function or sequence
Hexagony, 18 14 12
Thanks Martin for 6 bytes!
1="/}.!+/M8;
Expanded:
1 = "
/ } . !
+ / M 8 ;
. . . .
. . .
Try it ...
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 ...
23
votes
Negative Fibonacci Numbers
Mathematica, 9 bytes
Fibonacci
Yes, this built-in function supports negative numbers.
22
votes
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 ...
21
votes
Fibonacci-orial
Actually, 4 bytes
Runs the input 100 within 0.2 seconds. Code:
R♂Fπ
Explanation:
...
21
votes
21
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 ...
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 ...
20
votes
Accepted
19
votes
Accepted
Fibonacci + Fizz Buzz = Fibo Nacci!
Pyth, 37 bytes
I loop through the Fibonacci numbers instead of generating them beforehand, since it's really short to do.
...
19
votes
Fibonacci reversed!
05AB1E, 3 bytes
Code:
ÅFg
Explanation:
ÅF # Generate all Fibonacci numbers <= input.
g # Get the length of this list.
...
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 ...
19
votes
Converting a number from Zeckendorf Representation to Decimal
Taxi, 1987 1927 bytes
-60 bytes due to the realization that linebreaks are optional.
...
19
votes
Previous Fibonacci number
Vyxal, 4 bytes
kg/ṙ
Try it Online!
Port of Unmitigated's JavaScript answer
/ # Divide by...
kg # Phi
ṙ # Round
18
votes
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) ...
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
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
fibonacci × 124code-golf × 114
sequence × 47
math × 29
number × 22
number-theory × 8
integer × 8
primes × 8
ascii-art × 7
subsequence × 7
code-challenge × 6
kolmogorov-complexity × 5
decision-problem × 5
quine × 5
string × 4
restricted-source × 3
binary × 3
integer-partitions × 3
arithmetic × 2
combinatorics × 2
graphical-output × 2
random × 2
fastest-code × 2
base-conversion × 2
cops-and-robbers × 2