You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike with ordinary limits with integers or symbols, certain sums with non-trivial limits that evaluate to an integer, such as those involving base-2 logarithms, can fail to be evaluated. An example follows:
In [32]: # Limits involving logs
...: mm1=(S(1)/5)-Sum((S(1)/2)*(S(1)/(8*2**k-4)),(k,0,log(n,2)-1))
...: # -- Powers of 2
...: pprint([mm1.subs(n,2**i).doit() for i in range(2,5)])
...: # -- n() produces wrong results here; see also #20937
...: pprint([mm1.subs(n,2**i).n() for i in range(2,5)])
...: # Ordinary integer limits
...: mm1=(S(1)/5)-Sum((S(1)/2)*(S(1)/(8*2**k-4)),(k,0,n))
...: pprint([mm1.subs(n,i).doit() for i in range(4,10)])
...: pprint([mm1.subs(n,i).n() for i in range(4,10)])
...:
⎡ log(4) log(8) log(16) ⎤
⎢ -1 + ────── -1 + ────── -1 + ─────── ⎥
⎢ log(2) log(2) log(2) ⎥
⎢ ____ ____ ____ ⎥
⎢ ╲ ╲ ╲ ⎥
⎢ ╲ 1 ╲ 1 ╲ 1 ⎥
⎢1 ╲ ──────────── 1 ╲ ──────────── 1 ╲ ────────────⎥
⎢─ - ╱ ⎛ k ⎞, ─ - ╱ ⎛ k ⎞, ─ - ╱ ⎛ k ⎞⎥
⎢5 ╱ 2⋅⎝8⋅2 - 4⎠ 5 ╱ 2⋅⎝8⋅2 - 4⎠ 5 ╱ 2⋅⎝8⋅2 - 4⎠⎥
⎢ ╱ ╱ ╱ ⎥
⎢ ‾‾‾‾ ‾‾‾‾ ‾‾‾‾ ⎥
⎣ k = 0 k = 0 k = 0 ⎦
[-0.00083689405191147, -0.00083689405191147, -0.00083689405191147]
⎡ 27 11 1411 -5869 -1459235 -4840333 ⎤
⎢────, ────, ───────, ────────, ──────────, ──────────⎥
⎣8680 9765 9921240 16866108 2462451768 6771742362⎦
[0.00311059907834101, 0.00112647209421403, 0.000142220125710093, -0.00034797595272128, -0.000592594348024607, -0.00071
4783986343277]
The text was updated successfully, but these errors were encountered:
Unlike with ordinary limits with integers or symbols, certain sums with non-trivial limits that evaluate to an integer, such as those involving base-2 logarithms, can fail to be evaluated. An example follows:
The text was updated successfully, but these errors were encountered: