We have to form a number of n digits having digits from 1 to 9. Constraint is that first and last digit must be same and no two consecutive digits must be same. How many such number of n digits can be there?
Number of n digits having no same consecutive digits and same first and last digit
1
$\begingroup$
permutations
-
0I guess $n=1$ would fit the constraints given here. – 2012-10-05
1 Answers
1
Since the first and last digits have to be the same, this is the same as asking how many ways there are to colour $n-1$ points on a circle with $9$ colours such that any two adjacent points have different colours. The answer is given here: $(-1)^{n-1}(9-1)+(9-1)^{n-1}=(-1)^{n-1}\cdot8+8^{n-1}$