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
Is singleton thread safe in java?
Explain the different forms of polymorphism?
Does a class inherit the constructors of its superclass in java programming?
What is difference between word and integer?
what is singleton class in java?
What is array list in java?
What is string in java is it a data type?
Explain the available thread states in a high-level?
What about abstract classes in java?
What is meant by interface?
What are benefits of java?
Define packages in java?
What is classes in java?
What is tree node in java?
Java Compiler is stored in JDK, JRE or JVM?