       Re: Easiest Mathematica algorhitm needed

• To: mathgroup at smc.vnet.net
• Subject: [mg92810] Re: [mg92793] Easiest Mathematica algorhitm needed
• From: "Yuri Kandrashkin" <spinalgebra at gmail.com>
• Date: Tue, 14 Oct 2008 04:55:17 -0400 (EDT)
• References: <gcq09i\$c30\$1@smc.vnet.net> <200810120835.EAA08892@smc.vnet.net>

```Hi,

You can use the function ReplaceAll:
m=Table[Sqrt[n!],{n,1,10}]
m /. {{a_. Power[b_,1/2]:>b},{Power[_,1/2]->1}}

> Dear Mathematica Gurus,
> Who know which Matrhematica function uses to separate square free part
> of number.
> e.g.
> In: Table[Sqrt[n!], {n, 1, 10}]
> Out: {1, Sqrt, Sqrt, 2 Sqrt, 2 Sqrt, 12 Sqrt, 12
> Sqrt,
>  24 Sqrt, 72 Sqrt, 720 Sqrt}
> What to do to take squre-free parts:
> {1, 2, 6, 6, 30, 5, 35, 70, 70, 7}
> or square parts
> {1, 1, 1, 2, 2, 12, 12, 24, 72, 720}
> Best wishes
> Artur
>
>

--
Sincerely,
Yuri Kandrashkin, PhD
http://spinalgebra.com - Mathematica based applications:
- Magnetic Resonance with SpinAlgebra
- Work with systems of Units
- Interactive tools: ViewPoint selector, Options explorer, etc

```

• Prev by Date: Re: Conditional SetDelayed with Replacement
• Next by Date: Re: Easiest Mathematica algorhitm needed
• Previous by thread: RE: Re: Executing external notebook
• Next by thread: Re: Easiest Mathematica algorhitm needed