A good answer might be:

Yes.

Formula for Triangle

Triangle is so easy that you don't need to use either iteration or recursion for it. You might recognize Triangle(N) as the sum of the series

1 + 2 + 3 + ... + (N-1) + N = (N(N+1)) / 2

For example

1 + 2 + 3 + 4  = (4(5)) / 2 = 10

Of course a Java method that implements this formula is simple. And that is how you would do it in a practical situation. But the goal of this chapter was to show recursion with Java and and triangle numbers work well for that.

QUESTION 20:

Are you ready for another example?