Problem

Source: China Western Mathematical Olympiad 2014 No.4

Tags: floor function, algorithm, algebra, combinatorics, hard combinatorics



Given a positive integer $n$, let $a_1,a_2,..,a_n$ be a sequence of nonnegative integers. A sequence of one or more consecutive terms of $a_1,a_2,..,a_n$ is called $dragon$ if their aritmetic mean is larger than 1. If a sequence is a $dragon$, then its first term is the $head$ and the last term is the $tail$. Suppose $a_1,a_2,..,a_n$ is the $head$ or/and $tail$ of some $dragon$ sequence; determine the minimum value of $a_1+a_2+\cdots +a_n$ in terms of $n$.