Fruitful Functions

Fruitful Functions Lab # 5

For this lab we must create a function that test Fermat’s number theorem. His theorem states that no threeĀ positiveĀ integersĀ a,Ā b, andĀ cĀ can satisfy the equationĀ an+Ā bnĀ =Ā cnĀ for any integer value ofĀ nĀ greater than two. The casesĀ nĀ =Ā 1 and nĀ =Ā 2 were known to have infinitely many solutions. To create this function we must ā€œcheck_fermat(a, b, c, n)ā€. After that we must create two situations if we meet the conditions Fermat wants us two and the equation does show equality then a message should pop up saying ā€œFermat was wrong!ā€ if anything other than equality is occurs then the statement ā€œNo, that does not work.ā€ Should pop up. After that we want the user to assign numbers for the variables a, b, c, n. To do this we use ā€œinput and integer modules. An example of this is a = int(input(ā€œmessage hereā€)) and what ever message you put should tell the user what to input as a value you repeat this step three time for the variables a, b, and c. The message you input should be ā€œenter a value for xā€ x being the variable you are currently assigning. Finally the n variable should say ā€œenter a value for n greater than 2. Your command line should look like this. The only time Femat was wrong is when a, b, and c were the integer 1.

fruitful functions