## Newman-Conway Sequence

Problem Statement The problem “Newman-Conway Sequence” states that you are given an input integer “n”. Then you need to print first nth element of the Newman-Conway Sequence. Example n = 6 4 n = 10 6 Explanation Since the output elements represent the sixth and tenth element of the Newman-Conway …

## Moser-de Bruijn Sequence

In this problem, you are given an integer input n. Now you need to print the first n elements of the Moser-de Bruijn Sequence. Example 7 0, 1, 4, 5, 16, 17, 20 Explanation The output sequence has the first seven elements of the Moser-de Bruijn Sequence. Thus the output …

## Golomb sequence

Problem Statement The problem “Golomb sequence” states that you are given an input integer n and you need to find all the elements of Golomb sequence until nth element. Example n = 8 1 2 2 3 3 4 4 4 Explanation The first 8 terms of the Golomb sequence …

## Newman–Shanks–Williams prime

Problem Statement A Newman–Shanks–Williams prime (NSW prime) is nothing but a prime number which can be represented in a specific form given the following formula: So we need to find nth NSW prime. Example n = 3 7 Explanation S0 = 1, S1 = 1, S2 = 2*S1 + S0 …

## Print the Fibonacci numbers in reverse order

Problem Statement Given a number n, print the fibonacci numbers in reverse order. Example n = 5 3 2 1 1 0 Explanation: The Fibonacci numbers are 0, 1, 1, 2, 3 as per their ordering. But since we needed to print in reverse order. n = 7 8 5 …

## Print Fibonacci sequence using 2 variables

Problem Statement The problem “Print Fibonacci sequence using 2 variables” states that you need to print the Fibonacci sequence but there is a limitation of using only 2 variables. Example n = 5 0 1 1 2 3 5 Explanation The output sequence has the first five elements of the …

## Fibonacci numbers

Fibonacci numbers are the numbers that form the series called Fibonacci series and are represented as Fn. The first two Fibonacci numbers are 0 and 1 respectively i.e. F0=0 and F1=1. Starting from the third Fibonacci number each Fibonacci number is the sum of its previous two numbers in the …

Translate »