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 identifier with example?
What is length in java?
What does three dots mean in java?
what is the difference between future and callable interface in java?
Does importing a package imports its sub-packages as well in java?
How do you remove duplicates in java?
What is the difference between public, private, protected, and friend access?
What checkbox method allows you to tell if a checkbox is checked?
What are the uses of java?
Is java a prime method?
What is volatile keyword in java
What is indexof?
How we create object in copy constructor?
Why local variables are stored in stack?
What are the different approaches to implement a function to generate a random number?