How many partial binary boolean functions are there?

The triangular numbers are the number of dots in a triangle that
is n rows deep and n columns wide.
Thus t(4) is 1+2+3+4=10. Write a standard ML function to
compute t(n).

.
.. .
... .. .
.... ... .. .

The pyramidal numbers are the number of dots in a pyramid that
is n rows long and n columns wide
and n columns high.
Thus p(4) is 1+3+6+10=20.
Write a standard ML function to
compute p(n).

Generalize.

Guesstimate the running time behaviour of
the winning and losing
functions discussed in class.

A function to aid timing can be
found here.
this function is invoked as TimeUtil.time f x
and it returns a pair consisting of the time to compute f
x and the value of the computation.