Tag: Math
-
How to find the nth Fibonacci number in the series?
This is the complete solution to find the nth Fibonacci number in the series. This solution is designed to solve the problem using an interface, super class and three derived classes implementing the interface.
-
How to check whether a String is eligible Palindrome or not?
This is the complete solution to check whether a given String is eligible for a Palindrome or not. This solution is designed to solve the problem using an interface, super class and three derived classes implementing the interface.
-
How to check whether a given number is ArmStrong number or not?
This is the complete solution to check whether a given number is ArmStrong number or not. This solution is designed to solve the problem using an interface, super class and three derived classes implementing the interface.
-
How to check whether a given integer is prime number or not ?
This is the complete solution to check whether a given integer number is prime or not. This solution is designed to to solve the problem using an interface, super class and four derived classes implementing the interface. The core logic is to check the divisibility of the given number, from 2 to till the square…
-
How to check whether a number is Disarium or not using stream
This is the second solution to check the number for Disarium. This solution uses IntStream, reduce methods of Stream. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 * 1) + power (5 * 2) + power (1 *3) , the sum of all…
-
How to find Missing Prime numbers from any given sequence of integers using Stream
This is the second solution to find the missing prime numbers from any given sequence of integers. This solution uses the Lambda expression with single abstract method. The solution also uses the range, filter, foreach methods of IntStream.
-
How to find Missing Prime numbers from any given sequence of integers
This is the first solution to find the missing prime numbers from any given sequence of integers. This solution uses the Lambda expression with single abstract method. The solution is finding all the missing prime numbers between every pair for consecutive numbers from the given sequence till end. The logic for prime check is the…
-
How to check whether a given integer is prime number or not
This is the third solution to check whether the given integer number is prime or not. This solution uses the Lambda expression with single abstract method. The implementation is to check the divisibility of the given number, from 2 to till the square root of the given number.
-
How to check whether a number is Disarium or not
This is the second solution to check the number for Disarium. This solution contains the core logic to evaluate the sum of powers of all digits in descending order of the length of number. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 *…
-
How to check whether a number is Armstrong number or not
This is the first solution to check the number for Armstrong. This solution uses String class, and a couple of Character functions to evaluate the sum of the cubes of each digit in a given number. The Armstrong number is say for a given number 153, evaluate the powers of cubes from any side as…
