> < ^ Date: Tue, 11 Nov 2003 16:45:59 +0100 (CET)
^ From: Sergei Haller <Sergei.Haller@math.uni-giessen.de >
> < ^ Subject: Re: Power of a specific Prime!
On Tue, 11 Nov 2003, saad bedaiwi (sb) wrote:

sb> Dear GAP-Forum,
sb>
sb> Let L be a list of integers, is there a way to test whether each member of L
sb> is a power of a
sb> specific prime, it seems that the command "IsPrimePowerInt" do
sb> that but for an arbitrary prime

Dear GAP forum,
Dear Saad,

this is probably not the most efficient way, but at least it is short:

gap> list := [3,9,81,2];
[ 3, 9, 81, 2 ]
gap> Length(Collected(List( list, PrimePowersInt ){[1..Length(list)]}[1])) = 1 ;
false
gap> list := [3,9,81];
[ 3, 9, 81 ]
gap> Length(Collected(List( list, PrimePowersInt ){[1..Length(list)]}[1])) = 1 ;
true
gap>

best regards,

        Sergei
-- 
--------------------------------------------------------------------  -?)
         eMail:       Sergei.Haller@math.uni-giessen.de               /\\
-------------------------------------------------------------------- _\_V
Be careful of reading health books, you might die of a misprint.
                -- Mark Twain

> < [top]