From af2b2b4c1cf7e337e9c5d2bdf3d7fdfa0570641c Mon Sep 17 00:00:00 2001 From: Simon Green Date: Thu, 14 Jul 2022 23:16:39 +1000 Subject: sgreen solutions to challenge 173 --- challenge-173/sgreen/python/ch-2.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 challenge-173/sgreen/python/ch-2.py (limited to 'challenge-173/sgreen/python/ch-2.py') diff --git a/challenge-173/sgreen/python/ch-2.py b/challenge-173/sgreen/python/ch-2.py new file mode 100755 index 0000000000..fb5a135067 --- /dev/null +++ b/challenge-173/sgreen/python/ch-2.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import math + + +def main(): + # Set S0 of 2 + solutions = [2] + while len(solutions) < 10: + # The next value is the product of the current array plus one + solutions.append(math.prod(solutions)+1) + + # Print the solution + print(*solutions, sep='\n') + + +if __name__ == '__main__': + main() -- cgit