Sine wave using only Math nodes?
Sine Wave
Producing a sine wave is easy as Sine is one of the math functions in the Blender Internal Converter --&gt; Math node.
However, a normal sine is no good as a direct factor for a mix node, since a sine wave produces values between -1 and 1, and the node expects a value between 0-1. To produce sine-like oscillating values between 0 and 1 I used the equation ( sin(x) + 1 ) / 2.
The node tree looks like this:

The factor values produced by this node setup look like this (green line):

Square Wave
A square wave is also pretty easy, since we only need to discern between positive and negative values, which we can do using the &quot;Greater Than&quot; or &quot;Less Than&quot; nodes:

And the factor values:

Triangle Wave
Based on this algorithm as implemented in wolfram, I used the following equation to generate a triangle wave:
pi/2 * asin( sin(pi * x) )
Since there is no inverse sine (asin) in the math node, I used the identity function (that employs the inverse cosine which can be found in the math node's repertoire):
asin(x) = pi/2 - acos(x)
Also, the original triangle wave creates values between pi/2 and -pi/2 more or less, so I adapted it thus to produce values between 0-1 (more or less):
( asin( sin(pi * x) ) + pi/2 ) / pi
The node setup looks like this:

This is by far the ugliest and biggest node setup, but that's the best I could manage. Here's how the factor values look:

Sawthooth Wave
Based on this answer, again adjusted to fit values between 0 and 1, I used this equation as basis:
( ( x + 1 ) % 2 ) / 2
Node setup:

Factor values: