# Questions tagged [fibonacci]

The challenge involves Fibonacci numbers or one of their generalizations.

103 questions
Filter by
Sorted by
Tagged with
1k views

### Phibonacci - Relation between Phi and Fibonacci

You want to see how quickly the ratio of two consecutive Fibonacci numbers converges on φ. Phi, known by the nickname "the golden ratio" and written as $φ$, is an irrational number, almost ...
549 views

### The half-step of Fibonacci

Challenge Implement the 1-indexed sequence A054049, which starts like this: ...
1k views

### Variable length Fibonacci word

Challenge For any two non-empty strings A and B, we define the following sequence : F(0) = A F(1) = B F(n) = F(n-1) + F(n-2) Where ...
3k views

### Complex Fibonacci numbers

The Binet formula is a closed form expression for the $n$'th Fibonacci number: $$F_n = \frac {\phi^n - (1-\phi)^n} {\sqrt 5}$$ where $\phi = \frac {1 + \sqrt 5} 2$ is the golden ratio. This ...
2k views

### Fibonacci Encoding

Fibonacci coding is a universal code, which can encode positive integers of any size in an unambiguous stream of bits. To encode an integer $n$: Find the largest Fibonacci number less than or ...
2k views

2k views

### Indexing the Extended Fibonacci Numbers

You've probably heard of Fibonacci numbers. Ya know, that integer sequence that starts with 1, 1, and then each new number is the sum of the last two? ...
175 views

### Fibonacci with n numbers instead of 2 [duplicate]

How to Given an integer n start with n ones (i.e. 4 -> 1 1 1 1). Then sum up the last ...
215 views

### Find the minimal initial values [duplicate]

Consider a sequence F of positive integers where F(n) = F(n-1) + F(n-2) for n >= 2. The ...
6k views

### Is this number secretly Fibonacci?

Background Most of you know what a Fibonacci number is. Some of you may know that all positive integers can be represented as a sum of one or more distinct Fibonacci numbers, according to Zeckendorf'...
3k views

### Converting a number from Zeckendorf Representation to Decimal

About Zeckendorf Representations/Base Fibonacci Numbers This is a number system which uses Fibonacci numbers as its base. The numbers consist of 0 and 1's and each 1 means that the number contains ...
147 views

### Find a way to determine to which fibonacci squares a given coordinate belongs [closed]

Given a random coordinate (x,y), determine in which square (squares are referenced by their sidelength) it is (or the borders of which squares). The squares are drawn in a counter clockwise direction,...
1k views

### Indent your code according to Fibonacci

Okay, so I saw this in a meme and decided it'd be the perfect code golf challenge: I prefer to increase the side of my indents according to the Fibonacci sequence: ...
728 views

### Sequentia Filii Bonacci

