
public class Exercise_06_01 {

	public static void main(String[] args) {
		for(int nr = 1; nr <= 100; nr++ ){
			System.out.printf("%5d ", getPentagonalNumber(nr));
			if(nr % 10 == 0)
				System.out.println("");
		}
	}
	
	public static int getPentagonalNumber(int n) {
		return n*(3 * n - 1) / 2;
	}

}

@@ -1,8 +1,151 @@
+/**%0A * Exercise 6.1 from the book Introduction to Java Programming (10th).%0A *%0A * @author Henrik Samuelsson, henrik.samuelsson(at)gmail.com%0A */%0A
 %0Apublic 
@@ -215,16 +215,17 @@
  %7B%0A%09%09for
+ 
 (int nr 
@@ -248,10 +248,10 @@
 nr++
- 
 )
+ 
 %7B%0A%09%09
@@ -308,16 +308,17 @@
 );%0A%09%09%09if
+ 
 (nr %25 10
@@ -363,10 +363,9 @@
 %0A%09%7D%0A
-%09
 %0A
+
 %09pub
@@ -418,17 +418,19 @@
 return n
-*
+ * 
 (3 * n -

Edit of exercise 6.1.