Why is Mathematica v12 spinning on this series:
FullSimplify[Sum[16^x/((16^x) + 4), {x, 1/2025, 2024/2025, 1/2025}]]
The answer works out to 1012. Is there another way to evaluate it? Thanks
One problem is the combinatorial explosion of subexpressions to try to simplify in the straight sum. I love it when symmetry works:
Table[16^x/((16^x) + 4), {x, 1/2025, 2024/2025, 1/2025}] //
# + Reverse[#] & //
Simplify //
Total //
#/2 &
(* 1012 *)
Generalization:
Block[{n = 2024},
Table[r^j/(r^((n + 1)/2) + r^j), {j, 1, n}]
] //
# + Reverse[#] & //
Simplify //
Total //
#/2 &
(* 1012 *)
Another fast symbolic solution:
F = Simplify[Sum[16^j/(4 + 16^j), {j, a, b, c}],
Assumptions -> {a > 0, b > 0, c > 0}];
S = Simplify[F /. a -> 1/2025 /. b -> 2024/2025 /. c -> 1/2025]
(* -((2025 (QPolyGamma[0, (-2025 I \[Pi] - 2023 Log[4])/Log[16], 2^(
4/2025)] - QPolyGamma[0, (-2025 I \[Pi] - 2023 Log[4] + 2024 Log[16])/
Log[16], 2^(4/2025)]))/Log[16])*)
S // FunctionExpand (*Can't find simpler form*)
% // N // Chop
(* 1012. *)
Or:
Rationalize[Round[Sum[16^j/(4 + 16^j), {j, 1/2025, 2024/2025, c}]
/. c -> 1/2025 // N // Chop, 0.1], 0] // AbsoluteTiming
(*{0.0649698, 1012}*)
QPolyGamma[]
result similar to yours. I didn't like the somewhat small (or even not-so-small) imaginary round-off error after N[]
, which I didn't want to have to explain. It made it seem inferior to @Nasser's comment, although it's faster. So I moved on. Symbolic summation is still a good strategy to try. I was surprised that FullSimplify
on it could not yield the integer 1012.
$\endgroup$
Commented
2 days ago
FullSimplify
or FunctionExpand
dosen't work here ,because in this case not exist function Identities for QPolyGamma[]
to get simpler form,unless I'm wrong :P
$\endgroup$
Commented
2 days ago
ClearAll[sum]; (sum[n_, wprec_ : 32] := Round[ NIntegrate[#, {K[1], -1/2, n - 1/2}, WorkingPrecision -> wprec, Method -> {"GaussKronrodRule", "Points" -> 5}], 10^(-wprec/2)]) &@ D[Sum[(16^(1/2024))^j/(4 + (16^(1/2024))^j), {j, K[1]}], K[1]]; sum[2024]
$\endgroup$
Commented
yesterday
F1 = Simplify[Sum[16^j/(4 + 16^j), {j, a, b, c}] /. {a -> 1/2025, b -> 2024/2025, c -> 1/2025}]; F2 = Simplify[Sum[16^j/(4 + 16^j), {j, b, a, -c}] /. {a -> 1/2025, b -> 2024/2025, c -> 1/2025}]; (F1 + F2)/2 // FullSimplify
$\endgroup$
Commented
yesterday
Sum
command.Sum[16^x/((16^x)+4),{x,1/2025,2024/2025,1/2025}]//N
gives1012.
$\endgroup$Sum
it is huge. LeafCount is34,915
and result of sum is complicated with numbers raised to different powers everywhere, and FullSimplification is known that it can slow things, because it tries many things. Even though everything is symbolic, it is still complicated result. Numerically it is always much much faster. i.sstatic.net/V0ufFrHt.png $\endgroup$N
you can useRationalize
to get the exact result. $\endgroup$