def triplets_with_sum(sum_of_triplet):
    """ Calculate the set of Pythagorean triplets found with the given sum """
    result = set()
    for i in range(1, sum_of_triplet // 3 + 1):
        for j in range(i, (sum_of_triplet - i) // 2 + 1):
            if i ** 2 + j ** 2 == (sum_of_triplet - i - j) ** 2:
                result.add((i, j, sum_of_triplet - i - j))
    return result