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
)
For each positive integer n, let D
n
be the greatest odd divisor of n. (For example, D
168
= 21.) Find D
1
+ D
2
+ D
3
+ ⋅ ⋅ ⋅ + D
2048
.
No Solution Yet
Submitted by
Danish Ahmed Khan
No Rating
Comments: (
Back to comment list
| You must be logged in to post comments.
)
Computer solution
| Comment 2 of 4 |
1,398,102
-------------
def largestOddDivisor(n):
""" input integer, output the largest odd divisor """
if n%2 == 1:
return n
for i in range(int(n/2)+1-int(n/2)%2 , 0, -2):
if n%i == 0:
return i
return None
mysum = 0
for n in range(1,2049):
mysum += largestOddDivisor(n)
print(mysum)
Posted by
Larry
on 2024-03-21 11:30:55
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 (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On
Chatterbox:
blackjack
flooble's webmaster puzzle
Copyright © 2002 - 2024 by
Animus Pactum Consulting
. All rights reserved.
Privacy Information