An integer sequence
(p
1
,p
2
,...,p
n
)
is called P-sequence if:
for all
i
in
{1,2,...,n-1}
p
i
is in
{i,...,p
i+1
}
, and
p
n
=n
Input:
n
(
0 < n < 10
)
This Java applet generates P-sequences in lexicogrphic order.