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

%I #9 Sep 09 2014 00:23:16

%S 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,

%T 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,

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

%N Excess of the number of even over the number of odd digits in the first n digits of the decimal expansion of E.

%H Harvey P. Dale, <a href="/A175793/b175793.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = Sum_{k=1..n} (-1)^A001113(k).

%e a(6) = (-1)^2 + (-1)^7 + (-1)^1 + (-1)^8 + (-1)^2 + (-1)^8 =2.

%p Digits := 100:

%p A001113 := proc(n)

%p floor(exp(1)*10^(n-1)) mod 10;

%p end proc:

%p A175793 := proc(n)

%p add((-1)^A001113(k),k=1..n) ;

%p end proc: # _R. J. Mathar_, Jul 10 2012

%t Rest@ FoldList[ Plus, 0, (-1)^First@ RealDigits[E, 10, 200]]

%t Accumulate[If[EvenQ[#],1,-1]&/@RealDigits[E,10,90][[1]]] (* _Harvey P. Dale_, Sep 09 2014 *)

%Y Cf. A001113, A071981.

%K base,sign

%O 1,6

%A _Michel Lagneau_, Sep 06 2010

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)