Hafeezul Kareem has Published 345 Articles

N-th term in the series 1, 11, 55, 239, 991,…in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 08:03:47

67 Views

The given series is 1, 11, 55, 239, 991...If you clearly observe the series, you will find that the n-th number is 4n-2n-1.AlgorithmInitialise the number N.Use the series formula to compute the n-th term.Print the result.ImplementationFollowing is the implementation of the above algorithm in C++#include using namespace std; int ... Read More

n-th term in series 2, 12, 36, 80, 150….in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 07:46:48

112 Views

The given series is 2, 12, 36, 80, 150...If you clearly observe the series, you will find that the n-th number is n2 + n3.AlgorithmInitialise the number N.Use the series formula to compute the n-th term.Print the result.ImplementationFollowing is the implementation of the above algorithm in C++#include using ... Read More

N-th root of a number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 07:38:31

571 Views

You are given the N-th root and the result of it. You need to find the number such that numberN = result.Let's see some examples.Input result = 25 N = 2Output 5The 52 = 25. Hence the output in the above example is 5.Inputresult = 64 N = 3Output4 The ... Read More

N-th polite number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 06:54:46

111 Views

A polite number is a positive number that can be written as the sum of 2 or more consecutive positive numbers.The series of polite numbers are3 5 6 7 9 10 11 12 13 14...There exists a formula to find the n-th polite number. The formula is n + log2(n ... Read More

n-th number with digits in {0, 1, 2, 3, 4, 5} in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 06:33:37

228 Views

The numbers formed with the digits {0, 1, 2, 3, 4, 5} are0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, etc.., We can form the above sequence using the first 6 digits. Let's see an example of the formation of ... Read More

n-th number whose sum of digits is ten in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 06:08:19

249 Views

The numbers whose digits sum is equal to 10 are19, 28, 37, 46, 55, 64, 73, 82, 91, etc.., If you observe the series, each number is incremented by 9. There are numbers in the above sequence whose digits sum does not equal 10 while incrementing by 9. But, you ... Read More

N-th multiple in sorted list of multiples of two numbers in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 22-Oct-2021 05:54:52

114 Views

You are given three numbers. You need to find the n-th multiple from the multiples of the first two numbers. Let's see an example to understand it more clearly.Input x = 2 y = 3 n = 7Output 10The first n ****multiples of 2 are 2 4 6 8 10 ... Read More

N digit numbers divisible by 5 formed from the M digits in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 21-Oct-2021 12:57:36

121 Views

We have given a number N along with an array of M digits. Our job is to find the number of n digit numbers formed from the given M digits that are divisible by 5.Let's see some examples to understand the problem inputs and outputs.In − N = 2 M ... Read More

Latin Square in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 21-Oct-2021 09:12:56

324 Views

The Latin square is a matrix that has a special pattern. Let's see different examples to examine the pattern.1 2 2 1 1 2 3 3 1 2 2 3 1 1 2 3 4 4 1 2 3 3 4 1 2 2 3 4 1 ... Read More

Permutation of a given string using the inbuilt function in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 16-Apr-2021 19:44:10

3K+ Views

In this tutorial, we are going to find the permutation of a string using the inbuilt function of Python called permutations. The method permutations is present in the itertools module.Procedure To Find The Permutation Of A StringImport the itertools module.Initialize the string.Use the itertools.permutations method to find the permutation of the string.In the ... Read More

Previous 1 ... 6 7 8 9 10 ... 35 Next
Advertisements