login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A196686
Number of odd digits of Pi minus number of even digits.
2
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, 11, 10, 11, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 2, 1, 0, -1, -2, -1, -2, -3, -4, -3, -2, -3, -4, -3, -2
OFFSET
1,2
COMMENTS
Cumulative sum of A030657 with zeros replaced by "-1".
LINKS
Zak Seidov, Table of n, a(n) for n = 1..10000 [a(10000) corrected by Georg Fischer, Dec 29 2021]
EXAMPLE
Among first 10 digits of Pi, {3,1,4,1,5,9,2,6,5,3}, there are 7 odd and 3 even, hence a(10)=7-3=4.
MATHEMATICA
rd=RealDigits[N[Pi, 10004]][[1]]; a=0; s=Reap[Do[a=a+2Mod[rd[[n]], 2]-1; Sow[{n, a}], {n, 10004}]][[2, 1]] (* this gives b-file *) (* Zak Seidov, Oct 05 2011 *)
CROSSREFS
Cf. A030657, A175792 (negated), A175813 (indices of 0's).
Sequence in context: A202275 A030307 A175792 * A213088 A357564 A169809
KEYWORD
sign,base
AUTHOR
Zak Seidov, Oct 05 2011
EXTENSIONS
Definition amended by Georg Fischer, Dec 29 2021
STATUS
approved