Equality of sums with fractional parts of the form $\sum_{k=1}^{n}k\{\frac{mk}{n}\}$ I recently encountered the following equality ($\{\}$ denotes fractional part):
$$\sum_{k=1}^{65}k\left\{\frac{8k}{65}\right\}=\sum_{k=1}^{65}k\left\{\frac{18k}{65}\right\}$$
and found it very interesting as most of the individual summands on one side of the equation do not have a corresponding match on the other side. Investigating further, I found several other similar equalities:
$$\sum_{k=1}^{77}k\left\{\frac{9k}{77}\right\}=\sum_{k=1}^{77}k\left\{\frac{16k}{77}\right\}$$
$$\sum_{k=1}^{77}k\left\{\frac{17k}{77}\right\}=\sum_{k=1}^{77}k\left\{\frac{24k}{77}\right\}$$
$$\sum_{k=1}^{85}k\left\{\frac{7k}{85}\right\}=\sum_{k=1}^{85}k\left\{\frac{22k}{85}\right\}$$
Does anyone have any idea what general principle/pattern these arise from?

Here is a small GNU Maxima script to ease experimentation

    display2d : false;

    /* x rational */
    my_floor(x) := block(
        if (x >= 0) then block(
            ab : divide(ratnumer(x),ratdenom(x)),
            a : ab[1], b : ab[2],
            if (b = 0) then block(
                return(x)
            ) else block(
                return(x - b/ratdenom(x))
            )
        ) else block(
            ab : divide(ratnumer(-x),ratdenom(-x)),
            a : ab[1], b : ab[2],
            if (b = 0) then block(
                return(x)
            ) else block(
                return(x - (1-b/ratdenom(-x)))
            )
        )
    );

    /* x rational */
    my_frac(x) := x - my_floor(x);

    cz : 0; cnz : 0;
    for N : 1 thru 20 do block(
    for m1 : 1 thru 20 do block(
    for m2 : m1+1 thru 20 do block(
        mylhs : apply("+",makelist(k*my_frac(m1*k/N),k,1,N)),
        myrhs : apply("+",makelist(k*my_frac(m2*k/N),k,1,N)),
        if (mylhs - myrhs = 0) then block(
            cz : cz+1,
            print(N,m1,m2,"|",mylhs)
        ) else block(
            cnz : cnz+1
        )
    )));
    print(cz,"|",cnz);


