Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Mathematica start*)
- Print["Try changing the power of matrix A here:"]
- power = 2
- nn = 12;
- A = Table[Table[If[Mod[n, k] == 0, k, 0], {k, 1, nn}], {n, 1, nn}];
- B = Table[
- Table[If[Mod[k, n] == 0, MoebiusMu[n], 0], {k, 1, nn}], {n, 1, nn}];
- MatrixForm[MM = MatrixPower[A, power].B];
- Clear[t, n, k, M, x];
- t[n_, 1] = 0;
- t[1, k_] = 0;
- t[n_, k_] :=
- t[n, k] =
- If[n < k,
- If[And[n > 1, k > 1], x - Sum[t[k - i, n], {i, 1, n - 1}], 0],
- If[And[n > 1, k > 1], x - Sum[t[n - i, k], {i, 1, k - 1}], 0]];
- M = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
- MatrixForm[M];
- Print["The roots of the ", power, "-d powers of the matrix"]
- N[(x /. Solve[Det[M + MM] == 0, x] )]
- Print["Eric Naslunds formula for the arithmetic sequence"]
- N[Table[MoebiusMu[n]^2*n^(power)/(n - EulerPhi[n]), {n, 2, nn}]]
- (*Mathematica end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement