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

Home > Just Math
Odd divisor summation (Posted on 2024-03-21) Difficulty: 3 of 5
For each positive integer n, let Dn be the greatest odd divisor of n. (For example, D168 = 21.) Find D1 + D2 + D3 + ⋅ ⋅ ⋅ + D2048.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 3 of 4 |
Already two computer solutions and neither one even tried anything other than dumb brute force.  There is a massive amount of simplification that can be done before getting the number crunching involved.

D(n) can be defined as a two-part recursive relation: 
D(2k+1) = 2k+1 and D(2k)=D(k)

Then let S(n) be the sum of D(1) through D(n), then the problem asks for S(2048).  S(1)=1 and to get larger values we can do some simple algebra.

Split the sum for S(n) into its odd terms and even terms:
{D(1)+D(3)+...+D(n or n-1 depending on parity)} 
+ {D(2)+D(4)+...+D(n or n-1 depending on parity)}
The first half will have ceil[n/2] terms and the second half will have floor[n/2] terms

After applying D(2k+1) = 2k+1, the first half is the sum of the first ceil[n/2] odd numbers, which is simply ceil[n/2]^2.  
Then on the second half applying D(2k)=D(k) reduces that down to the summation for S(floor[n/2])
We now have a recursive definition for S(n): S(n) = ceil[n/2]^2 + S(floor[n/2]).

Now to just evaluate at n=2048:
S(2048) = 1024^2 + S(1024)
= 1024^2 + 512^2 + S(512)
= 1024^2 + 512^2 + 256^2 + S(256)
...
= 1024^2 + 512^2 + 256^2 + 128^2 + 64^2 + 32^2 + 16^2 + 8^2 + 4^2 + 2^2 + 1^2 + 1
= 1398102.

  Posted by Brian Smith on 2024-03-21 12:06:33
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information