OFFSET
1,1
COMMENTS
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..4105.
Eric Weisstein's World of Mathematics, e.
Eric Weisstein's World of Mathematics, PI.
EXAMPLE
a(1)=218 because the sum of the first 218 digits of e (including the initial 2) equals 987. That is the same result for the first 218 digits of Pi (including the initial 3).
MATHEMATICA
de = First@ RealDigits[E, 10, 10^5]; dse = 0; dpi = First@ RealDigits[Pi, 10, 10^5]; dspi = 0; lst = {}; Do[ dse = dse + de[[n]]; dspi = dspi + dpi[[n]]; If[dse == dspi, AppendTo[lst, n]; Print@n], {n, 10^5}] (* Robert G. Wilson v, Sep 16 2007 *)
Module[{nn=100000, ed, pd}, ed=Accumulate[RealDigits[E, 10, nn][[1]]]; pd= Accumulate[ RealDigits[Pi, 10, nn][[1]]]; Flatten[Position[Thread[ {ed, pd}], _?(#[[1]]==#[[2]]&), {1}, Heads->False]]] (* Harvey P. Dale, Feb 18 2015 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Sergio Pimentel, Sep 13 2007
EXTENSIONS
More terms from Robert G. Wilson v, Sep 16 2007
a(6) corrected by N. J. A. Sloane, Nov 23 2007
STATUS
approved