@@ -0,0 +1,839 @@
+'''%0AProblem 029%0AConsider all integer combinations of ab for 2 %E2%89%A4 a %E2%89%A4 5 and 2 %E2%89%A4 b %E2%89%A4 5:%0A%0A2**2=4, 2**3=8, 2**4=16, 2**5=32%0A3**2=9, 3**3=27, 3**4=81, 3**5=243%0A4**2=16, 4**3=64, 4**4=256, 4**5=1024%0A5**2=25, 5**3=125, 5**4=625, 5**5=3125%0A%0AIf they are then placed in numerical order, with any repeats removed, %0A   we get the following sequence of 15 distinct terms:%0A%0A4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125%0A%0AHow many distinct terms are in the sequence generated by %0A   a**b for 2 %E2%89%A4 a %E2%89%A4 100 and 2 %E2%89%A4 b %E2%89%A4 100? %0A%0A%0ASolution: Copyright 2017 Dave Cuthbert, MIT License%0A'''%0A%0A%0Adef solve_problem(a,b):%0A    power_set = set()%0A%0A    for i in range(2, a + 1):%0A        for j in range(2, b + 1):%0A            power_set.add(i ** j)     %0A%0A    return(len(power_set))%0A%0A%0Aif __name__ == %22__main__%22:%0A    a = b = 100%0A%0A    print(solve_problem(a, b))%0A

Solve distinct powers