Category Archives: Mathematical

Complete the sequence generated by a polynomial

Given a sequence with some of its term, we need to calculate next K term of this sequence. It is given that sequence is generated by some polynomial, however complex that polynomial can be. Notice polynomial is an expression of the following form: P(x) = a0 + a1 x +a2 x^2 + a3 x^3 ……..… Read More »

Even Fibonacci Numbers Sum

Given a limit, find the sum of all the even-valued terms in the Fibonacci sequence below given limit. The first few terms of Fibonacci Numbers are, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ,… (Even numbers are highlighted). Examples: Input : limit = 8 Output : 10 Explanation :… Read More »

Nth Even Fibonacci Number

Given a value n, find the n’th even Fibonacci Number. Input : n = 3 Output : 34 Input : n = 4 Output : 144 Input : n = 7 Output : 10946 The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,… Read More »

N’th Smart Number

Given a number n, find n’th smart number (1<=n<=1000). Smart number is a number which has at least three distinct prime factors. We are given an upper limit on value of result as MAX For example 30 is 1st smart number because it has 2, 3, 5 as it’s distinct prime factors. 42 is 2nd… Read More »