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
In how many ways we can create threads in java?
What do you mean by pointer value and address?
State the significance of public, private, protected class?
What is the final class modifier?
Is there a way to increase the size of an array after its declaration?
What do you understand by the bean persistent property?
What is the purpose of default constructor?
Is it possible to override private or static method in java?
What happens when you add a double value to a string?
What are the differences between forwarding () method and sendredirect() methods?
Can we serialize static variables in java?
What is a locale?
When to use runnable interface vs thread class in java?
How do I enable java in safari?
What is formatted output in java?