def two2one(x, y):
    """Maps a positive (x,y) to an element in the naturals."""
    diag = x + y
    bottom = diag * (diag + 1) / 2
    return bottom + y
Maps a positive (x,y) to an element in the naturals.
recipes/Python/52271_How_take_cross_product_two_infinite/recipe-52271.py