Welcome to the Ranch
That looks like a recursive problem to me, but you probably don’t know about recursion yet.
Get a sheet of paper, a pencil and an eraser; the last is the most important piece of equipment at this stage. Start by writing down how you intend to write
1
12
123
1234
12345
123456
Since you say you have got that to work, it shouldn’t be too difficult. Then work out the differences. Do it bit by bit. And don’t try to write
Java nor pseudocode at this stage. Write plain English.