Permutation of Dresses Possible Duplicate:
  In how many ways we can put $r$ distinct objects into $n$  baskets?  




How many number of ways I can wear four dresses for n days without wearing the same dress for two consecutive days  and the dress on first and nth day should also not be same. Repetition of dresses is allowed.

For $n=3$   It'll be  $4\times3\times2 = 24$.

Can someone please tell me what will be the answer of $n\ge5$ and also how to solve such questions where objects to arrange are lesser than spaces. 

A sample scenario for

$n=5$  A1,A2,A1,A2,A3

$n=6$  A1,A2,A1,A2,A1,A2
Edited:
for the dresses question.

$4*3^{n-1} -9$
Edited:
for the dresses question.

$4*3^{n-1} -9$