Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematicas simplifications

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96300] Re: [mg96279] Mathematicas simplifications
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Wed, 11 Feb 2009 05:19:50 -0500 (EST)
  • References: <200902101056.FAA10328@smc.vnet.net>
  • Reply-to: drmajorbob at longhorns.com

It's doing exactly what I'd expect if n has no value.

n =.;
Select[Divisors[n], SquareFreeQ]

Divisors[n]

which is not, BTW, wrong. Neither is it RIGHT, I admit, since it doesn't  
mean anything.

You could define and use f this way, if it helps:

Clear[f]
f[n_Integer] := Select[Divisors[n], SquareFreeQ]
f[n_] = HoldForm@Select[Divisors[n], SquareFreeQ];

f[4]

{1, 2}

f[n]

\!\(\*
TagBox[
RowBox[{"Select", "[",
RowBox[{
RowBox[{"Divisors", "[", "n", "]"}], ",", "SquareFreeQ"}], "]"}],
HoldForm]\)

f[n] /. n -> 4 // ReleaseHold

{1, 2}

Bobby

On Tue, 10 Feb 2009 04:56:39 -0600, Kilian Kilger <kilian at nihilnovi.de>  
wrote:

> Hello,
>
> if I type in Mathematica 7 for example
>
> Select[Divisors[n],SquareFreeQ]
>
> It gives me
>
> Divisors[n]
>
> as a response, which is wrong. If I type
>
> f[n_] := Select[Divisors[n],SquareFreeQ]
>
> and then
>
> f[4]
>
> it gives me
>
> {1,2}
>
> which is correct. If I type (afterwards)
>
> f[n]
>
> again the wrong answer "Divisors[n]" is shown. What am I doing wrong?  
> Same happens in many other circumstances.
>
> Thanks in advance,
> Kilian.
>



-- 
DrMajorBob at longhorns.com


  • Prev by Date: Re: Inappropriate kernel limits!
  • Next by Date: Re: very slow Save[]s on Mathematica V7??
  • Previous by thread: Mathematicas simplifications
  • Next by thread: Re: Mathematicas simplifications