MathGroup Archive 2000

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

Search the Archive

Re: ExponentFunction


Hi Hans,

Bob Hanlon sent me this lovely solution to my PS regarding printing factors:

Dot @@ Flatten[Table[#[[1]], {#[[2]]}] & /@ FactorInteger[x]]

By combining this with your Infix idea I came up with:

In:= facts[n_, c_] := Infix[Flatten[Table[#[[1]], {#[[2]]}] & /@
FactorInteger[n]], c]
In:= facts[10! + 100, "x"]
Out:= 2 x 2 x 5 x 5 x 11 x 3299

I had never thought of using Infix, in fact I'd forgotten all about it.
Thanks to your tip I'm reading up on the formatting functions.

Cheers,
Greg Keogh





  • Prev by Date: final timestep using StoppingTest
  • Next by Date: controlling evaluation
  • Previous by thread: Re: ExponentFunction
  • Next by thread: two variable recurrence relations