First time here? Check out the FAQ!
answered 2020-10-29 14:50:08 +0100
Here is some code
a = {1: 1, 2: 2} for n in range(3, 20): b = a[n - 1] if ZZ(b).is_prime(): a[n] = 2 * b else: a[n] = b - 1 print(a)