From 605831c4f5315c469749eeb3f50796e69ccaaf52 Mon Sep 17 00:00:00 2001 From: Philippe Zwietering Date: Sun, 8 Nov 2020 22:54:08 +0100 Subject: [PATCH] Very easy to do in Python --- 29/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 29/main.py diff --git a/29/main.py b/29/main.py new file mode 100644 index 0000000..f1d9854 --- /dev/null +++ b/29/main.py @@ -0,0 +1,20 @@ +# Distinct Powers + +# Consider all integer combinations of a^b for 2 <= a <= 100 and 2 <= b <= 100 +# How many distinct terms are there in that sequence + +import math + +def main(): + print("Hello, this is Patrick") + + s = set() + for a in range(2, 101): + for b in range(2, 101): + s.add(a**b) + + print(len(s)) + + +if __name__ == "__main__": + main() \ No newline at end of file