Project Euler/56: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 1: | Line 1: | ||
==Problem Statement== | ==Problem Statement== | ||
Given numbers of the form <math>a^b</math>, where b <= 100, we are asked to find the values of a and b with the maximum digital sum. | Given numbers of the form <math>a^b</math>, 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 | Link: https://projecteuler.net/problem=56 | ||
==Solution Technique== | ==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 <math>100^{100}</math>, or 101 digits. | |||
The computer will only be doing multiplication, so this task can actually be done in a reasonable amount of time. | |||
==Code== | ==Code== | ||
Link: https://charlesreid1.com:3000/cs/euler/src/master/scratch/Round2_050-070/056/BigNums.java | |||
==Flags== | ==Flags== | ||
{{ProjectEulerFlag}} | {{ProjectEulerFlag}} | ||
Revision as of 09:58, 8 January 2018
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