Thursday

November 26, 2015
Posted by **Susie** on Friday, May 28, 2010 at 7:25am.

Produce Output

For each problem, you are to produce the code, in JAva, to create the following output to the screen.

1.

+

+++0

++++++00

++++++++++000

... (this pattern continues forever)

2.

5 6 7 8 9 10

5 7 9 11 13 15

5 8 11 14 17 20

... (the pattern continues forever)

3.

0 2 4 6 8 10

1 3 5 7 9 11

3 5 7 9 11 13

6 8 10 12 14 16

... (pattern continues forever)

- computer science -
**MathMate**, Friday, May 28, 2010 at 8:17am1. It's the Pascal's triangle, namely

1,3,6,10,15...

or

1

+2=3

+3=6

+4=10

+5=15....

2.

The pattern is

5,6,7, ( add 1 to get the next number)

5,7,9...(add 2 to get the next number)

5,8,11,....(add 3 to get the next number)

3. It's a combination of 1 and 2:

Note the first column is 0,1,3,6,10, the numbers we did previously. Then add 2 to make the second column, 2,3,5,8,12...

and so on.