Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

In how many ways we can create threads in java?

1228


What do you mean by pointer value and address?

1064


State the significance of public, private, protected class?

1118


What is the final class modifier?

1051


Is there a way to increase the size of an array after its declaration?

1064


What do you understand by the bean persistent property?

1023


What is the purpose of default constructor?

1009


Is it possible to override private or static method in java?

1009


What happens when you add a double value to a string?

1018


What are the differences between forwarding () method and sendredirect() methods?

1124


Can we serialize static variables in java?

1109


What is a locale?

1159


When to use runnable interface vs thread class in java?

996


How do I enable java in safari?

1049


What is formatted output in java?

976