login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175793 Excess of the number of even over the number of odd digits in the first n digits of the decimal expansion of E. 2
1, 0, -1, 0, 1, 2, 1, 2, 3, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 2, 3, 4, 5, 6, 5, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 0, -1, -2, -3, -4, -3, -4, -3, -2, -3, -2, -3, -2, -1, -2, -3, -2, -1, 0, -1, 0, 1, 0, 1, 0, -1, -2, -3, -2, -3, -4, -5, -4, -5, -6, -7, -8, -7, -6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
LINKS
FORMULA
a(n) = Sum_{k=1..n} (-1)^A001113(k).
EXAMPLE
a(6) = (-1)^2 + (-1)^7 + (-1)^1 + (-1)^8 + (-1)^2 + (-1)^8 =2.
MAPLE
Digits := 100:
A001113 := proc(n)
floor(exp(1)*10^(n-1)) mod 10;
end proc:
A175793 := proc(n)
add((-1)^A001113(k), k=1..n) ;
end proc: # R. J. Mathar, Jul 10 2012
MATHEMATICA
Rest@ FoldList[ Plus, 0, (-1)^First@ RealDigits[E, 10, 200]]
Accumulate[If[EvenQ[#], 1, -1]&/@RealDigits[E, 10, 90][[1]]] (* Harvey P. Dale, Sep 09 2014 *)
CROSSREFS
Sequence in context: A167516 A125931 A125932 * A244789 A309932 A363968
KEYWORD
base,sign
AUTHOR
Michel Lagneau, Sep 06 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 5 21:43 EDT 2024. Contains 374029 sequences. (Running on oeis4.)