Finding the number of ways

Hi, if we have an initial arrangement say 12345 where all elements are unique, then in how many ways can one re-arrange them so that in the final configurations none of the elements which were adjacent to each other in the given arrangement are adjacent now in the final configurations.?

Does this involve some series?

E.g for 5 element say 12345, the number of such arrangements is 14.

Thanks.

Re: Finding the number of ways

Re: Finding the number of ways

if the initial configuration is ABCDE , then the 14 required configurations are:

ACEBD

ADBEC

BDACE

BDAEC

BECAD

CADBE

CAEBD

CEADB

CEBDA

DACEB

DBEAC

DBECA

EBDAC

ECADB