Skip to content

Tag Archives: Fibonacci

Given a positive integer n, the task is to find the value of F1 – F2 + F3 -……….+ (-1)n+1Fn where Fi denotes i-th Fibonacci… Read More
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
Prerequisites: Fibonacci Heap (Introduction) Fibonacci Heap is a collection of trees with min-heap or max-heap property. In Fibonacci Heap, trees can have any shape even… Read More
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
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
Give a number N, print alternate fibonacci numbers till n-th Fibonacci. Examples: Input : N = 7 Output : 0 1 3 8 Input :… Read More
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
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
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
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
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. Examples:  … Read More
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:   Input:… Read More
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
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
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