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.