Our site saves small pieces of text information (cookies) on your device in order to deliver better content and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device.

# Fun modulo 5

Could you believe it? Stefan was playing around with his favorite numbers, he wanted to practice taking the fifth power of them, when suddenly he realized, that the least significant digit of the result was the same as the original number's. Can you show him why?

That is, prove: `n mod 10 = (n ^ 5) mod 10`

## Resources

### Definitions File

```theory Defs
imports Main
begin
end```

### Template File

```theory Submission
imports Defs
begin

lemma modpower5: fixes n :: nat
shows "n mod 10 = (n ^ 5) mod 10" sorry

end```

### Check File

```theory Check
imports Submission
begin

lemma "(n::nat) mod 10 = (n ^ 5) mod 10"
by (rule Submission.modpower5)

end```

### Definitions File

`Require Export Arith Lia.`

### Template File

```Require Import Defs.

(* Proving this might be useful (but is not mandatory). *)
Lemma mod_power a b n :
((a mod b) ^ n) mod b = (a ^ n) mod b.

Theorem modpower5 : forall (n: nat),
n mod 10 = (n ^ 5) mod 10.
Proof.
(* todo *)

### Definitions File

```theory Defs
imports Main
begin
end```

### Template File

```theory Submission
imports Defs
begin

lemma modpower5: fixes n :: nat
shows "n mod 10 = (n ^ 5) mod 10" sorry

end```

### Check File

```theory Check
imports Submission
begin

lemma "(n::nat) mod 10 = (n ^ 5) mod 10"
by (rule Submission.modpower5)

end```

Terms and Conditions