UNPKG

@mojir/lits

Version:

Lits is a pure functional programming language implemented in TypeScript

11 lines (10 loc) 491 B
import type { SequenceDefinition } from '.'; /** * Checks if a number is a perfect power and returns the base and exponent if it is. * A perfect power is a number that can be expressed as an integer power of another integer. * * @param n - The number to check * @returns [base, exponent] if n is a perfect power, null otherwise */ export declare function perfectPower(n: number): [number, number] | null; export declare const perfectPowerSequence: SequenceDefinition<'perfect-power'>;