Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fibonacci]

The challenge involves Fibonacci numbers or one of their generalizations.

5
votes
5answers
127 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 ...
9
votes
5answers
192 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 ...
21
votes
11answers
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'...
18
votes
25answers
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 ...
8
votes
0answers
120 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,...
1
vote
10answers
515 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: ...
14
votes
10answers
644 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 (...
16
votes
12answers
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 ...
31
votes
32answers
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, ...
-4
votes
1answer
127 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-...
20
votes
20answers
2k 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 ...
22
votes
10answers
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 ...
13
votes
10answers
541 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 ...
5
votes
4answers
233 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 ...
20
votes
21answers
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, ...
8
votes
14answers
779 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 ...
18
votes
3answers
427 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 ...
45
votes
13answers
6k 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 ...
26
votes
29answers
6k 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 ...
30
votes
36answers
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: ...
22
votes
12answers
2k views

Divinacci Sequence

Divinacci (OEIS) Perform the Fibonacci sequence but instead of using: f(n) = f(n-1)+f(n-2) Use: ...
11
votes
10answers
981 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 ...
22
votes
14answers
2k 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 ...
35
votes
55answers
8k 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 ...
15
votes
19answers
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 ...
25
votes
42answers
3k 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 ...
14
votes
13answers
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, ...
20
votes
11answers
808 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: ...
25
votes
41answers
2k views

Answer-Chaining Fibonacci

(Inspired by ASCII's 95 Characters...95 Movie Quotes) The Challenge Given input n, output the nth Fibonacci number. You ...
14
votes
20answers
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-...
18
votes
17answers
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 ...
24
votes
1answer
627 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 ...
19
votes
14answers
2k views

Your Base to 1-2-3-Tribonacci to Binary back to Your Base

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 ...
30
votes
26answers
2k 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, <...
24
votes
12answers
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 ...
15
votes
13answers
1k 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 ...
20
votes
20answers
3k views

Sum the First n Even Fibonacci Numbers

There seems not to be a contest for this one yet. The task is simple. Add the first n numbers of the Fibonacci sequence that are even and output the result. This ...
12
votes
18answers
595 views

Fibonacci Exponents

For this challenge, you are to output the result of the sum of some numbers. What are these numbers? Well, you are given input, (a, ...
28
votes
11answers
3k views

Negative Fibonacci Numbers

You probably all know the fibonacci sequence: fibonacci(n)=fibonacci(n-1)+fibonacci(n-2) fibonacci(0)=0 fibonacci(1)=1 Your task is as simple as it could be: ...
3
votes
1answer
193 views

Add the Fibonnaci Sequence to the Lucas Sequence [duplicate]

Background of Lucas Numbers The French mathematician, Edouard Lucas (1842-1891), who gave the name to the Fibonacci Numbers, found a similar series occurs often when he was investigating Fibonacci ...
5
votes
3answers
576 views

Recamán's triangular fibonacci

This challenge is based upon three sequences, below are their formulae: Recamán's sequence: a1 = 0; for n > 0, an = an-1 - n if positive and not already in the sequence, otherwise ...
17
votes
24answers
2k views

Alternating Fibonacci

In the alternating Fibonacci sequence, you first start with 1 and 1 as usual. However, instead of always adding the last two ...
28
votes
39answers
3k views

Print a letter Fibonacci

Given N (2 <= N), print N lines of the letter Fibonacci series like this (i.e. N = 5) First, start with a and b: ...
9
votes
0answers
301 views

Draw a Fibonacci series of squares! [closed]

Introduction To draw a Fibonacci series of square, you start by drawing a one-unit square: _ |_| Then another one to the left: ...
11
votes
15answers
608 views

Compute the Fibonomial Coefficient

Background The Fibonacci sequence is defined as f(1) = 1 f(2) = 1 f(n) = f(n-1) + f(n-2) The Fibonorial, similar to the factorial, is the product of the first n ...
6
votes
2answers
605 views

Draw a Fibonacci Network!

What are Fibonacci networks? In 1202, an Italian mathematician known as Fibonacci posed the following problem: "A male and a female rabbit are born at the beginning of the year. We assume the ...
36
votes
56answers
3k views

Fibonacci-orial

Definition Fibonacci sequence F(n), on the positive integers, are defined as such: ...
40
votes
34answers
10k views

Fibonacci reversed!

Introduction We all know and love our Fibonacci sequence and have seen a myriad of challenge on it here already. However, we're still lacking a very simple case which this answer is going to provide: ...
21
votes
10answers
1k views

Fibonacci Factorization

Fibonacci Numbers Fibonacci Numbers start with f(1) = 1 and f(2) = 1 (some includes f(0) = 0...
7
votes
11answers
537 views

Parity of Nth Term in Fibonacci Integer Sequences

If you look at the Fibonacci Numbers, you will notice a pattern in their parity: 0, 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 89 , 144. Every third number is even,...