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

Is singleton thread safe in java?

992


Explain the different forms of polymorphism?

1008


Does a class inherit the constructors of its superclass in java programming?

1122


What is difference between word and integer?

1080


what is singleton class in java?

1059


What is array list in java?

1087


What is string in java is it a data type?

1022


Explain the available thread states in a high-level?

972


What about abstract classes in java?

1068


What is meant by interface?

1061


What are benefits of java?

1050


Define packages in java?

1008


What is classes in java?

947


What is tree node in java?

967


Java Compiler is stored in JDK, JRE or JVM?

1522