Posts

Showing posts from June, 2021

Weird Number

Image
Weird Number in Java Question :   Write a program to accept a number and check whether it is  Weird  number or not. Weird Number  :  A Weird number is a natural number that is Abundant but not Semi-Perfect . In other words, the sum of the proper divisors (divisors including 1 but not itself) of the number is greater than the number, but no subset of those divisors sums to the number itself.  First few Weird Numbers : 70, 836, 4030, 5830, 7192, 7912, 9272, 10430, 10570, 10792, 10990, 11410, 11690 Abundant Number : A number ‘n’ is said to be Abundant Number if sum of all the proper divisors of the number is greater than the number ‘n’. Semi-Perfect Number : A Semi-Perfect number or Pseudo-Perfect number is a natural number n that is equal to the sum of all or some of its proper divisors. 

Semi Perfect/Pseudo Perfect Number

Image
Semi Perfect/Pseudo Perfect Number in JAVA Question :   Write a program to accept a number and check whether it is  Semi-Perfect number or not. Semi-Perfect Number  :  A Semi-Perfect number or Pseudo-Perfect number is a natural number n that is equal to the sum of all or some of its proper divisors.  A Semi-Perfect number that is equal to the sum of all its proper divisors is a perfect number. First few Semi-Perfect numbers are: 6, 12, 18, 20, 24, 28, 30, 36, 40 etc. Proper Divisors : Proper divisor is a positive divisor of a number, excluding itself. Example  :- Input : 6 Proper Divisors of 6 : 1, 2, 3 Sum of Proper Divisors : 1 + 2 + 3 = 6 Output : Semi-Perfect Number (Since sum of all the factors is equal to the number, it is also a Perfect Number). Input : 12 Proper Divisors of 12 : 1, 2, 3, 4, 6 Sum of Proper Divisors : 1 + 2 + 3 + 6 = 12 Output : Semi-Perfect Number