From f2948eb2bd9fbd9630c322df09441db9c5a8c13a Mon Sep 17 00:00:00 2001 From: beramos Date: Mon, 5 Feb 2024 11:44:25 +0100 Subject: [PATCH] day 1: rewrite fermat question 2 --- notebooks/day1/01-basics.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/day1/01-basics.jl b/notebooks/day1/01-basics.jl index 81cf65a..7c79a25 100644 --- a/notebooks/day1/01-basics.jl +++ b/notebooks/day1/01-basics.jl @@ -848,7 +848,7 @@ $a^n + b^n = c^n$ for any value of $n$ greater than 2. 1. Write a function named `checkfermat` that takes four parameters ($a$, $b$, $c$ and $n$) and checks to see if Fermat’s theorem holds. If $n$ is greater than 2 and $a^n + b^n == c^n$ the program should print, *"Holy smokes, Fermat was wrong!"* Otherwise, the program should print and return, *"No, that doesn’t work."* -2. Write a function that takes four random positive integers for $a$, $b$, $c$ and $n$, and use `checkfermat` to check whether they violate Fermat’s theorem. +2. Write a function that, when no input arguments are provided, four random positive integers are assigned to $a$, $b$, $c$ and $n$, and use `checkfermat` to check whether they violate Fermat’s theorem. 3. Can you write the code so that the functions in 4.1 and 4.2 have the same name? Hints: