Processing math: 100%

Monday, June 8, 2015

Finding a sum involving the golden ratio

This is a math oriented algorithms puzzle.

Let φ be the golden ratio: 1+52.

Consider the following sum

Sn=[φ]+[2φ]++[nφ]


i.e

Sn=nk=1[kφ]


where [x] is the integer part of x.

Can you give an algorithm to compute Sn that takes a polynomial in logn time?

[Solution]

No comments:

Post a Comment