题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
while True: try: m = int(input()) a = m * m - m + 1 #设第一个数为a m*m*m=m个连续奇数之和=m*中位数(n),即m*m = n, #当m为偶数 a=m*m-1-2(m/2-1)=m * m - m + 1 #当m为奇数 a=m*m-2((m-1)/2)=m * m - m + 1 b = str(a) for i in range(1, m): j = a + 2 * i b += "+" b += str(j) print(b) except: break