per:={};

For[k=1,k<301,k++,AppendTo[per,2+(-1)^k]];

Length[per]

per[[1]]

matper[k_]:=SparseArray[{Band[{2,1}]->-1,Band[{1,1}]->per[[k]],Band[{1,2}]->-1},300];

m = SparseArray[{Band[{2,1}]->-1,Band[{1,1}]->per,Band[{1,2}]->-1},300];

m[[1,1]]

sp = Eigenvalues[m];

per50:={};

For[kk=1,kk<51,kk++,AppendTo[per50,2+(-1)^kk]];

m50:=SparseArray[{Band[{2,1}]->-1,Band[{1,1}]->per50,Band[{1,2}]->-1},50];

sp50 = Eigenvalues[m50];

ListPlot[sp50]