and 1 contributors

# NAME

Math::NumSeq::PowerFlip -- prime exponent flip

# SYNOPSIS

`````` use Math::NumSeq::PowerFlip;
my \$seq = Math::NumSeq::PowerFlip->new;
my (\$i, \$value) = \$seq->next;``````

# DESCRIPTION

This sequence is i with primes and exponents flipped in the prime factorization.

``````    i     = p^e * q^f * ...
becomes
value = e^p * f^q * ...``````

which gives

``````    # starting i=1
1, 1, 1, 4, 1, 1, 1, 9, 8, 1, 1, 4, 1, 1, 1, 16, 1, 8, 1, 4, ...``````

For example i=1000=2^3*5^3 becomes value=3^2*3^5=3^7=2187.

Any i=prime has value=1 since i=p^1 becomes value=1^p=1. Value=1 occurs precisely when i=p*q*r*etc with no repeated prime factor, ie. when i is square-free.

The possible values which occur in the sequence are related to square factors. Since value=e^p has prime p>=2, every e,f,g etc powered up in the value is a square or higher power. So sequence values are a product of squares and higher, the same as

# FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

`\$seq = Math::NumSeq::PowerFlip->new ()`

Create and return a new sequence object.

## Random Access

`\$value = \$seq->ith(\$i)`

Return `\$i` with the prime powers and exponents flipped.

`\$bool = \$seq->pred(\$value)`

Return true if `\$value` occurs in the sequence. As noted above this means an integer `\$value` with at least one squared prime factor.