Kevin Ryde > Math-NumSeq-65 > Math::NumSeq::PowerFlip



Annotate this POD



Open  0
View/Report Bugs
Module Version: 65   Source   Latest Release: Math-NumSeq-69


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


 use Math::NumSeq::PowerFlip;
 my $seq = Math::NumSeq::PowerFlip->new;


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

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

which gives

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

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.




$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.


Math::NumSeq, Math::NumSeq::PrimeFactorCount



Copyright 2012, 2013 Kevin Ryde




syntax highlighting: