Twenty Million Chances to Get it Wrong

You friend believes she's found a very efficient algorithm for generating e e (the base of the natural logarithm). However, she wants to check that it's correct.

She asks you to find the digit sum of the digit sum of the first twenty million digits after the decimal mark in e e to ensure that her computed value matches the correct calculated value.

What is answer she should hope to have?

Details and assumptions

  • The digit sum of a number is the sum of all its digits. For example the digit sum of 9123 is 9 + 1 + 2 + 3 = 15 9 + 1 + 2 + 3 = 15 .
  • The "digit sum of the digit sum" of 9123 is the digit sum of 15, which would be 6.
  • One possible definition of e e is lim n ( 1 + 1 n ) n \displaystyle \lim_{n\to\infty} \left( 1 + \frac{1}{n} \right)^n .


The answer is 52.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Bernardo Sulzbach
Jun 27, 2014

Mathematica solution:

Total[IntegerDigits[Total[RealDigits[N[E, 20000001]][[1]][[2;;]]]]]

Yeah, that is exactly what I did.

However, we're making use of Mathematica's inbuilt algorithms to calculate it.

Is there some kind of pattern or shortcut to the problem? Such that you'll be able to obtain the answer almost instantaneously with a program that we wrote?

Kp Govind - 6 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...