logoStarPatterns
Back to Patterns

Number Increasing Pyramid

Pattern Result

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Code Implementation

Explanation

The Number Increasing Pyramid pattern creates a triangle where each row contains numbers starting from 1 and increasing up to the row number. For example, row 3 contains the numbers 1, 2, and 3. The outer loop iterates from 1 to n, representing each row. The inner loop runs from 1 to the current row number, adding the current column number to the row string.