Questions tagged [fibonacci]
The challenge involves Fibonacci numbers or one of their generalizations.
130 questions
25 votes
8 answers
1k views
Index into a Fibonacci tiling
The Cartesian plane can be tiled with increasingly large squares like so: This tiling can be generated by starting with a square of side length 1, placed at the origin ...
2 votes
3 answers
342 views
Non-Decreasing Fibonacci Sequence modulo M
Given integers \$a,b,m, k, n\$ and array \$F = (f_1, f_2,...,f_n)\$ defined as: \begin{cases} f_1 = \text{a}\\ f_2 = \text{b}\\ f_i = (f_{i-1} + f_{i-2}) \text{ mod m},∀i > 2 \end{cases} When \$F\$ ...
19 votes
5 answers
3k views
Draw a Fibonacci Swoosh
Title courtesy of Greg Martin For this challenge, I'll define an arc of size \$k\$ as a single piece of a sine wave with a length of \$k\$ units and an height of \$\frac{k}{4}\$ units: And I'll ...
12 votes
4 answers
568 views
Zeckendorf to F(4k+2) representation
Background Fibonacci numbers are defined as follows: $$ F_0 = 0, F_1 = 1, F_n = F_{n-1} + F_{n-2} $$ The Zeckendorf representation is a representation of positive integers as a sum of one or more non-...
13 votes
9 answers
3k views
Give the fool's Fibonacci sequence
Recently I asked for tips on improving some code-golf of mine. The code was supposed to output every third value of the Fibonacci sequence starting with 2: ...
18 votes
7 answers
1k views
Fibonacci Binary Squares
I was playing with the Fibonacci sequence in binary like so (note that the binary representations are written here from smallest bit to largest bit): ...
17 votes
11 answers
3k views
Fibonacci word fractal
The Fibonacci word is a sequence of binary strings defined as: \$F_0 = \$ 0 \$F_1 = \$ 01 \$F_n = F_{n-1} F_{n-2}\$ The first ...
6 votes
3 answers
633 views
Generate Fibonacci Primes Quickly
Unsurprisingly, fibonacci primes are primes that are also Fibonacci numbers. There are currently 34 known Fibonacci primes and an additional 15 probable Fibonacci primes. For the purpose of this ...