# F(1) = 1 # F(n) = n written in base X, where # X = F(n-1) interpreted in base 10 # Print F(1) through F(27) def B(x, b): d = [] while x: d.append(str(x % b)) x //= b d.reverse() return ''.join(d) def F(n): if n==1:return 1 if n==2:return 11 return B(n,int(F(n-1))) if __name__ == "__main__": for i in range(1,28): print(F(i))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).