Forum Discussion
ltwagnon
Feb 24, 2017Ret. Employee
Security Challenge #2 Answers
Our DevCentral Security Challenge 2 is found here: https://devcentral.f5.com/articles/security-month-on-devcentral-challenge-2
This is the Q&A placeholder for answers to be posted. Once you ha...
Stanislas_Piro2
Cumulonimbus
Feb 28, 2017sum (1 -> x) = (x*(x+1))/2
sum even (if x is even) (1 -> x) = (x/2*(x/2 +1)
sum odd (1-> x) = (x*(x+1))/2 - (x/2*(x/2 +1))
= x/2 * ((x+1) - (x/2 +1))
= x/2 * (x - x/2)the tcl code is :
% set x 4976
4976
to convert odd to next even number if number is odd
%set x [expr {($x-1)/2*2+2}]
4976
%set result [expr {$x/2 * ($x - $x/2) }]
6190144Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects