An integer sequence $\left(p$1,p2,...,pn) is called P-sequence if:

• for all $i$ in $\left\{1,2,...,n-1\right\}$ $p$i is in $\left\{i,...,p$i+1}, and
• $p$n=n

Input: n ( 0 < n < 10 )

This Java applet generates P-sequences in lexicogrphic order.