题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
- 思路:等差数列,m的立方如果由m个数组成,那么这m个数的平均数=m²,最小数为m² - m + 1
while True:
try:
m = int(input())
left = m ** 2 - m + 1
print("+".join(map(str, [(left + 2*i) for i in range(m)])))
except:
break