How many ways are there to arrange the digits 1 to 7 in a line such that no three consecutive digits are ascending?
For example:
7132564 contains three consecutive ascending digits since 2<5<6.
3215476 does not contain three consecutive ascending digits.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Mathematica
Length@Select[Permutations[Range@7],!Or@@OrderedQ/@Partition[#,3,1]&]
2017