How many arrangements of the digits $1,2,3, ... ,9$ have the property that every digit (except the first) is no more than $3$ greater than the previous digit?
(For example, the arrangement $214369578$ has this property. However, $312548697$ does not have the property, since 8 occurs immediately after $4$, and $8\gt 4+3$.)
EDIT: I think this problem should have catalan numbers involved, since this was part of some homework and other similar questions involved them.
I counted the permutations satisfying the desired condition with a PARI-program. The result is
?
z=0;for(k=1,9!,x=numtoperm(9,k);gef=1;for(j=1,8,if(x[j+1]-x[j]>3,gef=0));if(ge f==1,z=z+1));print(z)
24576
But I have no idea how to use catalan-numbers to get this result.
Perhaps, it helps, that the factorization of the desired number is $2^{13}*3$
I generalized to permutations with 5,6,... elements and got the following result :
?
for(l=5,10,z=0;for(k=1,l!,x=numtoperm(l,k);gef=1;for(j=1,l-1,if(x[j+1]-x[j]>3, gef=0));if(gef==1,z=z+1));print(l," ",z," ",factor(z)))
5 96 [2, 5; 3, 1]
6 384 [2, 7; 3, 1]
7 1536 [2, 9; 3, 1]
8 6144 [2, 11; 3, 1]
9 24576 [2, 13; 3, 1]
10 98304 [2, 15; 3, 1]
So, the desired number seems to be $2^{2p-5}*3$ for permutations with p elements.