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 java volatile?
What is better - 'bit-shift a value' or 'multiply by 2'?
What is static data type in java?
What is <> used for in java?
What is array list in java?
What is Applet Stub Interface ?
How do you break a loop?
What is java in layman terms?
How do you find the independent variable?
What are constructors in java?
What methods are used in Servlet?Applet communication?
What is passing parameters in java?
What do you mean by order of precedence and associativity?
What is meant by local variable and instance variable?
Difference between string, string builder, and string buffer?