f = @(n)ceil(n/3)*(mod(-n,3)-1) f(1)f(12)f(77)f(135)f(297)
Standard input is empty
f = @(n) ceil (n / 3) * (mod (-n, 3) - 1) ans = 1 ans = -4 ans = 0 ans = -45 ans = -99
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!