Mathematica 9 is now available
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: [mg96305] Re: [mg96279] Mathematicas simplifications
  • From: "David Park" <djmpark at comcast.net>
  • Date: Wed, 11 Feb 2009 05:20:46 -0500 (EST)
  • References: <8450642.1234263950695.JavaMail.root@m02>

Mathematica can't evaluate Divisors[n] until it know what n is. So your
f[n_] formulation is the correct method.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: Kilian Kilger [mailto:kilian at nihilnovi.de] 

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.




  • Prev by Date: Re: testing if a point is inside a polygon
  • Next by Date: Re: Log[x]//TraditionalForm
  • Previous by thread: Re: Mathematicas simplifications
  • Next by thread: Re: Mathematicas simplifications