Repeat a generated texture in Cycles?
Welcome to the wonderful world of math!



(note that the top face gets a little screwed up if it's perfectly flat, but that's easy to fix just by adding or subtracting a small value before the Modulo math node)

Modulo is a math operation available in the Math node. It gives the remainder when dividing two numbers (e.g: 5 mod 2 = 1, 9 mod 3 = 0, or 2.3 mod 1.0 = 0.3).

In this case, we divide the coordinates (which range from 0.0 to 10.0, since the mapping scale is on 10) by 1.0, and thus for every whole number the math node shows black (remainder is 0.0), but as the decimal increases it'll get lighter (bigger and bigger remainders) until we reach the next whole number and it turns black again, restarting the cycle.

Since a gradient texture only changes on one axis, we only need to do the modulo operation on the X axis, but in other cases you may want to do it for the Y and Z axes as well.