Not getting the logic

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int nst=1;
int nsp=n-1;
int row=1;
int val=1;
while(row<=n){
for(int cst=1;cst<=nst;cst++){
System.out.print(val);
}
for(int csp=1;csp<=nsp;csp++){
System.out.print(" ");
}
System.out.println();
nst++;
nsp–;
row++;
}
}
}
i am getting the output here as
1
11
111
1111
11111
111111
but i am not getting the clue to print the pattern as
1
11
111
1001
11111
1000001