[n/3] + [(n+2)/6] + [(n+4)/6] = [n/2] + [(n+3)/6]
where [] is the floor function.
Showing this involves proving (A)
2n (mod 6) + (n+2) (mod 6) + (n+4) (mod 6)
equals
3n (mod 6) + (n+3) (mod 6) + 3 (mod 6)
Or, alternatively (B)
{2n/6} + {(n+2)/6} + {(n+4)/6}
equals
{3n/6} + {(n+3)/6} + {3/6}
where {} is the function that returns the fractional part.
It looks very tempting in either case to simply remove the brackets - they
add up!!
In either case A or B, I have not been able to come up with a proof other
than to take a series of values for n and infer the truth of the equations
by induction. This isn't very satisfying. Pawing over the graphs of
associated modulo functions hasn't revealed to me any neat relationships or
ways to legitimately combine them.
Is there a direct method?
Cheers,
Brad
In CAS notation...
modp((2*n),6) + modp((n+2),6) + modp((n+4),6);
modp((3*n),6) + modp((n+3),6) + modp(3,6);
frac((2*n)/6) + frac((n+2)/6) + frac((n+4)/6);
frac((3*n)/6) + frac((n+3)/6) + frac(3/6);
[remainder omitted]
I don't know where you got (A), but it is not correct.
For example, if n=4(mod 6), then
2n (mod 6) + (n+2) (mod 6) + (n+4) (mod 6) = 2+0+2,
while 3n (mod 6) + (n+3) (mod 6) + 3 (mod 6) = 4+1+3.
The straightforward way of proving this is to take
the six possibilities of n (mod 6).
n=6k or n=6k+1 => [n/3] + [(n+2)/6] + [(n+4)/6]
= 2k + k + k = 3k+k
= [n/2] + [(n+3)/6]
n=6k+2 => [n/3] + [(n+2)/6] + [(n+4)/6]
= 2k + k + k+1 = 3k+1 + k
= [n/2] + [(n+3)/6]
n=6k+3 => [n/3] + [(n+2)/6] + [(n+4)/6]
= 2k+1 + k + k+1 = 3k+1 + k+1
= [n/2] + [(n+3)/6]
n=6k+4 or n=6k+5 => [n/3] + [(n+2)/6] + [(n+4)/6]
= 2k+1 + k+1 + k+1 = 3k+2 + k+1
= [n/2] + [(n+3)/6]
Dan
Hi Dan,
(A) is correct. n is any positive integer, so if n = 4 then
3n (mod 6) + (n+3) (mod 6) + 3 (mod 6) = 0+1+3.
Your way of enumerating the possibilities in the original equation made up
of floor functions is direct and neat!
Thanks for that - much appreciated :-)
Cheers,
Brad