First, we list the numbers each number can be next to
Note no number can be next to itself, and every number other than the ones on the side are next to two values
1: 5,6
2: 3,4,5,6
3: 2,4,5,6
4: 2,3,5,6
5: 1,2,3,4,6
6: 1,2,3,4,5
We realize that every number can be next to any value except 1, and only 1 cannot be next to most numbers. We have two cases
1. 1 is in the middle (not on the edge)
1 must be next to 5 and 6, so we make a group of 1,5,6, where 1 must be in the middle, which has 2 arrangements within. Outside there are 4! = 24 arrangements, making 24 x 2 = 48
2. 1 is on the edge
1 must be next to 5 or 6, so there are 2 possibilities for that. The 1 can also be on either edge, making another 2 ways. The other 4 have 4! = 24 ways, therefore there are 2 x 2 x 24 = 96
Therefore, the total ways is 48 + 96 = ...
I'm going to let you do the addition yourself
Just kidding it is 144