Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Magic-constant/Mathematica/magic-constant.math
Normal file
11
Task/Magic-constant/Mathematica/magic-constant.math
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
ClearAll[i, n, MagicSumHelper, MagicSum, InverseMagicSum]
|
||||
MagicSumHelper[n_] = Sum[i, {i, n^2}]/n;
|
||||
MagicSum[n_] := MagicSumHelper[n + 2]
|
||||
InverseMagicSum[lim_] := Ceiling[-(1/(3^(1/3) (9 lim + Sqrt[3] Sqrt[1 + 27 lim^2])^(1/3))) + (9 lim + Sqrt[3] Sqrt[1 + 27 lim^2])^(1/3)/3^(2/3)]
|
||||
|
||||
MagicSum /@ Range[20]
|
||||
MagicSum[1000]
|
||||
|
||||
exps = Range[1, 50];
|
||||
nums = 10^exps;
|
||||
Transpose[{Superscript[10, #] & /@ exps, InverseMagicSum[nums]}] // Grid
|
||||
Loading…
Add table
Add a link
Reference in a new issue