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
Difference between this() and super() ?
What is the base class of all exception classes in java?
What is difference between arraylist and list in java?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?
What does opcode mean?
What is meant by design patterns?
What is the difference between normal report & matrix report?
If a method is declared as protected, where may the method be accessed in java programming?
What is an array in java?
What is the difference between variable & constant?
Explain the public class modifier?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
What is meant by object?
How many ways can you break a singleton class in java?
Why do we need singleton?