# Tag Archives: Fibonacci

## Program to find last two digits of Nth Fibonacci numberNovember 16, 2017

Given a number ‘n’, write a function that prints the last two digits of n-th (‘n’ can also be a large number) Fibonacci number. Examples:… Read More »

## Ways to paint stairs with two colors such that two adjacent are not yellowNovember 12, 2017

Given n stairs and we have 2 colour yellow and green the task is that we have to paint given stairs by given colour with… Read More »

## Prime numbers and FibonacciNovember 11, 2017

Given a number, find the numbers (smaller than or equal to n) which are both Fibonacci and prime. Examples: Input : n = 40 Output:… Read More »

## Count ways to express ‘n’ as sum of odd integersNovember 5, 2017

Given an positive integer n. Count total number of ways to express ‘n’ as sum of odd positive integers. Input: 4 Output: 3 Explanation There… Read More »

## Time complexity of recursive Fibonacci programOctober 20, 2017

The Fibonacci numbers are the numbers in the following integer sequence 0, 1, 1, 2, 3, 5, 8, 13… Mathematically Fibonacci numbers can be written… Read More »

## Leonardo NumberOctober 18, 2017

The Leonardo numbers are a sequence of numbers given by the recurrence: The first few Leonardo Numbers are 1, 1, 3, 5, 9, 15, 25,… Read More »

## Maximum games played by winnerAugust 20, 2017

There are N players which are playing a tournament. We need to find the maximum number of games the winner can play. In this tournament,… Read More »

## Fibonacci number in an arrayJune 29, 2017

We have been given an array and our task is to check if the element of array is present in Fibonacci series or not. If… Read More »

## Cassini’s IdentityJune 23, 2017

Given a number N, the task is to evaluate below expression. Expected time complexity is O(1). f(n-1)*f(n+1) – f(n)*f(n) Where f(n) is the n-th Fibonacci… Read More »

## Fibonacci modulo pJune 11, 2017

The Fibonacci sequence is defined as = + where = 1 and = 1 are the seeds. For a given prime number p, consider a… Read More »

## Interesting facts about Fibonacci numbersJune 4, 2017

We know Fibonacci number, Fn = Fn-1 + Fn-2. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,… Read More »

## An efficient way to check whether n-th Fibonacci number is multiple of 10May 24, 2017

We are given a variable n, we need to find whether Fibonacci number will be multiple of 10 or not. Examples: Input : 15 Output… Read More »

## Largest subset whose all elements are Fibonacci numbersMay 21, 2017

Given an array with positive number the task is that we find largest subset from array that contain elements which are Fibonacci numbers. Asked in… Read More »

## Find Index of given fibonacci number in constant timeMay 20, 2017

We are given a Fibonacci number. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …..… Read More »

## Tail Recursion for FibonacciMay 15, 2017

Write a tail recursive function for calculating the n-th Fibonacci number. Examples: Input : n = 4 Output : fib(4) = 3 Input : n… Read More »