Question: How can we create the following upper triangular matrix

How can we create the following upper triangular matrix?

where k and M are any integers,
 F and L are MxM Matrices  as follows

 

restart;
with(LinearAlgebra):
k:=2:
M:=3:
F:=Matrix(M,M):
for i from 1 to M do 
  for j from 1 to M do
 F[1,1] := 2;
    F[i,j]:=0
  end do
end do:
F;
L:=Matrix(M,M): 
L:=LinearAlgebra[BandMatrix]([
      [seq(-sqrt(2*i-1)/(2*i-1)*sqrt(2*i-3),i=2..M)], [1,seq(0*i,i=1..M-1)],[seq((sqrt(2*i-3))/((2*i-3)*sqrt(2*i-1)),i=2..M)]]);

 

Please Wait...