Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*start*)
- (*Mathematica 8.0.1*)
- Clear[nn, constant, s, a, d, M, T, n, k, m, sequenceToBeBounded,
- linearProgrammingSolution];
- nn = 50;
- constant = 1;
- s = 1;
- a[n_] := If[n < 1, 0, Sum[d MoebiusMu@d, {d, Divisors[n]}]]
- Monitor[TableForm[
- M = Table[
- Table[Sum[If[m >= k, a[GCD[m, k]], 0], {m, 1, n}], {k, 1,
- nn}], {n, 1, nn}]];, n]
- Monitor[sequenceToBeBounded =
- Table[Sum[M[[n, k]]/k^s, {k, 2, n}], {n, 1,
- nn}](*<--sequence to be bounded*), n]
- Table[Sum[
- Sum[If[Mod[m, k] == 0, MoebiusMu[m/k]*HarmonicNumber[k], 0], {k, 1,
- m}] - 1, {m, 1, n}], {n, 1, nn}]
- %% - %
- "1"
- Monitor[TableForm[
- PartialSumsOfMöbiusInverseOfHarmonicNumberLinearProgrammingSolution \
- = Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[k == 1, {-1, 1}, {M[[n, k]], M[[n, k]]}], {k, 1,
- n}]], {n, 1, nn}]], n]
- Monitor[lowerBound1 =
- Table[Sum[
- PartialSumsOfMöbiusInverseOfHarmonicNumberLinearProgrammingSoluti\
- on[[n, k]]/k^s, {k, 2, n}], {n, 1, nn}];, n]
- Show[ListPlot[constant*lowerBound1, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListLinePlot[constant*lowerBound1, PlotStyle -> {Thick}],
- ListLinePlot[sequenceToBeBounded, PlotStyle -> {Red, Thick}],
- ImageSize -> Large]
- "2"
- constant = 2;
- Monitor[TableForm[
- AbsoluteValueNumberTheoreticLinearProgrammingSolution =
- Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[k == 1, {-1, 1}, {-Abs[M[[n, k]]], 0 (k - 1)}], {k, 1,
- n}]], {n, 1, nn}]], n]
- Monitor[lowerBound2 =
- Table[Sum[
- AbsoluteValueNumberTheoreticLinearProgrammingSolution[[n, k]]/
- k^s, {k, 2, n}], {n, 1, nn}];, n]
- "3"
- constant = 2;
- Monitor[TableForm[
- OrdinaryLinearProgrammingSolution =
- Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[
- k == 1, {-1, 1}, {-(k - 1) + 0*Abs[M[[n, k]]],
- 0 (k - 1)}], {k, 1, n}]], {n, 1, nn}]];, n]
- Monitor[lowerBound3 =
- Table[Sum[
- OrdinaryLinearProgrammingSolution[[n, k]]/k^s, {k, 2, n}], {n, 1,
- nn}];, n]
- Show[ListLinePlot[constant*lowerBound3, PlotStyle -> {Thick}],
- ListPlot[constant*lowerBound3, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListPlot[lowerBound1, PlotStyle -> {Thick, Red},
- PlotMarkers -> Automatic],
- ListLinePlot[lowerBound1, PlotStyle -> {Thick, Red}],
- ListPlot[constant*lowerBound2, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListLinePlot[constant*lowerBound2, PlotStyle -> {Thick},
- PlotMarkers -> Automatic], ImageSize -> Large]
- (*end*)
- (*****************************************************)
- (*****************************************************)
- (*****************************************************)
- (*start*)(*Mathematica 8.0.1*)
- Clear[nn, constant, s, a, d, M, T, n, k, m, sequenceToBeBounded,
- linearProgrammingSolution];
- nn = 50;
- constant = 1;
- s = 1;
- a[n_] := If[n < 1, 0, Sum[d MoebiusMu@d, {d, Divisors[n]}]]
- Monitor[TableForm[
- M = Table[
- Table[Sum[If[m >= k, a[GCD[m, k]], 0], {m, 1, n}], {k, 1,
- nn}], {n, 1, nn}]];, n]
- Monitor[sequenceToBeBounded =
- Table[Sum[M[[n, k]]/k^s, {k, 2, n}], {n, 1,
- nn}];(*<--sequence to be bounded*), n]
- Monitor[sequenceToBeBounded2 =
- Table[Sum[(M[[n, k]] - 1)/k^s, {k, 2, n}], {n, 1,
- nn}];(*<--sequence to be bounded*), n]
- Table[Sum[
- Sum[If[Mod[m, k] == 0, MoebiusMu[m/k]*HarmonicNumber[k], 0], {k, 1,
- m}] - 1, {m, 1, n}], {n, 1, nn}];
- (*%%-%;*)
- "1"
- Monitor[TableForm[
- PartialSumsOfMöbiusInverseOfHarmonicNumberLinearProgrammingSolution\
- = Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[k == 1, {-1, 1}, {M[[n, k]] - 1, M[[n, k]]}], {k, 1,
- n}]], {n, 1, nn}]];, n]
- Monitor[lowerBound1 =
- Table[Sum[
- PartialSumsOfMöbiusInverseOfHarmonicNumberLinearProgrammingSoluti\
- on[[n, k]]/k^s, {k, 2, n}], {n, 1, nn}];, n]
- Show[ListPlot[constant*lowerBound1, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListLinePlot[constant*lowerBound1, PlotStyle -> {Thick}],
- ListLinePlot[sequenceToBeBounded, PlotStyle -> {Red, Thick}],
- ImageSize -> Large]
- "2"
- constant = 1;
- Monitor[TableForm[
- AbsoluteValueNumberTheoreticLinearProgrammingSolution =
- Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[k == 1, {-1, 1}, {-Abs[M[[n, k]]] - 1, 0 (k - 1)}], {k,
- 1, n}]], {n, 1, nn}]];, n]
- Monitor[lowerBound2 =
- Table[Sum[
- AbsoluteValueNumberTheoreticLinearProgrammingSolution[[n, k]]/
- k^s, {k, 2, n}], {n, 1, nn}];, n]
- "here here here"
- Show[ListLinePlot[lowerBound2, PlotStyle -> Blue],
- ListLinePlot[sequenceToBeBounded2, PlotStyle -> Red]]
- "3"
- constant = 1;
- Monitor[TableForm[
- OrdinaryLinearProgrammingSolution =
- Table[LinearProgramming[
- Table[1/k^s, {k, 1, n}], {Table[
- If[k == 1, n, 1], {k, 1, n}]}, {{1, 0}},
- Table[If[
- k == 1, {-1, 1}, {-k - 1 + 0*Abs[M[[n, k]]], 0 (k - 1)}], {k,
- 1, n}]], {n, 1, nn}]];, n]
- Monitor[lowerBound3 =
- Table[Sum[
- OrdinaryLinearProgrammingSolution[[n, k]]/k^(s), {k, 2, n}], {n,
- 1, nn}];, n]
- Monitor[lowerBound4 =
- Table[Sum[
- Sign[OrdinaryLinearProgrammingSolution[[n, k]]], {k, 2, n}], {n,
- 1, nn}];, n]
- Count[Table[Floor[(Sqrt[1 + 8*(n + 1)] - 3)/2], {n, 1, nn}] +
- lowerBound4, 0]
- Show[ListLinePlot[constant*lowerBound3, PlotStyle -> {Thick}],
- ListPlot[constant*lowerBound3, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListPlot[lowerBound1, PlotStyle -> {Thick, Red},
- PlotMarkers -> Automatic],
- ListLinePlot[lowerBound1, PlotStyle -> {Thick, Red}],
- ListPlot[constant*lowerBound2, PlotStyle -> {Thick},
- PlotMarkers -> Automatic],
- ListLinePlot[constant*lowerBound2, PlotStyle -> {Thick},
- PlotMarkers -> Automatic], ImageSize -> Large]
- (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement