Given 2017 positive real numbers a1,a2,…,a2017. For each n>2017, set an=max{ai1ai2ai3∣i1+i2+i3=n,1≤i1≤i2≤i3≤n−1}.
Prove that there exists a positive integer m≤2017 and a positive integer N>4m such that anan−4m=an−2m2 for every n>N.