mat1={{1,2,3},{4,5,6},{7,8,9}}

mat//MatrixForm

CharacteristicPolynomial[mat,X]

DiagonalMatrix[{1,2,3,4}]//MatrixForm

v = {1,2,3}

DiagonalMatrix[v]//MatrixForm

mat2=SparseArray[{Band[{2,1}]->1.,Band[{1,1}]->2.,Band[{1,2}]->3.},5]

mat2//MatrixForm

mat3=SparseArray[{Band[{2,1}]->v,Band[{1,1}]->2.,Band[{1,2}]->3.},4]

mat3//MatrixForm

fac[n_]:=n*fac[n-1]

fac[1]=1

fac[2]

fibo[n_]:= Join[fibo[n-1],fibo[n-2]];

fibo[1] = {vb};

fibo[2] = {va};

fibo[4]

fibo[4][[1]]

reste[n_,k_]:=Join[fibo[n][[k+1]],reste[n,k+1]];

reste2[n_,k_]:=While[k<Length[fibo[n]]-1,Join[{fibo[n][[k+1]]},reste2[n,k+1]];k++]

reste2[5,3]

fibo[5]

Length[fibo[5]]

reste2[5,1]

reste[n,Length[fibo[n]]-1]={Last[fibo[n]]};

reste[5,3]

Clear[reste]

reste[n_,k_]:=Join[fibo[n][[k+1]],reste[n,k+1]];

reste[n,Length[fibo[n]]-1]={Last[fibo[n]]};

l = {1,2,3,2,5,6,7}

Take[l,-3]

reste3[k_,n_]:= Take[fibo[n], Length[fibo[n]]-k];

reste[3,5]

reste3[3,5]

fibo[5]

matkn[k_,n_]:=SparseArray[{Band[{2,1}]->-1,Band[{1,1}]->reste3[k,n],Band[{1,2}]->-1},Length[fibo[n]]-k];

mat[1,4]

Clear[mat]

delat[k_,n_]:=CharacteristicPolynomial[mat[k,n],x];

delat[3,5,x]

Clear[delat]

delat[3,5]

CharacteristicPolynomial[mat[3,5],X]

CharacteristicPolynomial[mat,x]

CharacteristicPolynomial[mat1,x]

Det[mat1]

Det[reste3[3,5]]

Det[matkn[3,5]]

Det[{{a,b},{c,d}}]

matkn[3,5]

Det[matkn[3,5]]

CharacteristicPolynomial[matkn[3,5],x]

Factor[(x^2)+1,Extension->I]

fibo06[n_]:=Join[fibo06[n-1],fibo06[n-2]];

fibo06[1]={-0.6};

fibo06[2]={0.6};

fibo2[1,2,3]

fibo06[4]

reste06[k_,n_]:= Take[fibo06[n], Length[fibo06[n]]-k];

matkn06[k_,n_]:=SparseArray[{Band[{2,1}]->-1,Band[{1,1}]->reste06[k,n],Band[{1,2}]->-1},Length[fibo06[n]]-k];

delta06[k_,n_]:=CharacteristicPolynomial[matkn06[k,n],x];

p [x_]:= CharacteristicPolynomial[matkn06[k,n],x];

Factor[delta06[3,7]]

m = matkn06[0,9];
delta06[3,9]

