Madelung Constants

Author

Eric W. Weisstein
October 26, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/MadelungConstants.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/MadelungConstants.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Sums

(∑_(i=1)^∞)(∑_(j=1)^∞)((((-1))^(i+j))/((i^2)+(j^2)))==(1/12) π (π-3ln(2))

V7

TimeConstrained[Sum[(-1)^(i+j)/(i^2+j^2),{i,∞},{j,∞}],60]//Timing

TimeConstrained[Sum[(-1)^(i+j)/(i^2+j^2),{j,∞},{i,∞}],60]//Timing

V9

{DateString[],$Version,$TopDirectory}//Column

Sum[(-1)^(i+j)/(i^2+j^2),{i,∞},{j,∞}]//FullSimplify//Timing

Sum[(-1)^(i+j)/(i^2+j^2),{j,∞},{i,∞}]//FullSimplify//Timing

(Subscript[b, 2])(2)==(∑_(i=-∞)^∞)(Underoverscript[∑', (j=-∞), ∞])((((-1))^(i+j))/((i^2)+(j^2)))==-(4^(-s)) ((4^s)-2) (Zeta[2 s])

-N[Pi Log[2],20]

bug(23736), bug(92123)

Numerically

NSum[Piecewise[{{0,i==j==0},{((((-1))^(i+j))/((i^2)+(j^2))),True}}],{i,-∞,∞},{j,-∞,∞}]//Chop

N[With[{n=50},
Plus@@(((((-1))^(#1+#2))/(((#1)^2)+((#2)^2)))&@@@DeleteCases[
Flatten[Table[{i,j},{i,-n,n},{j,-n,n}],1],{0,0}])
],10]

b21=FullSimplify[-4DirichletEta[x]DirichletBeta[x]]

Limit[b21,x->1]

FunctionExpand[b21]

V5.2

Sum[((((-1))^i)/(i^2)),{i,∞}]

Sum[((((-1))^(i+j))/((i^2)+(j^2))),{i,∞},{j,∞}]//Timing

V6

Sum[((((-1))^i)/(i^2)),{i,∞}]

Sum[((((-1))^(i+j))/((i^2)+(j^2))),{i,∞},{j,∞}]

4Simplify[Sum[((((-1))^i)/(i^2)),{i,∞}]+Sum[((((-1))^(i+j))/((i^2)+(j^2))),{i,∞},{j,∞}]]

N[%]

V7

TimeConstrained[Sum[Piecewise[{{0,i==j==0},{((((-1))^(i+j))/((i^2)+(j^2))),True}}],{i,-∞,∞},{j,-∞,∞}],60]//Timing

TimeConstrained[Sum[Piecewise[{{0,i==j==0},{((((-1))^(i+j))/((i^2)+(j^2))),True}}],{j,-∞,∞},{i,-∞,∞}],60]//Timing

One Piece at Time

Sum[(-1)^(i+j)/(i^2+j^2),{i,Infinity}]

TrigToExp[%]

Sum[-((((-1))^j)/(2 (j^2))),{j,∞}]

Sum[(((((-1))^j) π Csch[j π])/(2 j)),{j,∞}]

FullSimplify[Sum[(-1)^j/(j^(2s)),{j,Infinity}]]

V9

{DateString[],$Version,$TopDirectory}//Column

Sum[Piecewise[{{0,i==j==0},{((((-1))^(i+j))/((i^2)+(j^2))),True}}],{i,-∞,∞},{j,-∞,∞}]//Timing

...crashes?...

Sum[Piecewise[{{0,i==j==0},{((((-1))^(i+j))/((i^2)+(j^2))),True}}],{j,-∞,∞},{i,-∞,∞}]//Timing

(Subscript[b, 3])(1)==(∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k+1))/(Sqrt[(i^2)+(j^2)+(k^2)]))

Numerical

Madelung=-1.74756459463318219063621203554439740348516143662474175815282535076504062353276117989075836269460788993;

N[With[{n=30},
Plus@@(((((-1))^(#1+#2+#3))/(Sqrt[((#1)^2)+((#2)^2)+((#3)^2)]))&@@@DeleteCases[
Flatten[Table[{i,j,k},{i,-n,n},{j,-n,n},{k,-n,n}],2],{0,0,0}])
],10]//Timing

N[With[{m=30},Sum[Piecewise[{{0,i==j==k==0}},(-1)^(i+j+k)/Sqrt[i^2+j^2+k^2]],{i,-m,m},{j,-m,m},{k,-m,m}]]]//Timing

V5.0

NSum[((((-1))^(i+j+k+1))/(Sqrt[(i^2)+(j^2)+(k^2)])),{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}]//Timing

...crash...

V5.1

NSum[((((-1))^(i+j+k+1))/(Sqrt[(i^2)+(j^2)+(k^2)])),{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}]//Timing

12Pi Sum[Sech[Pi/2 Sqrt[m^2+n^2]]^2,{m,1,∞,2},{n,1,∞,2}]

V7

TimeConstrained[Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/(Sqrt[(i^2)+(j^2)+(k^2)])),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

V9

{DateString[],$Version,$TopDirectory}//Column

Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/(Sqrt[(i^2)+(j^2)+(k^2)])),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}]//Timing

Benson's Formula

TimeConstrained[Sum[Sech[Pi/2 Sqrt[m^2+n^2]]^2,{m,1,∞,2},{n,1,∞,2}],60]//Timing

12Pi NSum[Sech[Pi/2 Sqrt[m^2+n^2]]^2,{m,1,∞,2},{n,1,∞,2}]//Timing

12Pi NSum[Sech[Pi/2 Sqrt[m^2+n^2]]^2,{m,1,∞,2},{n,1,∞,2},WorkingPrecision->20]//Timing

1.74756459463318219063621203554424535337`19.698970004335983+Madelung//Chop

Crandall (1999)

M==(((Sqrt[2]) Γ((1/8)) Γ((3/8)))/(π^(3/2)))-2 π+2 (∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k))/(((E^(4 π (Sqrt[(i^2)+(j^2)+(k^2)])))+1) (Sqrt[(i^2)+(j^2)+(k^2)])))

TimeConstrained[-2π+((Gamma[(1/8)]Gamma[(3/8)](Sqrt[2]))/(π^(3/2)))+2Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/((1+(E^(4 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

With[{m=20},-2π+((Gamma[(1/8)]Gamma[(3/8)](Sqrt[2]))/(π^(3/2)))+2Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/((1+(E^(4 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-m,m},{j,-m,m},{k,-m,m}]]//N[#,20]&

Tyagi 1

-((ln(2))/π)-(1/2)-(π/3)-2 (∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k))/(((E^(2 π (Sqrt[(i^2)+(j^2)+(k^2)])))-1) (Sqrt[(i^2)+(j^2)+(k^2)])))

TimeConstrained[-(1/2)-((Log[2])/π)-(π/3)-2Sum[Piecewise[{{0,i==j==k},{((((-1))^(i+j+k))/((-1+(E^(2 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

With[{m=20},-(1/2)-((Log[2])/π)-(π/3)-2Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/((-1+(E^(2 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-m,m},{j,-m,m},{k,-m,m}]]//N[#,20]&

Tyagi 2

(Sqrt[2])-π+2 (∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k))/(((E^(2 π (Sqrt[(i^2)+(j^2)+(k^2)])))-1) (Sqrt[(i^2)+(j^2)+(k^2)])))

TimeConstrained[(Sqrt[2])-π+2Sum[Piecewise[{{0,i==j==k},{((((-1))^(i+j+k))/((1+(E^(2 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

With[{m=20},(Sqrt[2])-π+2Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/((1+(E^(2 (Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-m,m},{j,-m,m},{k,-m,m}]]//N[#,20]&

Tyagi 3

-2 (∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k))/(((E^(4 π (Sqrt[(i^2)+(j^2)+(k^2)])))-1) (Sqrt[(i^2)+(j^2)+(k^2)])))-((ln(2))/(2 π))-((2 π)/3)-(1/4)+(1/(Sqrt[2]))

TimeConstrained[-(1/4)-((Log[2])/(2π))-((2π)/3)+(1/(Sqrt[2]))-2Sum[Piecewise[{{0,i==j==k},{((((-1))^(i+j+k))/((-1+(E^(4(Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

With[{m=20},-(1/4)-((Log[2])/(2π))-((2π)/3)+(1/(Sqrt[2]))-2Sum[Piecewise[{{0,i==j==k==0},{((((-1))^(i+j+k))/((-1+(E^(4(Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-m,m},{j,-m,m},{k,-m,m}]]//N[#,20]&

Tyagi Average

-2 (∑_(i=-∞)^∞)(∑_(j=-∞)^∞)(∑_(k=-∞)^∞)((((-1))^(i+j+k))/(((E^(8 π (Sqrt[(i^2)+(j^2)+(k^2)])))-1) (Sqrt[(i^2)+(j^2)+(k^2)])))-((ln(2))/(4 π))+((Γ((1/8)) Γ((3/8)))/((π^(3/2)) (Sqrt[2])))-((4 π)/3)-(1/8)+(1/(2 (Sqrt[2])))

TimeConstrained[-(1/8)-((Log[2])/(4π))-((4π)/3)+(1/(2(Sqrt[2])))+((Gamma[(1/8)]Gamma[(3/8)])/((π^(3/2))(Sqrt[2])))-2Sum[Piecewise[{{0,i==j==k},{((((-1))^(i+j+k))/((-1+(E^(8(Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-∞,∞},{j,-∞,∞},{k,-∞,∞}],60]//Timing

With[{m=35},-(1/8)-((Log[2])/(4π))-((4π)/3)+(1/(2(Sqrt[2])))+((Gamma[(1/8)]Gamma[(3/8)])/((π^(3/2))(Sqrt[2])))-2Sum[Piecewise[{{0,i==j==k},{((((-1))^(i+j+k))/((-1+(E^(8(Sqrt[(i^2)+(j^2)+(k^2)]) π))) (Sqrt[(i^2)+(j^2)+(k^2)]))),True}}],{i,-m,m},{j,-m,m},{k,-m,m}]]//N[#,20]&

N[-(1/8)-((Log[2])/(4π))-((4π)/3)+(1/(2(Sqrt[2])))+((Gamma[(1/8)]Gamma[(3/8)])/((π^(3/2))(Sqrt[2]))),20]

(Subscript[b, 4])(2)

-N[4Log[2],20]

Sum

(Subscript[h, 2])(2)

N[Pi Log[3]Sqrt[3],20]

(∑_(i=-∞)^∞)(Underoverscript[∑', (j=-∞), ∞])((((-1))^(i+j))/(Sqrt[(i^2)+(j^2)]))==-2 ((Sqrt[2])-1) (Zeta[(1/2)]) ((Zeta2[(1/2), (1/4)])-(Zeta2[(1/2), (3/4)]))

TimeConstrained[s=Sum[If[i==j==0,0,(-1)^(i+j)/Sqrt[i^2+j^2]],{i,-Infinity,Infinity},{j,-Infinity,Infinity}],300]//Timing

N[s,10]

(s=Sum[Piecewise[{{(-1)^(j+k)/Sqrt[j^2+k^2],j^2+k^2≠0}}],{k,-Infinity,Infinity},{j,-Infinity,Infinity}]//FullSimplify)//Timing

N[s,10]

TimeConstrained[(s=Sum[Piecewise[{{(-1)^(j+k)/Sqrt[j^2+k^2],j!=k!=0}}],{k,-Infinity,Infinity},{j,-Infinity,Infinity}]//FullSimplify),300]//Timing

With[{n=1000},Sum[Piecewise[{{(-1.)^(j+k)/Sqrt[j^2+k^2],j^2+k^2≠0}}],{k,-n,n},{j,-n,n}]]

-2 (-1+(Sqrt[2])) Zeta[(1/2)] (Zeta[(1/2),(1/4)]-Zeta[(1/2),(3/4)])//N

Identities

Tyagi Identity

TimeConstrained[Sum[((((-1))^(m+n+p))/((((k+(1/2)))^2)+4((m^2)+(n^2)+(p^2)))),{k,-∞,∞},{m,-∞,∞},{n,-∞,∞},{p,-∞,∞}],60]//Timing

NSum[((((-1))^(m+n+p))/((((k+(1/2)))^2)+4((m^2)+(n^2)+(p^2)))),{k,-∞,∞},{m,-∞,∞},{n,-∞,∞},{p,-∞,∞}]//Timing

With[{c=20},Sum[((((-1))^(m+n+p))/((((k+(1/2)))^2)+4((m^2)+(n^2)+(p^2)))),{k,-c,c},{m,-c,c},{n,-c,c},{p,-c,c}]]//N[#,20]&

With[{c=35},Sum[((((-1))^(m+n+p))/((((k+(1/2)))^2)+4((m^2)+(n^2)+(p^2)))),{k,-c,c},{m,-c,c},{n,-c,c},{p,-c,c}]]//N[#,20]&

((Gamma[(1/8)]Gamma[(3/8)])/(Sqrt[2π]))//N