输出一个相加后的整数。
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext())
{
int n = scanner.nextInt();
int base = 2;
int sum = 0;
for (int i = 0; i < n; i++)
sum += base + 3 * i;
System.out.println(sum);
}
}
}