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
Why is singleton instance static?
What is size of int in java?
In which language java is written?
Explain the different forms of polymorphism?
Is java same as core java?
What is the difference between replace and replace all?
Is singleton set an interval?
What is arrays fill in java?
Why string is immutable with example?
What methods are used to get and set the text label displayed by a button object?
Is java se free?
What is lazy programming?
What are multiple inheritances?
What do you mean by platform independence?
hr interview how many minutes asking question