cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A175792 a(n) = Sum_{k=1..n} (-1)^A000796(k), excess of the number of even over odd digits in the first n digits of Pi.

Original entry on oeis.org

-1, -2, -1, -2, -3, -4, -3, -2, -3, -4, -5, -4, -5, -6, -7, -8, -7, -8, -7, -6, -5, -4, -3, -2, -3, -4, -3, -4, -3, -4, -5, -6, -5, -4, -3, -2, -1, -2, -3, -4, -5, -4, -5, -6, -7, -8, -9, -10, -11, -12, -11, -12, -11, -10, -9, -10, -11, -10, -11, -10, -9, -10, -11, -10
Offset: 1

Views

Author

Michel Lagneau, Sep 06 2010

Keywords

Examples

			a(6) = (-1)^3 + (-1)^1 + (-1)^4 + (-1)^1 + (-1)^5 + (-1)^9= -4.
		

Crossrefs

cf. A000796, A030657, A196686 (negated), A175813 (indices of 0's).

Programs

  • Maple
    Digits := 100:
    A000796 := proc(n)
            floor(Pi*10^(n-1)) mod 10;
    end proc:
    A175792 := proc(n)
            add((-1)^A000796(k),k=1..n) ;
    end proc: # R. J. Mathar, Jul 10 2012
  • Mathematica
    Rest@ FoldList[ Plus, 0, (-1)^First@ RealDigits[Pi, 10, 200]]
    Accumulate[Table[If[EvenQ[n],1,-1],{n,RealDigits[Pi,10,70][[1]]}]] (* Harvey P. Dale, Nov 03 2015 *)
Showing 1-1 of 1 results.