### Related

##### eigenvalues-matrix

A:matrix([10,10],[-4,...

eigenvalues(A);

Calculate

##### eigenvalues-matrix-sqrt-submatrix-transpose

f:matrix([1,x],[0,1]);

uu:transpose(f).f;

uuEig:eigenvalues(uu);

Calculate

##### and

t1 : (a0) and (a2) an...

t2: (not a0) and ( a1...

summer:t1 or t2;

Calculate

##### eigenvalues-matrix

A: matrix([1,2,3],[2,...

eigenvalues(A);

Calculate

##### eigenvalues-eigenvectors-invert-matrix

m: matrix ([1,-3,3],[...

eigenvalues (m);

eigenvectors (m);

Calculate

##### and-cardinality-every-integer_partitions-integerp-lambda-primep-subset

xprimep(x) := integer...

cardinality (subset (...

Calculate

##### eigenvalues-eigenvectors-matrix

M:matrix([1,2,3],[2,3...

eigenvalues(M);

eigenvectors(M);

Calculate

##### and-pi-true

t1:(not A) and (not B...

t2: A and D;

t3: B and C;

Calculate

##### and-cardinality-every-integer_partitions-integerp-lambda-primep-subset

xprimep(x) := integer...

cardinality (subset (...

Calculate

##### and

b1: (not a0) and (a1 ...

b1, a0=true,a1=false,...

b1, a0=true,a1=false,...

Calculate

### [and,eigenvalues,genmatrix]

Run Example
```(%i1)n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
i, j
(%i3) M1:genmatrix (h1,n,n);
[ 1  0  0  1 ]
[            ]
[ 1  1  0  0 ]
(%o3)                           [            ]
[ 0  1  1  0 ]
[            ]
[ 0  0  1  1 ]
(%i4)  eivals(M1);
[ 1  0  0  1 ]
[            ]
[ 1  1  0  0 ]
(%o4)                       eivals([            ])
[ 0  1  1  0 ]
[            ]
[ 0  0  1  1 ]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
i, j
(%i6) M2:genmatrix (h2,n,n);
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%o6)                           [            ]
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%i7)  eivals(M2);
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%o7)                       eivals([            ])
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
i, j
(%i9) M3:genmatrix (h3,n,n);
[ 1  1  0  0 ]
[            ]
[ 0  1  1  0 ]
(%o9)                           [            ]
[ 0  0  1  1 ]
[            ]
[ 1  0  0  1 ]
(%i10)  eivals(M3);
[ 1  1  0  0 ]
[            ]
[ 0  1  1  0 ]
(%o10)                      eivals([            ])
[ 0  0  1  1 ]
[            ]
[ 1  0  0  1 ]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j >
n) and (i >
n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
i, j
and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j > n) and (i >
n))
then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
[ 1  0  0  1  0  0  0  0 ]
[                        ]
[ 1  1  0  0  0  0  0  0 ]
[                        ]
[ 0  1  1  0  0  0  0  0 ]
[                        ]
[ 0  0  1  1  0  0  0  0 ]
(%o12)                    [                        ]
[ 0  0  0  0  1  0  1  0 ]
[                        ]
[ 0  0  0  0  0  1  0  1 ]
[                        ]
[ 0  0  0  0  1  0  1  0 ]
[                        ]
[ 0  0  0  0  0  1  0  1 ]
(%i13)  eigenvalues(M12);
(%o13)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i14) ```
Run Example
```n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
i, j
(%i3) M1:genmatrix (h1,n,n);
[ 1  0  0  1 ]
[            ]
[ 1  1  0  0 ]
(%o3)                           [            ]
[ 0  1  1  0 ]
[            ]
[ 0  0  1  1 ]
(%i4)  eigenvalues(M1);
(%o4)               [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
i, j
(%i6) M2:genmatrix (h2,n,n);
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%o6)                           [            ]
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%i7)  eigenvalues(M2);
(%o7)                          [[2, 0], [2, 2]]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
i, j
(%i9) M3:genmatrix (h3,n,n);
[ 1  1  0  0 ]
[            ]
[ 0  1  1  0 ]
(%o9)                           [            ]
[ 0  0  1  1 ]
[            ]
[ 1  0  0  1 ]
(%i10)  eigenvalues(M3);
(%o10)              [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j >
n) and (i >
n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
i, j
and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j > n) and (i >
n))
then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
[ 1  0  0  1  0  0  0  0 ]
[                        ]
[ 1  1  0  0  0  0  0  0 ]
[                        ]
[ 0  1  1  0  0  0  0  0 ]
[                        ]
[ 0  0  1  1  0  0  0  0 ]
(%o12)                    [                        ]
[ 0  0  0  0  1  0  1  0 ]
[                        ]
[ 0  0  0  0  0  1  0  1 ]
[                        ]
[ 0  0  0  0  1  0  1  0 ]
[                        ]
[ 0  0  0  0  0  1  0  1 ]
(%i13)  eigenvalues(M12);
(%o13)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i14) h13[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=3) and (j >
n) and (i >
n)) then 1 else 0;
(%o14) h13     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
i, j
and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 3)) and (j > n) and (i >
n))
then 1 else 0
(%i15) M13:genmatrix(h13,2*n,2*n);
[ 1  0  0  1  0  0  0  0 ]
[                        ]
[ 1  1  0  0  0  0  0  0 ]
[                        ]
[ 0  1  1  0  0  0  0  0 ]
[                        ]
[ 0  0  1  1  0  0  0  0 ]
(%o15)                    [                        ]
[ 0  0  0  0  1  1  0  0 ]
[                        ]
[ 0  0  0  0  0  1  1  0 ]
[                        ]
[ 0  0  0  0  0  0  1  1 ]
[                        ]
[ 0  0  0  0  1  0  0  1 ]
(%i16)  eigenvalues(M13);
(%o16)              [[1 - %i, %i + 1, 2, 0], [2, 2, 2, 2]]
(%i17) h23[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=3) and (j >
n) and (i >
n)) then 1 else 0;
(%o17) h23     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j <= n)
i, j
and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 3)) and (j > n) and (i >
n))
then 1 else 0
(%i18) M23:genmatrix(h23,2*n,2*n);
[ 1  0  1  0  0  0  0  0 ]
[                        ]
[ 0  1  0  1  0  0  0  0 ]
[                        ]
[ 1  0  1  0  0  0  0  0 ]
[                        ]
[ 0  1  0  1  0  0  0  0 ]
(%o18)                    [                        ]
[ 0  0  0  0  1  1  0  0 ]
[                        ]
[ 0  0  0  0  0  1  1  0 ]
[                        ]
[ 0  0  0  0  0  0  1  1 ]
[                        ]
[ 0  0  0  0  1  0  0  1 ]
(%i19)  eigenvalues(M23);
(%o19)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i20) ```
Run Example
```n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
i, j
(%i3) M1:genmatrix (h1,n,n);
[ 1  0  0  1 ]
[            ]
[ 1  1  0  0 ]
(%o3)                           [            ]
[ 0  1  1  0 ]
[            ]
[ 0  0  1  1 ]
(%i4) eigenvalues(M1);
(%o4)               [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
i, j
(%i6) M2:genmatrix (h2,n,n);
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%o6)                           [            ]
[ 1  0  1  0 ]
[            ]
[ 0  1  0  1 ]
(%i7) eivals(M2);
(%o7)                          [[2, 0], [2, 2]]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
i, j
(%i9) M3:genmatrix (h3,n,n);
[ 1  1  0  0 ]
[            ]
[ 0  1  1  0 ]
(%o9)                           [            ]
[ 0  0  1  1 ]
[            ]
[ 1  0  0  1 ]
(%i10) eivals(M3);
(%o10)              [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j-i <
n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (i-j >
n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1))
i, j
and (j - i < n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (i - j >
n))
then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
[ 1  0  0  1  0  0  0  0 ]
[                        ]
[ 1  1  0  0  1  0  0  0 ]
[                        ]
[ 0  1  1  0  0  1  0  0 ]
[                        ]
[ 0  0  1  1  0  0  1  0 ]
(%o12)                    [                        ]
[ 1  0  0  1  1  0  0  1 ]
[                        ]
[ 1  1  0  0  1  1  0  0 ]
[                        ]
[ 1  1  1  0  0  1  1  0 ]
[                        ]
[ 0  1  1  1  0  0  1  1 ]
(%i13) ```

### Related Help

Help for And

Help for Eigenvalues

Help for Genmatrix