p[x_]:=3.816898942359956` -25.262131162710894` x-504.51103188083215` (x^2)+2910.729361026953` (x^3)+11474.673508133641` (x^4)-84217.4644396783` (x^5)+45773.08835580739` (x^6)+409664.2146693148` (x^7)-457573.4160561454` (x^8)-950714.1657976103` (x^9)+1.3410605405645238`*^6 (x^10)+1.3112579011900453`*^6 (x^11)-2.1695856499785935`*^6 (x^12)-1.1662124633874884`*^6 (x^13)+2.261396244445372`*^6 (x^14)+681374.9947441029` (x^15)-1.6230262962398815`*^6 (x^16)-248437.37832119974` (x^17)+827755.3061345113` (x^18)+41591.118844079734` (x^19)-303365.7437323469` (x^20)+7950.64199321613` (x^21)+79486.19271014401` (x^22)-6832.373276160031` (x^23)-14546.7609216` (x^24)+1954.6024320000047` (x^25)+1767.5548799999992` (x^26)-308.6704000000003` (x^27)-128.18399999999994` (x^28)+26.76000000000001` (x^29)+4.1999999999999975` (x^30)-(x^31);

Eigenvalues[m]

Plot[p,x]

Plot[p,{x,-2,2}]

vap06 = Eigenvalues[m]

test={1,2,3}

f[x_] := x+2

f[test]

f[2]

l06 = p[vap06]

Clear[p,l06]

p[1]

l06=p[vap06]

ListPlot[l06]

ListPlot[vap06]

m06011 = matkn06[0,11];
m06311 = matkn06[3,11];

Clear[m06011,m06311];

l06311 = Eigenvalues[m06311];
l06011 = Eigenvalues[m06011];

ListPlot[{l06311,l06011}]

delta06[3,11]

p06311[x_]:=21.207900435423248` +858.9266793964447` x-4871.633047680564` (x^2)-322494.23387438606` (x^3)+1.0321328933803174`*^6 (x^4)+4.351776705710412`*^7 (x^5)-1.6442319013540387`*^8 (x^6)-2.8088438954867325`*^9 (x^7)+1.3975806515641508`*^10 (x^8)+9.017509430728587`*^10 (x^9)-6.288735854850583`*^11 (x^10)-1.135650942717751`*^12 (x^11)+1.5171520248389322`*^13 (x^12)-8.548095630851235`*^12 (x^13)-1.8917845147602934`*^14 (x^14)+3.938776352050686`*^14 (x^15)+1.0975381168344498`*^15 (x^16)-4.178834105898721`*^15 (x^17)-2.356818211458721`*^15 (x^18)+2.4186047310581556`*^16 (x^19)-8.370971039957685`*^15 (x^20)-9.184314270429722`*^16 (x^21)+8.62604815275992`*^16 (x^22)+2.47030857641195`*^17 (x^23)-3.672149165899703`*^17 (x^24)-4.835625762175342`*^17 (x^25)+1.0533424955688022`*^18 (x^26)+6.724034333282972`*^17 (x^27)-2.2849533940776732`*^18 (x^28)-5.581784931955378`*^17 (x^29)+3.9461083741861074`*^18 (x^30)-9.189335521048704`*^16 (x^31)-5.584977673924933`*^18 (x^32)+1.2628350806258995`*^18 (x^33)+6.596322841864819`*^18 (x^34)-2.6027760332895473`*^18 (x^35)-6.577615254929955`*^18 (x^36)+3.597723314031206`*^18 (x^37)+5.576594543586666`*^18 (x^38)-3.8875612794218286`*^18 (x^39)-4.031808021068805`*^18 (x^40)+3.463181568438096`*^18 (x^41)+2.482174191379159`*^18 (x^42)-2.6092753311760896`*^18 (x^43)-1.2912447990609828`*^18 (x^44)+1.6867062564943296`*^18 (x^45)+5.567438945236123`*^17 (x^46)-9.435752347410473`*^17 (x^47)-1.8974867395531885`*^17 (x^48)+4.5916719159525357`*^17 (x^49)+4.395158548547162`*^16 (x^50)-1.9489953896087917`*^17 (x^51)-1.222703973003584`*^15 (x^52)+7.221714831875957`*^16 (x^53)-5.238775258303034`*^15 (x^54)-2.3335939518902104`*^16 (x^55)+3.379112690997248`*^15 (x^56)+6.557083959297758`*^15 (x^57)-1.4041006572250658`*^15 (x^58)-1.5938744138634632`*^15 (x^59)+4.533343010049909`*^14 (x^60)+3.324002914227588`*^14 (x^61)-1.1993275228257803`*^14 (x^62)-5.8698644801065125`*^13 (x^63)+2.6513110007147316`*^13 (x^64)+8.586497462779236`*^12 (x^65)-4.92743387955802`*^12 (x^66)-9.981759117652452`*^11 (x^67)+7.686792115037325`*^11 (x^68)+8.342046790216895`*^10 (x^69)-9.990917983273248`*^10 (x^70)-3.1929101394432354`*^9 (x^71)+1.0673905119477541`*^10 (x^72)-3.574008482291119`*^8 (x^73)-9.173254372015711`*^8 (x^74)+8.516070255490842`*^7 (x^75)+6.1264324525013015`*^7 (x^76)-9.290532111808514`*^6 (x^77)-2.994358249267199`*^6 (x^78)+658176.8140031999` (x^79)+94283.05478399995` (x^80)-30986.36543999999` (x^81)-1191.451199999999` (x^82)+892.3199999999997` (x^83)-28.480000000000018` (x^84)-11.999999999999993` (x^85)+(x^86);

v8 = fibo06[8];

v9 = fibo06[9];

v7 = fibo06[7];

m8 = matkn06[0,8];

m9 = matkn06[0,9];

m7 = matkn06[0,7];

vap8 = Eigenvalues[m8];

vap7= Eigenvalues[m7];

vap9 = Eigenvalues[m9];

ListPlot[{vap8,vap7,vap9,vap13,vap16}]

v13 = fibo06[13];

m13 = matkn06[0,13];

vap13 = Eigenvalues[m13];

v16 = fibo06[16];

m16 = matkn06[0,16];

vap16= Eigenvalues[m16];