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.

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.

This page as a plain text file.
%I A175792 #14 Dec 30 2021 18:06:10
%S A175792 -1,-2,-1,-2,-3,-4,-3,-2,-3,-4,-5,-4,-5,-6,-7,-8,-7,-8,-7,-6,-5,-4,-3,
%T A175792 -2,-3,-4,-3,-4,-3,-4,-5,-6,-5,-4,-3,-2,-1,-2,-3,-4,-5,-4,-5,-6,-7,-8,
%U A175792 -9,-10,-11,-12,-11,-12,-11,-10,-9,-10,-11,-10,-11,-10,-9,-10,-11,-10
%N 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.
%e A175792 a(6) = (-1)^3 + (-1)^1 + (-1)^4 + (-1)^1 + (-1)^5 + (-1)^9= -4.
%p A175792 Digits := 100:
%p A175792 A000796 := proc(n)
%p A175792         floor(Pi*10^(n-1)) mod 10;
%p A175792 end proc:
%p A175792 A175792 := proc(n)
%p A175792         add((-1)^A000796(k),k=1..n) ;
%p A175792 end proc: # _R. J. Mathar_, Jul 10 2012
%t A175792 Rest@ FoldList[ Plus, 0, (-1)^First@ RealDigits[Pi, 10, 200]]
%t A175792 Accumulate[Table[If[EvenQ[n],1,-1],{n,RealDigits[Pi,10,70][[1]]}]] (* _Harvey P. Dale_, Nov 03 2015 *)
%Y A175792 cf. A000796, A030657, A196686 (negated), A175813 (indices of 0's).
%K A175792 base,sign
%O A175792 1,2
%A A175792 _Michel Lagneau_, Sep 06 2010