Maybe this? ``` layernumber = Accumulate[Mod[Range[1, 2 Nlayer], 2]]; interfacenumber = 1 + Accumulate[Mod[Range[0, 2 Nlayer - 1], 2]]; MapThread[Times, {layernumber, interfacenumber}] Inner[X[#1]*Y[#2] &, layernumber, interfacenumber, List] ```