1

In an earlier question, answers gave me this function:

f[n_, b_] := Module[{dig}, dig = IntegerDigits[n, b];
  D[dig.Table[x^i, {i, Length@dig - 1, 0, -1}], x] /. x -> b]

My question is how do I plot this in 3D without getting and error. I tried using floor, layering discrete plots, etc. but it didn't work.

corey979
  • 23,947
  • 7
  • 58
  • 101
mtheorylord
  • 197
  • 6

1 Answers1

3

Maybe something like this:

data = Flatten[Table[{n, b, f[n, b]}, {n, 1, 100}, {b, 2, 100}], 1];

Then to group values on different layers:

data1 = GatherBy[data, Last];

and

ListPointPlot3D[data1, AxesLabel -> {"n", "b", "f[n,b]"} ]

enter image description here

which displays a few lower layers, ot

ListPointPlot3D[data1, AxesLabel -> {"n", "b", "f[n,b]"}, PlotRange -> All]

enter image description here

to show everything.


Or in different ways:

DiscretePlot3D[f[n, b], {n, 1, 10}, {b, 2, 10}, 
 AxesLabel -> {"n", "b", "f[n,b]"}, PlotRange -> All, 
 ColorFunction -> "BlueGreenYellow", ExtentSize -> Full]

enter image description here

ListPlot3D[data, Mesh -> None, InterpolationOrder -> 3, 
 ColorFunction -> "SouthwestColors"]

enter image description here

corey979
  • 23,947
  • 7
  • 58
  • 101