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
What is string subsequence method?
Can I uninstall java?
What is java lang string?
What is contractor means and methods?
What do the thread?class methods run() and start() do?
Explain restrictions on using enum?
What do you understand by java?
What an i/o filter?
What is finalize method?
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
What is meant by method?
what invokes a threads run() method? : Java thread
What is thread pool in java with example?
Can a boolean be null java?
What are the different types of garbage collectors in java?