From charlesreid1

Revision as of 09:58, 8 January 2018 by Admin (talk | contribs)

Problem Statement

Given numbers of the form $ a^b $, where a, b <= 100, we are asked to find the values of a and b with the maximum digital sum.

Link: https://projecteuler.net/problem=56

Solution Technique

The key to this problem is to do a bit of back-of-the-envelope estimation. We have about 100 x 100 = 10,000 numbers to explore, and each one will result in a number up to $ 100^{100} $, or 101 digits.

The computer will only be doing multiplication, so this task can actually be done in a reasonable amount of time.

Code

Link: https://charlesreid1.com:3000/cs/euler/src/master/scratch/Round2_050-070/056/BigNums.java

Flags