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

 Maximum SOD (Posted on 2009-07-21)
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 No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 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/Ct100   next110   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    =   23255712658709810541561304330833699959871506998612464798533130670377694999325158896591777210986795684851107725454068188288822567764912694521874079483339544658453938914789983271676836345351766016, SOD = 970# of digits = 194; avg digit =  5.0  99 ^ 95    =   3848960788934848611927795802824596789608451156087366034658627953530148126008534258032267383768627487094610968554286692697374726725853195657679460590239636893953692985541958490801973870359499, SOD = 972# of digits =  190; avg digit =  5.1157894736842105263`

 Posted by Charlie on 2009-07-21 17:51:13

 Search: Search body:
Forums (0)