java program that takes a 3 digit number n and finds out
whether
the number 2^n + 1 is prime, or if it is not prime find out
its
factors.
Answer Posted / nithi
2^n+1=2^n+1^n
(2^(n-2))^2+(1^(n-2))^2 [ like a^2 + b^2 ]
(2^(n-2)+1)*(2^(n-2)-1)) [ like (a+b) (a-b) ]
So factors is 2^(n-2)+1),2^(n-2)-1)
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Can we create a class inside a class in java?
How to make a class or a bean serializable?
What is string array?
Can a method inside a interface be declared as final?
What is the largest data type in java?
Difference between object instantiation and construction ?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Which of the following is not an isolation level in the JDBC
Can a hashset contain duplicates java?
how to one war file class to another war file class?
What does singleton class mean?
Write a function for palindrome and factorial and explain?
Can we use a default constructor of a class even if an explicit constructor is defined?
What is hashing principle in java?
Why method overriding is used?