Re: Easiest Mathematica algorhitm needed
- To: mathgroup at smc.vnet.net
- Subject: [mg92852] Re: Easiest Mathematica algorhitm needed
- From: pratip <pratip.official at gmail.com>
- Date: Wed, 15 Oct 2008 05:37:20 -0400 (EDT)
Hi, Though it might be highly possible that I misunderstood your question but given your specified input the expected output you are looking for can be very easily generated as follows. First for the square-free parts, Table[Sqrt[n!], {n, 1, 10}] /. a_ Sqrt[b_] -> a /. Sqrt[b_] -> 1 The above command will give you the square-free parts. {1, 1, 1, 2, 2, 12, 12, 24, 72, 720} Now for the so called square part Table[Sqrt[n!], {n, 1, 10}] /. a_ Sqrt[b_] -> b /. Sqrt[b_] -> b The above command will give you {1, 2, 6, 6, 30, 5, 35, 70, 70, 7} Hope this helps. But if you are interested about "square free part of a positive integer" please go to http://mathworld.wolfram.com/SquarefreePart.html Hope this helps. Regards, Pratip