Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*start*)
- Clear[g1, g2, nn]
- nn = 32;
- a = Array[
- Function[n,
- 1/Plus @@ Map[#*MoebiusMu[#]/EulerPhi[#] &, Divisors[n]]], nn];
- g1 = Graphics[
- ArrayPlot[
- Table[Table[a[[GCD[nn - n + 1, k]]], {k, 1, nn}], {n, 1, nn}],
- ColorFunction -> "TemperatureMap", Frame -> False]];
- g2 = Graphics[
- Table[Table[
- Rotate[Text[Style[a[[GCD[n, k]]], Black], {n - 1/2, k - 1/2}],
- Pi/2], {k, 1, nn}], {n, 1, nn}]];
- g3 = Rotate[Show[g1, g2, ImageSize -> Large], -Pi/2];
- g3
- (*end*)
- (* szabolcs code from chat room at Mathematica stackexchange \
- 14.1.2018 *)
- Clear[a, matrix, nn]
- nn = 32;
- a = Array[
- Function[n,
- 1/Plus @@ Map[#*MoebiusMu[#]/EulerPhi[#] &, Divisors[n]]], nn];
- matrix = Reverse[Table[a[[GCD[n, k]]], {k, 1, nn}, {n, 1, nn}], 2];
- MatrixPlot[Transpose[matrix], DataReversed -> True,
- ColorFunction -> "GrayYellowTones", Frame -> False,
- PlotRangePadding -> None,
- Epilog -> MapIndexed[Text[#1, #2 - 1/2] &, matrix, {2}]]
- (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement