<<mod edit: answer to this post from the sticky "projects for the beginner">>
#1 * 8 + 1 = 9
#12 * 8 + 2 = 98
#123 * 8 + 3 = 987
#1234 * 8 + 4 = 9876
#12345 * 8 + 5 = 98765
#123456 * 8 + 6 = 987654
#1234567 * 8 + 7 = 9876543
#12345678 * 8 + 8 = 98765432
#123456789 * 8 + 9 = 987654321
def caculate():
i = 1
while i <= 9:
plusone = x2max(i)
print plusone," * ",8," + ",i," = ",plusone*8+i
i = i + 1
def x2max(i):
if i == 1:
return 1
else:
return x2max(i-1)*10+i