### Related

##### eigenvalues-matrix

A:matrix([5,-3],[3,-5]);

eigenvalues(A);

Calculate

##### and

hydrogen: (a) and (b)...

helium: (a) and (b) a...

lithium: (a) and (not...

Calculate

K:matrix([-2*k,k,0.0]...

eigenvalues(K);

Calculate

##### and-if-lambda-maplist-not

:lisp (mapcar (lambda...

:lisp (mapcar (lambda...

:lisp (maplist (lambd...

Calculate

S:3;

A:2;

xRef:20;

Calculate

##### and

t0001: a0 and (not a1...

t0010: a0 and (not a1...

t0011: a0 and a1 and ...

Calculate

##### and-or

t1:(not a2);

t2:(not a3) or ((not ...

t3: (a3) or (a1 and a4);

Calculate

##### eigenvalues-eigenvectors-lambda-matrix

C : sigma**2*matrix([...

lambda : eigenvalues(C);

v:eigenvectors(C);

Calculate

##### eigenvalues-hessian

eigenvalues(hessian((...

Calculate

##### and-or

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

b2,a0 = false, a1 = f...

b2,a0 = true, a1 = fa...

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