Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Special Prime Product

  • To: mathgroup at
  • Subject: [mg53381] Re: Special Prime Product
  • From: Bill Rowe <readnewsciv at>
  • Date: Sat, 8 Jan 2005 23:02:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 1/8/05 at 2:39 AM, gilmar.rodriguez at (Gilmar)

>I'm attempting to form a product:

>|  | (p-2)
>|  | -------
>|  | (p-1)
>p Prime, p|n

>I call the program:

><< NumberTheory`NumberTheoryFunctions`
>and use the function "PrimeFactorList" in it,  to build
>the following module:


>specpriprod is an abbreviation for "Special Prime Product".

>When I evaluate:

>I only get specprimprod[n] = 0 for n even between 4 and 100. 

But for any even number 2 will be a prime factor. That means p-2 evaluates to zero and the product must be zero. So, there is no apparent problem with the results.

I do note your code could be improved and will not do what you describe as written. You are using primeFactorList instead of PrimeFactorList and you have p-2 in the demonimator. Also, you do not need the local variable v.

A better approach would be

Module[{p = PrimeFactorList[n]},

And even easier to read and probably more efficient is

Module[{p = PrimeFactorList[n]},
To reply via email subtract one hundred and four

  • Prev by Date: Re: Function Show[]
  • Next by Date: Re: Plotting dates on the x-axis
  • Previous by thread: Re: Special Prime Product
  • Next by thread: Re: Special Prime Product