Look at the pattern - all the rows are the same except
on the 2nd row the 5 is replaced by a *
on the next row the 4s and 5 are replace by an *
on the next row the 3,4,5 are replaced... etc
You can use an if test to decide for each position whether to print the number or an *