,
this answer is not perfect, its logic is correct. Validation for a floating point number has to be done. Change the code urself..
import java.io.*;
class proper
{
public static void main(String args[])
{
try
{
System.out.println("Enter the number");
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str = br.readLine();
int n = Integer.parseInt(str);
int b[]=new int[n];
if(n>0)
{
for(int i=1;i
{
if(n%i == 0)
{
b[i]=i;
}
}
System.out.print("Proper divisors of " + n + " are");
for(int i=1;i
{
System.out.print(b[i]);
}
}
else
{
System.out.println("please enter a positive number");
}
}catch(Exception e)
{
System.out.println("Caught exception " + e);
}
}
}
a perfect number is defined as a positive integer which is the sum of its proper positive divisors, that is, the sum of the positive divisors excluding the number itself 137,438,691,328 is the 7th perfect number.
120,000 has 70 proper divisors.
A perfect number equals the sum of its proper divisors. A deficient number is greater than the sum of its proper divisors. An abundant number is less than the sum of its proper divisors. Proper divisors of a number do not include the number itself.
1,2,3,4,6,8,12,24
The factors of 10 are 1, 2, 5, and 10. The proper factors, or divisors, of the integer n are the positive factors of n other than n itself. So, the proper factors of ten are 1, 2, and 5.
8589869056 is not a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. In the case of 8589869056, the sum of its proper divisors is less than the number itself, making it an abundant number, not a perfect number.
59
-299
Yes, 1184 and 1210 are considered friendly numbers. Friendly numbers, or amicable numbers, are pairs of numbers where each number is the sum of the proper divisors of the other. For 1184, the sum of its proper divisors is 1210, and for 1210, the sum of its proper divisors is 1184, confirming their amicable relationship.
A perfect number is the term for a number that is equal to the sum of its proper divisors. Be careful not to confuse that with proper factors. Proper divisors include 1 but not the number itself. Proper factors don't include either I or the original number.
no- 19 is prime which means it has no proper divisors.
1, 3, 9 and 27