Previous Page Next Page Contents

numlib::ispower -- test for perfect powers

Introduction

numlib::ispower(n) tests whether n is of the form ak for some positive integers a, k with a, k ≥2.

numlib::ispower returns FALSE if n is not a perfect power.

Call(s)

numlib::ispower(n)

Parameters

n - an integer

Returns

numlib::ispower returns a sequence of two positive integers ≥2, or FALSE if n is not a perfect power.

Related Functions

_power, ifactor, isqrt

Details

Example 1

This number is a perfect power:

>> numlib::ispower(1977326743)
                                   7, 11

This number is not a perfect power:

>> numlib::ispower(1977326744)
                                   FALSE

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000