Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Mathematica start*)
- Print["Try changing the power s of matrix A here:"]
- nn = 12;
- s = 5;
- 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, s].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 ", s, "-th power of the matrix A"]
- (x /. Solve[Det[M + MM] == 0, x])
- Print["The modified Eric Naslund formula for the arithmetic sequence"]
- Table[MoebiusMu[n]^2*n^s/(n - EulerPhi[n]), {n, 2, nn}]
- (*Mathematica end*)
- (*Mathematica start*)
- 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[M = MatrixExp[MatrixExp[MatrixExp[MatrixExp[A]]]].B];
- Clear[t, n, k, 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]];
- T = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
- MatrixForm[T];
- Print["The roots of the matrix exponential of the matrix"]
- (x /. Solve[Det[M + T] == 0, x])
- Print["The modified Eric Naslund formula for the arithmetic sequence"]
- Table[MoebiusMu[n]^2*Exp[Exp[Exp[Exp[n]]]]/(n - EulerPhi[n]), {n, 2,
- nn}]
- (*Mathematica end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement