Perfect Power

Author

Eric W. Weisstein
May 6, 2013

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/PerfectPower.nb.

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

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

Enumeration

Select[Range[100],PerfectPowerQ]

l=Select[Range[10^5],PerfectPowerQ];//Timing

Table[Count[l,_?(#<=10^n&)],{n,5}]

Without Duplication

With[{n=100},Select[Union[Flatten[Outer[Power,Range[2,n],Range[2,n]]]],#<=n^2&]
]//Timing

Exact

$Version

$TopDirectory

Sum[MoebiusMu[k](1-Zeta[k]),{k,2,∞}]//Timing

NSum

Plus@@(1./Union[Flatten[Table[a^b,{b,2,500},{a,2,500}]]])//Timing

c=Block[{$MaxExtraPrecision=2000},
NSum[MoebiusMu[k](1-Zeta[k]),{k,2,∞},
WorkingPrecision->200,
VerifyConvergence->False]
]

Wrong

c=Block[{$MaxExtraPrecision=2000},
NSum[MoebiusMu[k](1-Zeta[k]),{k,2,∞},
WorkingPrecision->300,
VerifyConvergence->False]
]

Wrong

Accurate Value

l3=Table[MoebiusMu[k](1-Zeta[k]),{k,2,10^3}];//Timing

Total[Block[{$MaxExtraPrecision=10^3},N[#,120]&/@l3]]

RealDigits[Total[Block[{$MaxExtraPrecision=10^3},N[#,120]&/@Table[MoebiusMu[k](1-Zeta[k]),{k,2,10^3}]]]][[1]]

0.874464368...

.87446436534641455348207429122389275473401927072297684149493850319151724209360992232463034100455248742

l4=Table[MoebiusMu[k](1-Zeta[k]),{k,2,10^4}];//Timing

Total[Block[{$MaxExtraPrecision=10^4},N[#,120]&/@l4]]

RealDigits[0.8744643684049448666943513205973731659353384319242145776257882535093700641297236765993322617857580162877063419362559053010386328554579348945627758219960787`119.98206894039858]

With Duplication

a=Take[Sort[Flatten[Table[a^b,{b,2,500},{a,2,500}]]],500]

a==Take[Sort[Flatten[Table[a^b,{b,2,600},{a,2,600}]]],500]

Perfect Powers in More than One Way

First/@Select[Split[a],Length[#]>1&]

Sum

Sum[1/a^b,{b,2,∞},{a,2,∞}]

Sum[1/a^b,{a,2,∞},{b,2,∞}]