Charles Greathouse on Wed, 20 Jul 2016 16:01:59 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: floor(121^(1/2))=10(??)

Zak, I'm not certain I understood what you wanted, but perhaps this will do:

a(n)=my(r=(sqrtint(n)+1)^2,t); for(e=3,logint(n,2)+1, t=(sqrtnint(n,e)+1)^e; if(t<r, r-t)); r

Charles Greathouse
Case Western Reserve University

On Tue, Jul 19, 2016 at 10:20 AM, William F Hammond <> wrote:
Zak Seidov <> writes:

> OK, I understand, that sometimes floor is wrong.
> But plz  help to write a code for computing perfect power number
> . . .

Perhaps you want something like:


(There's probably a more efficient way to enter the small correction.)

                                    -- Bill