I'm trying to explore how the zeros of a certain parameterized function change as its parameter changes.

dh[n_, k_, a_] := 
dh[n, k, a] = Sum[Binomial[k, j] dh[Floor[n/(m^(k - j))], j, m + 1], {m, a, n^(1/k)}, {j, 0, k - 1}]
dh[n_, 1, a_] := Floor[n] - a + 1
dh[n_, 0, a_] := 1
bn[ z_, a_] := bn[z, a] = Product[ (z - k), {k, 0, a - 1}]/a!
dd[n_, z_] := Sum[bn[z, a] dh[n, a, 2], {a, 0, Log[2, n]}]

The function I'm exploring here is dd[n_,z_].

n is the parameter I want to vary, and is a whole number $>= 1$. The zeros are all values of z such that dd[n,z] = 0. There should be $\log_2 n$ zeros for a given n.

Now, I already know that I can see the zeros for an isolated value of n as

zeros[n_] := List @@ NRoots[ dd[n, z] == 0, z][[All, 2]]

For example, if I try zeros[30], I get {-16.1801, -1.66598 - 0.772391 I, -1.66598 + 0.772391 I, -0.0879758}

I also know that I could visualize those zeros as

RootLocusPlot[1/dd[30, z], {k, 0, 1}]

But both of these techniques only address single values of n at a time. What I really want is to see how the zeros change as n changes, particularly for different scales of ranges for n.

Does Mathematica have any tools to help me do that?

  • 2
    $\begingroup$ How about pts=Table[(Point[{Re[#], Im[#]}])& /@ zeros[n], {n, 5, 30}] and then plotting the points as in Show[Graphics[pts], Frame -> True] or some other graphics command? You could also use Manipulate instead of Table, above (with some minor modification). $\endgroup$
    – Peltio
    Commented Feb 27, 2014 at 9:19
  • 1
    $\begingroup$ Take a look at this answer Factoring a two variable polynomial in a special way. $\endgroup$
    – Artes
    Commented Mar 29, 2014 at 12:16

1 Answer 1


Building on Peltio's idea:

colfunc = ColorData["AvocadoColors"];
pts = Table[{colfunc[n/30], Point[{Re[#], Im[#]}]} & /@ zeros[n], {n, 5, 30}];
Graphics[pts, Frame -> True]

The color function is meant to give you an idea of which n a root correspond to. Of course it is optional, without it it's just Peltio's code.


The most beautiful visualization of roots I've seen on here is this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.