Given N and need print the pattern given below
input:
N = 5
output :
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
N=int(input())
for i in range(N):
x=i+1
y=N-1
for j in range(i+1):
print(format(x,"<3"),end='')
x+=y
y-=1
print("")
Comments
Leave a comment