Skip to main content
7 of 14
added 56 characters in body
kglr
  • 400.5k
  • 18
  • 488
  • 929

Update 2: Using tr with ContourPlot and ContourPlot3D:

ClearAll[tr]
tr[n_] := (2 n^2  + (-1)^n)/4;

ContourPlot[Evaluate[(x - tr[#])^2 + y^2 == #^2 & /@ Range[10]],
  {x, -1, 65}, {y, -10, 10}, 
  AspectRatio -> Automatic, PlotRange -> {{-1, 65}, {-15, 15}}, Frame -> False]

enter image description here

ContourPlot3D[Evaluate[(x - tr[#])^2 + y^2 + z^2 == #^2 & /@ Range[10]], 
  {x, -1, 65}, {y, -10, 10}, {z, -15, 15}, 
  Mesh -> None, 
  ContourStyle -> Opacity[.5], BoxRatios -> Automatic, 
  PlotRange -> {{-1, 65}, {-15, 15}, {-15, 15}}, ViewPoint -> Front, 
  Boxed -> False, Axes -> False , PlotPoints -> 60]

enter image description here

Update: To generate a list of spheres similar to the circles in OP (sphere k just touching sphere k-2):

ClearAll[tr]
tr[n_] := (2 n^2  + (-1)^n)/4;

Graphics[Circle[{tr @ #, 0}, #] & /@ Range[10]]

enter image description here

Graphics3D[{Opacity[.5], Sphere[{tr @ #, 0, 0}, #] & /@ Range[10]}, Boxed -> False]

enter image description here

Original answer:

You can use Translate and Scale Sphere[] as follows:

radii = Range[5];

Graphics3D[Translate[Scale[Sphere[], #], {#^2, 0, 0}] & /@ radii]

enter image description here

or translate to leave gaps between spheres:

translations = 2 Accumulate[radii];

Graphics3D[MapThread[Translate[Scale[Sphere[], #], {#2, 0, 0}] &, {radii, translations}]]

enter image description here

kglr
  • 400.5k
  • 18
  • 488
  • 929