This is a little more complex than the linked question due to the spherical gradient texture needing a range of [-1,1] to generate a full circle.
The modulo(1) function will generate a repeating pattern by mapping positive values to a new value in [0,1] and negative values to a value in [-1,0]. This means that half the circle will be repeated in either direction from 0, not what we want.
Modulo(x,2) - 1generates a repeating [-1,1] range for x > 0 and [-3,-1] otherwise
Modulo(x,2) + 1generates a repeating [-1,1] range for x < 0 and [1,3] otherwise. This [1,3] range will present problems when combining each side with maximum so we need to set it to something less than or equal to 0
- By exploiting the fact that the spherical gradient is symmetrical around x=0, we can invert the part from (2) to avoid the issues with maximum.
Just out of interest.. (this is no better than @Sazerac's answer) .. this set of nodes has the same effect as Sazerac's cluster between the Mapping and Gradient nodes, this time placing the full gradient in the ranges ...[0,2],[2,4]... of whichever space you are using.
The graphs in the illustration below show the sequential effects on the mapping of X by the numbered nodes.The squares are all 8 units on the side.
Thanks to @Rich Sedman for the tip on how to display graphs of f(x).