|
|
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:
floor(exp(1)*10^(n-1)) mod 10;
end proc:
|
|
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
|
|
|
KEYWORD
|
base,sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|