46 questions linked to/from Fibonacci function or sequence
7k 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: ...
• 16.7k
280 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 ...
• 42.4k
2k 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 ...
• 571
558 views

### Calculate Fibonacci series from nth term to mth term [duplicate]

Your goal is to calculate the sum of Fibonacci series from n th term to m th term (including both terms). No use of / * % or mathematically what they are in your ...
• 2,711
76 views

### Shortest way to print the first 20 numbers in the fibbonacci sequence with python3 [duplicate]

I was wondering if it was possible to make this code even shorter than it already was. f=lambda x:f(x-1)+f(x-2) if x>1 else 1 [print(f(i))for i in range(20)] ...
135k views

### Showcase of Languages

Notes This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not ...
22k views

### Find the Factorial!

Create the shortest program or function that finds the factorial of a non-negative integer. The factorial, represented with ! is defined as such n!:=\begin{...
• 6,460
17k views

### Sum of all integers from 1 to n

I'm honestly surprised that this hasn't been done already. If you can find an existing thread, by all means mark this as a duplicate or let me know. Input Your input is in the form of any positive ...
• 1,299
6k views

### Evolution of OEIS

In this challenge, the goal is to recreate the On-Line Encyclopedia of Integer Sequences one sequence at a time. Similar to the Evolution of Hello World, each answer depends on a previous answer. ...
• 29k
20k views

### Tips for code-golfing in C#

What general tips do you have for golfing in C#? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C# (e.g. "remove comments" is not an ...
• 1,863
35k views

### Tips for golfing in Ruby

What general tips can you give for golfing in Ruby? I'm looking for ideas that can be applied to code golf problems in general that are specific to Ruby. (For example, "Remove comments" would not be ...
• 1,267
12k views

### Making Future Posts Runnable Online with Stack Snippets [closed]

Stack Snippets were recently added to PPCG! Reminiscent of JSFiddle, Stack Snippets allow HTML, CSS, and JavaScript to be run directly in posts! Here is a very simple Stack Snippet: ...
• 89.3k
11k 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 ...
• 7,215
4k views

### Fibonacci-orial

Definition Fibonacci sequence F(n), on the positive integers, are defined as such: ...
• 49.7k
11k views

Everyone knows the Fibonacci sequence: You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle....
• 2,603
6k views

### 1, 2, miss a few, 99, 100

When I was a kid, there was a "really cool" shortcut to count to 100: 1, 2, miss a few, 99, 100 Output the exact string above, in the fewest characters ...
• 4,547
5k views

### Previous Fibonacci number

The sequence of Fibonacci numbers is defined as follows: $F_0 = 0 \\ F_1 = 1 \\ F_n = F_{n-1} + F_{n-2}$ Given a Fibonacci number, return the previous Fibonacci number in the sequence. You do not ...
• 23.5k
9k views

### Check if computer is connected to the internet

Write a program which, according to whether the script has access to the internet, produces an output which is "Truthy/Falsey". You may try and connect to any existing site, at your own discretion (...
• 603
4k views

### Repeat your program to print Fibonacci numbers

Write a program fragment so that, when repeated N times it prints the Nth Fibonacci number. For example, if your program is print(x) then: ...
• 12.4k
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 ...
• 13.8k
5k views

### Do you make me up?

Introduction Every string has an "alphabet", composed of the characters that make it up. For example, the alphabet of $abcaabbcc$ is ${a, b,c}$. There are two operations you can do with ...
• 2,193
5k views

### Can the number reach 1 by repeatedly subtracting the largest prime less than it?

Challenge: Given a number, take the largest prime strictly less than it, subtract it from this number, do this again to this new number with the biggest prime less than it, and continue doing this ...
• 8,112
5k 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, ...
• 729
2k views

### Add N numbers without using + or -

Given N integers, output the sum of those integers. Input You may take the integers in any reasonable format, including: stdin arguments an array or list Rules ...
• 3,308
4k views

### Calculating (3 + sqrt(5))^n exactly

Today your goal is to find integers a and b given non-negative integer n such that: You should write a program or a function that takes parameter n and outputs a and b in a format of your choice. ...
• 39.1k
2k views

### How many partitions do I have?

The partition number of a positive integer is defined as the number of ways it can be expressed as a sum of positive integers. In other words, the number of integer partitions it has. For example, the ...
6k views

### First-n Fibonacci sequence elements

There is a well known question here that asks for a short (least characters) fibonacci sequence generator. I would like to know if someone can generate the first N elements only, of the fibonacci ...
• 249
2k views

### Have you learned your fib-abc?

I don't like numbers, but I do like the Fibonacci sequence. I'm sure we could work something out. Please read one integer n from STDIN and output the nth Fibonacci number in base 26 (...
• 1,859
3k views

### The Lucas-nacci Numbers

Background Most everyone is familiar with the Fibonacci numbers $F(n)$: $0, 1, 1, 2, 3, 5, 8, 13, 21, ...$ These are formed by the recursion function $F(n) = F(n-1) + F(n-2)$ with $F(0)=0$ ...
• 43.3k