Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Solve[N[Table[BernoulliB[n, z], {n, 10, 10}] == 0]]
{{z -> -0.5841145496910024` - 0.435309007896589` I}, <<4>>}

I am then finding and replacing z -> with blank to get :

{{-0.5841145496910024` - 0.435309007896589` I}, <<4>>}

I am then finding and replacing ` I} with } to get :

{{-0.5841145496910024`-0.435309007896589}, <<4>>}

I am then finding and replacing ' with , to get :

{{-0.5841145496910024, -0.435309007896589}, <<4>>}

My question is, is there a way of doing this without all of the find & replace business?


I am generating a list from :

Solve[N[Table[BernoulliB[n, z], {n, 100, 100}] == 0]]

And then manually finding and replacing elements in the generated list such as z -> with Blank, then finding and replacing , I} with }, and so on. I am then producing a list plot form the resultant array. Is there a way of automating this process and producing a list plot directly?

share|improve this question
What do you mean by " replacing , I} with },"? – Kuba Oct 17 '13 at 7:06
({Re@z, Im@z} /. sol) // ListPlot ? – Kuba Oct 17 '13 at 7:28
Am I missing something: what's the purpose of using Table here? Why not just Solve[N@BernoulliB[10, z] == 0, z]? – murray Oct 17 '13 at 14:33
up vote 4 down vote accepted

First part of your question is answered in What are the most common pitfalls awaiting new users?.

How to plot complex points is described for example here.

What you need is what was my guess:

sol = Solve[N[Table[BernoulliB[n, z], {n, 10, 10}] == 0]];

{Re@z, Im@z} /. sol // ListPlot

enter image description here

share|improve this answer
@ Kuba Many thanks! This has saved me a great deal of time! – martin Oct 17 '13 at 7:53
And congratulations on 10k. Really fast! – cormullion Oct 17 '13 at 7:56
@cormullion Thank you, I enjoy being here :) Fast?, take a look at ybeltukov's rate :P – Kuba Oct 17 '13 at 8:00

If you use David Park's Presentations add-on (, then there's no need for the artificial pulling apart of the complex roots into their real and imaginary parts; you can just treat complex numbers as complex numbers:

<< Presentations`

pts = z /. Solve[N@BernoulliB[10, z] == 0, z]
Draw2D[{PointSize[Medium], ComplexPoint /@ pts}, Axes -> True]

enter image description here

share|improve this answer
@ Murray Many thanks for your comment - will look into it. – martin Oct 17 '13 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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