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

Home > Numbers
Think polynomial (Posted on 2024-01-04) Difficulty: 4 of 5
Find, as a function of n, the sum of the digits of

9 * 99 * 9999 * ... * (102n - 1)

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts Answer without proof Comment 1 of 1
9*(2^n) from the pattern of the first several terms.

notes: The number digits in the terms to be multiplied goes from 1,2,4,8,16, ...
The terms begin at n = 0

The first several terms work out to:
0 9 9 9
1 99 891 18
2 9999 8909109 36
3 99999999 890910891090891 72
4 9999999999999999 8909108910908909109089108909109 144
5 99999999999999999999999999999999 890910891090890910908910890910891090891089091090890910891090891 288

-----
def sod(n):
    """ Input an integer.  Returns the Sum of the Digits  """
    aList = list(str(n))
    ans = 0
    for c in aList:
        ans = ans + int(c)
    return ans

def f(n):
    return 10**(2**n) - 1

def g(n):
    prod = 1
    for i in range(n+1):
        prod *= f(i)
    return prod

for i in range(6):
    print(i,f(i), g(i), sod(g(i)))

  Posted by Larry on 2024-01-04 11:57:44
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (2)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
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