in reply to Re^3: Reverse engineering a formula...
in thread Reverse engineering a formula...

ITYM sin not cos; the former intersects y=x for integers, while the later intersects for multiples of 0.5. And the extremums would be at n + (-1)n sin-1( 1 / rπ )/π (for integer n).

</pedant> :)

Update: Gah, I had rather than because I used that as the constant when I checked things.