Leonardo of Pisa (ca. 1175 - ca. 1245) is better known as Fibonacci. But this is actually a short for the Latin "filius Bonacci" (the son of Bonacci) which was made up during the 18th century (...
2k views

### Find the Fibonacci Patterns

You are probably familiar with the Fibonacci sequence where the first two terms are 0, 1 (or sometimes 1, 1) and every term ...
4k views

### Binary Fibonacci

Challenge You need to generate a program or function that takes in a positive integer N, calculates the first N terms of the Fibonacci sequence in binary, concatenates it into a single binary number, ...
142 views

### Find prime factors of sum of non-composite Fibonacci numbers up to n

The Challenge Given a number, find the sum of the non-composite numbers in the Fibonacci sequence up to that number, and find the prime factors of the sum. For example, if you were given 8, the non-...
4k views

### Find the Missing Numbers in the Fibonacci Sequence Mod K

Inspired by this Math.SE question. Background The Fibonacci Sequence (called F) is the sequence, starting 0, 1 such that each ...
2k views

### The lowest initial numbers in a Fibonacci-like sequence

Given a positive integer input N, output the two non-negative numbers, a and b, where a < b, with the lowest possible mean value that will result in the number N being part of the recurring ...
589 views

### Counting Fibonacci Orbits

If we define a Fibonacci-like sequence as fk(n) = (fk(n-1) + fk(n-2)) % k, for some integer k (where % is the modulo operator), the sequence will necessarily be cyclic, because there are only k2 ...
260 views

### Implement the Fibonacci sequence… Shifted to the right [duplicate]

Background We all know the famous Fibonacci sequence, where each term is the sum of the previous two, with the first term being 0 and the second one being ...
1k views

### Within Fibonacci Numbers

The Challenge Given an integer input, return the first Fibonacci number that contains the input within itself along with the index of that Fibonacci number (indexes starting at 0 or 1 - up to you, ...
1k views

### Reverse Fibonacci

Your task You must write a program, to print a reverse Fibonacci series, given a number. Input A non-negative integer N. Output You must output all the Fibonacci numbers from Fk to F0, where k is the ...
566 views

### When Fibonacci meets the Queens

(inspired by Helka's response to my random pairing of "chess" and "Fibonacci" tags in chat) Fibonacci The Fibonacci numbers are one of the more well-known sequences in mathematics, where each number ...
7k views

### Extreme Fibonacci

There have been a billion iterations of Fibonacci challenges on this website, so lets spice things up with a Fibonacci challenge of a billion iterations! Your challenge is to output the first 1000 ...
14k views

### Find the closest Fibonacci Number

We are all familiar with the famous Fibonacci sequence, that starts with 0 and 1, and each element is the sum of the previous ...
5k views

### Fibtraction - Fibonacci but with subtraction [duplicate]

The Fibtraction sequence (as I call it) is similar to the Fibonacci sequence except, instead of adding numbers, you subtract them. The first few numbers of this challenge are: ...
2k views

### Divinacci Sequence

Divinacci (OEIS) Perform the Fibonacci sequence but instead of using: f(n) = f(n-1)+f(n-2) Use: ...
1k views

### Am I a Special N-bonacci Number?

The N-bonacci sequence, originally invented by @DJMcMayhem in this question, is a sequence generated by starting with the integers 0 and 1, and then adding the previous N numbers to generate the next ...
3k views

### Print the nth Fibonacci number containing the nth Fibonacci number!

Challenge You must write a program that takes a positive integer n as input, and outputs the nth Fibonacci number (shortened as ...
10k views

### Am I a Fibonacci Number?

Your Task: Write a program or function to check if a number that is inputted is a Fibonacci number. A Fibonacci number is a number contained in the Fibonacci sequence. The Fibonacci Sequence is ...
1k views

### Sum my Fibonaccified divisors!

The famous Fibonacci sequence is F(0) = 0; F(1) = 1; F(N+1) = F(N) + F(N-1) (for this challenge we are beginning with 0). Your challenge: Given n, output the sum ...
4k views

### Golf a Custom Fibonacci Sequence

The Fibonacci sequence is a fairly well known thing around here. Heck, it even has its own tag. However, for all that, we sure like to stick to our roots of ...
2k views

### Implement the Fibonacci-quine

A Quine is a program which outputs its source when run. In this challenge, You should make a Fibonacci-quine, a variant of the quine. What is a Fibonacci-quine? A Fibonacci-quine is a program, ...
939 views

### Linear interpolation of the Fibonacci sequence

Your task is to find the nth Fibonacci number, but n is not necessarily an integer. The Fibonacci sequence, 0-indexed, goes as follows: ...
2k views

(Inspired by ASCII's 95 Characters...95 Movie Quotes) The Challenge Given input n, output the nth Fibonacci number. You can ...
2k views

### Counter-Fibonacci Sequences

Given three numbers m,n and p, your task is to print a list/array of length p starting with m and n and each element after p represents the difference of the 2 numbers before it, m-n (Counter-...
2k views

### Arithmetic mean of prime Fibonacci Numbers up to the x Fibonacci Number

You should have heard about the Fibonacci Numbers, often called the Fibonacci Sequence. In this sequence the first two terms are 0 and 1, and every number after the first two is the sum of the two ...
933 views

### Find the Fibonacci Kernel

You've probably heard of the Fibonacci numbers; they're pretty famous. Each number in the Fibonacci sequence is the sum of the last two in the sequence with the first and second numbers being 1. The ...
2k views

Background The 1-2-3-Tribonacci Sequence Imagine for a second that you could make a fibonacci sequence by replacing the standard iteration formula with the following: Basically, instead of summing ...
3k views

### Digital Sum Fibonacci

We are all familiar with the Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765 However, instead of, <...
2k views

### Alternating Power Fibonacci Sequence

Definition The Alternating Power Fibonacci Sequence is formed as follows. Start with the empty sequence and set n to 1. Compute fn, the nth non-negative Fibonacci number, with repetitions. 0 is the ...
2k views

### Permanently self-modifying code

Now, we all know most languages have very simple ways to "self-modify" code. However, what if you were to actually modify the code and edit parts of it...on disk? Your goal is to make code that ...