| 1 | initial version |
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)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.