n-digit numbers created using digits 5 and 9, where no four identical digits stand side by side.

How many n-digit numbers can be created using only digits 5 and 9, where no four identical digits stand side by side?
Nusrat NuriyevAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
a[1] = 2
a[2] = 4
a[3] = 8
a[n] = a[n - 1] + a[n - 2] + a[n - 3]
https://oeis.org/A135491
0
 
Nusrat NuriyevAuthor Commented:
ozo, also, this a[n]=a[n-1]+a[n-2]+a[n-3] gives us the n-digit numbers which can be created using only digits 5 and 9, where no three ones stand side by side. (but this does not mentioned in OEIS)

Could you explain why this sequence solves my original question? For better understanding.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.