def calculate_increment_for_chunking_simulation_problems(n_simulation_problems, n_chunks):
    """
    Calculate increment for partitioning simulation problems into chunks.
    increment is aimed to be as close to a multiple of n_chunks as
    possible, while not being a multiple of 2 or 3, the only radices
    simulation problem variations can have.

    Starting from the first (0-th) simulation problem and incrementing
    by the increment (modulo n_sims) n_sims times will attain each
    simulation problem exactly once.

    :param n_simulation_problems: number of simulation problems
    :param n_chunks: number of chunks
    :return: increment
    """
    if n_chunks % 2 > 0 and n_chunks % 3 > 0:
        increment = n_chunks
    elif n_chunks % 2 == 1:
        # n_chunks is odd and 0 modulo 3.
        increment = n_chunks - 2
    elif n_chunks % 3 == 2:
        # n_chunks is even and 2 modulo 3.
        increment = n_chunks - 1
    else:
        # n_chunks is even and either 0 or 1 modulo 3.
        increment = n_chunks + 1

    return increment % n_simulation_problems