Algorithm AS 20: The efficient formation of a triangular array with restricted storage for data