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

Home > Numbers
Maximum SOD (Posted on 2009-07-21) Difficulty: 3 of 5
Determine the maximum value of SOD(pq), where each of p and q is a positive integer < 100.

Note: SOD(x) denotes the sum of the base ten digits of x.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution UBASIC solution Comment 1 of 1

UBASIC has the necessary precision to do this:

 10   for P=1 to 100
 20   for Q=1 to 100
 30        V=cutspc(str(P^Q))
 40        T=0:Ct=0
 50        for I=1 to len(V)
 60           T=T+val(mid(V,I,1)):Ct=Ct+1
 70        next
 80        if T>=Max then
 90           :print P;Q,V;T:Max=T
 95           :print Ct;T/Ct
100   next
110   next

finds that the maximum SOD(p^q) is 99^95, whose 190 digits total 972, beating out the next largest, 94^98, whose greater number of digits (194) total only 970, as the average digit in the maximum SOD is 5.11579, vs the runner-up's 5.

 94 ^ 98    =   2325571265870981054156130433083369995987150699861246479853313067
03776949993251588965917772109867956848511077254540681882888225677649126945218740
79483339544658453938914789983271676836345351766016, SOD = 970
# of digits = 194; avg digit =  5.0
 
 99 ^ 95    =   3848960788934848611927795802824596789608451156087366034658627953
53014812600853425803226738376862748709461096855428669269737472672585319565767946
0590239636893953692985541958490801973870359499, SOD = 972
# of digits =  190; avg digit =  5.1157894736842105263

  Posted by Charlie on 2009-07-21 17:51:13
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 (24)
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