Upper half: keep a counter that increases across rows of length 1 to 5.
Lower half: continue from 14 counting down, rows of length 4 to 1.
Solution
Python
n=5num=1forrowinrange(1,n+1):print(" ".join(f"{num+i:2}"foriinrange(row)))num+=rownum-=2# last printed was 15, continue from 14forrowinrange(n-1,0,-1):print(" ".join(f"{num-i:2}"foriinrange(row)))num-=row