login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Harvey P. Dale, Table of n, a(n) for n = 1..1000

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

Cf. A001113, A071981.

Sequence in context: A167516 A125931 A125932 * A244789 A309932 A058886

Adjacent sequences:  A175790 A175791 A175792 * A175794 A175795 A175796

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 28 11:04 EDT 2020. Contains 338054 sequences. (Running on oeis4.)