- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Hafeezul Kareem has Published 345 Articles
Hafeezul Kareem
79 Views
The newman-shanks-williams prime sequence is as follows1, 1, 3, 7, 17, 41...If we generalise the sequence items, we geta0=1 a1=1 an=2*a(n-1)+a(n-2)AlgorithmInitialise the number n.Initialise the first numbers of the sequence 1 and 1.Write a loop that iterates till n.Compute the next number using the previous numbers.Update the previous two numbers.Return ... Read More
Hafeezul Kareem
156 Views
The nesbitt's inequality is (a/(b + c)) + (b/(c + a)) + (c/(a + b))>= 1.5, a > 0, b > 0, c > 0Given three number, we need to check whether the three numbers satisfy Nesbitt's inequality or not.We can test whether three number are satisfied nesbitt's inequality or ... Read More
Hafeezul Kareem
2K+ Views
A neon number is a number where the sum of digits of the square of the number is equal to the number. Let's take an example.n = 9square = 81sum of digits of square = 8 + 1 = 9So, the number 9 is a neon number.We need to check ... Read More
Hafeezul Kareem
1K+ Views
We are given a number n, we need to find the nearest prime number that is less than n. We can find the number easily if we start checking from the n - 1. Let's see some examples.Input10Output7AlgorithmInitialise the number n.Write a loop that iterates from n - 1 to ... Read More
Hafeezul Kareem
2K+ Views
Numbers that are greater than 0 are called natural numbers. The natural number are1, 2, 3, 4, 5, 6, 7...AlgorithmInitialise the number n.Write a loop that iterates from 1 to n.Print the numbers.Increment the iterative variable.ImplementationFollowing is the implementation of the above algorithm in C++#include using namespace std; void ... Read More
Hafeezul Kareem
104 Views
The Narayana numbers can be expressed in terms of binomial expression $1/n\binom{n}{k} \binom{n}{k-1}$ Learn more about the Narayana number here.You are given the numbers n and k. Find the Narayana number. It's a straightforward problem having the combinations formula. Let's see the code.AlgorithmInitialise the numbers n and k.Find the Narayana ... Read More
Hafeezul Kareem
144 Views
A smart number is a number that contains at least three distinct prime factors. You are given a number N. Find the n-th smart number.The smart number series are30, 42, 60, 66, 70, 78...AlgorithmInitialise the number N.Initialise the count to 0.Write a function that checks whether the given number is ... Read More
Hafeezul Kareem
252 Views
In this tutorial, we are going to write a program that finds the n-th pentagonal number.A pentagonal number is a number represented as dots or pebbles arranged in the shape of a regular polygon. Refer to the wiki for better understanding.The n-th pentagonal number is (3 * n * n ... Read More
Hafeezul Kareem
235 Views
To find the n-th palindrome of k digits, we can iterate from the first k digits number till we find the n-th palindrome number. This approach is not efficient. You can try it yourself.Now, let's see the efficient approach to find the n-th palindrome of k digits.There are two halves ... Read More
Hafeezul Kareem
89 Views
The given series is 1, 17, 98, 354...If you clearly observe the series, you will find that the n-th number is equal to the 4 powers.Let's see the pattern. 1 = 1 ^ 4 17 = 1 ^ 4 + 2 ^ 4 98 = 1 ^ 4 + 2 ... Read More
To Continue Learning Please Login
Login with Google