I'm a total beginner to java and need help writing this nested for loop. This is the desired output.
2 3 5
5 10 26
11 31 131
23 94 656
I understand that the increment is 2 times the first number + 1, but I don't understand how to create the loop for it.
public static void main(String[] args) {
for(int i = 2; i <= 5; i++) {
for(int j = i; j <= i; j++) {
System.out.print(j+(i*j));
}
System.out.println();
}
}