1,481 views

1 Answer

0 votes
0 votes
The sequence

${n+3,n+2,n +1,n,n + 7,n +6, n+5,n +4, n+11, n +10,n +9,n+8,n+ 15,n +14,n+ 13,n+12}$
it has both increasing and decreasing subsequences of maximum length 4.
Input $n = 1$.
RESULT
${4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13}$

Input $n = 2$.

RESULT

${5,4,3,2,9,8,7,6,13,12,11,10,17,16,15,14}$

Related questions

0 votes
0 votes
0 answers
1
admin asked Apr 29, 2020
446 views
There are $51$ houses on a street. Each house has an address between $1000\: \text{and}\: 1099,$ inclusive. Show that at least two houses have addresses that are consecut...
0 votes
0 votes
0 answers
3