All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Ceiling and Floor Formulation (Posted on 2013-03-04)
Formulate an algorithm for fast evaluation of:
Σj=1,...,n2 (floor (√j) + ceil (√j)), where n is a positive integer.

** ceil(x) is the least integer ≥ x and, floor(x) is the greatest integer ≤ x

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution? | Comment 3 of 6 |
(In reply to Solution? by Jer)

The formula you give shows S(1) as being 1, while it is actually 2, as both the floor and ceiling of sqrt(1) are 1.

For n=2, we're working on the square roots of 1, 2, 3 and 4. Adding the respective floors and ceilings we get 1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 = 12. Your formula gives (32-2)/3 = 30/3 = 10.

`n       direct sum   (4*n^3+2*n)/3    (4*n^3-n)/31             2             2             12             12            12            103             38            38            354             88            88            845             170           170           1656             292           292           2867             462           462           4558             688           688           6809             978           978           96910            1340          1340          133011            1782          1782          177112            2312          2312          230013            2938          2938          292514            3668          3668          365415            4510          4510          449516            5472          5472          545617            6562          6562          6545`

 Posted by Charlie on 2013-03-04 15:40:27

 Search: Search body:
Forums (0)