login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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