Sum of squares of Fibonacci numbers

Given a positive integer N. The task is to find the sum of squares of all Fibonacci numbers up to N-th fibonacci number. That is,… Read More »

Fibonacci Heap – Insertion and Union

Prerequisites:Fibonacci Heap (Introduction) Fibonacci Heap is a collection of trees with min-heap or max-heap property. In Fibonacci Heap, trees can can have any shape even… Read More »

Find the GCD of N Fibonacci Numbers with given Indices

Given indices of N Fibonacci numbers. The task is to find the GCD of the Fibonacci numbers present at the given indices. The first few… Read More »

Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,…

Given a number N. The task is to write a program to find the N-th term in the below series: 0, 2, 1, 3, 1,… Read More »

Alternate Fibonacci Numbers

Give a number N, print alternate fibonacci numbers till n-th Fibonacci. Examples: Input : N = 7 Output : 0 1 3 8 Input :… Read More »

Tetranacci Numbers

The tetranacci numbers are a generalization of the Fibonacci numbers defined by the recurrence relation T(n) = T(n-1) + T(n-2) + T(n-3) + T(n-4) with… Read More »

Number of ways to represent a number as sum of k fibonacci numbers

Given two numbers N and K. Find the number of ways to represent N as the sum of K Fibonacci numbers. Examples: Input : n… Read More »

Deriving the expression of Fibonacci Numbers in terms of golden ratio

Prerequisites: Generating Functions, Fibonacci Numbers, Methods to find Fibonacci numbers. The method of using Generating Functions to solve the famous and useful Fibonacci Numbers‘ recurrence… Read More »

Sudo Placement 2 | Matrix Series

A Matrix series is defined as follows: M, MT, M(MT), M(MT)2, M2(MT)3, M3(MT)5, M5(MT)8 . . . . . . . ., where M is a… Read More »

Total number of ways to place X and Y at n places such that no two X are together

Given N positions, the task is to count the total number of ways to place X and Y such that no two X are together.… Read More »

Check if a M-th fibonacci number divides N-th fibonacci number

Given two numbers M and N, the task is to check if the M-th and N-th Fibonacci numbers perfectly divide each other or not. Examples:… Read More »

Memoization (1D, 2D and 3D)

Most of the Dynamic Programming problems are solved in two ways: Tabulation: Bottom Up Memoization: Top Down One of the easier approaches to solve most… Read More »

Print first n Fibonacci Numbers using direct formula

Given a number n, the task is to print first n Fibonacci numbers. Prerequisite : Program to print first n Fibonacci Numbers | Set 1… Read More »

Check if the n-th term is odd or even in a Fibonacci like sequence

Consider a sequence a0, a1, …, an, where ai = ai-1 + ai-2. Given a0, a1 and a positive integer n. The task is to… Read More »

Find n terms of Fibonacci type series with given first two terms

Given first two numbers of series, find n terms of series with these two numbers. The given series follows the same concept as Fibonacci series,… Read More »