题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
//由等差数列公式可得第一个数a1=n(n-1)+1
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
int a1 = n*(n-1)+1;
System.out.print(a1);
for(int i=1; i<n; i++){
int ai = a1+2*i;
System.out.print("+" + ai);
}
System.out.println();
}
sc.close();
}
}