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


Please Help Members By Posting Answers For Below Questions

Is null a value?

562


Why main function is static?

674


Explain about main thread in java?

610


What does bitwise or mean?

568


Which of the classes will have more memory allocated?

540






What is byte [] in java?

536


Explain the Propertie sof class?

586


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

582


What is bean? Where it can be used?

604


Variable of the boolean type is automatically initialized as?

593


What is gc()?

579


Can keyword be used as identifier?

547


What Is Composition?

582


What kind of variables can a class consist?

587


Explain java coding standards for methods?

606