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.

A307153 Sequence gives pair of terms giving the numbers of previous even digits and previous odd digits; a(0)=0.

Original entry on oeis.org

0, 1, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 1, 14, 2, 15, 3, 18, 4, 19, 5, 22, 7, 23, 8, 24, 11, 26, 13, 28, 15, 30, 16, 32, 18, 34, 20, 35, 22, 37, 24, 39, 26, 41, 29, 43, 31, 46, 33, 48, 35, 50, 36, 52, 38, 54, 40, 55, 42, 57, 44, 59, 46, 61, 49, 63, 51, 66, 53, 68
Offset: 0

Views

Author

Paolo P. Lava, Mar 27 2019

Keywords

Comments

Up to n = 10^5, any integer generally appears 0, 1 or 2 times. Only 248, 428 and 806 appear 3 times and 1 appears 8 times.
Are there any numbers that appear 4, 5 or more times?
From Giovanni Resta, Apr 01 2019: (Start)
4 times: 15711971, 22606282, 22826268, ...
5 times: 42862042, 44464482, 82802082, ...
6 times: 224026426, 224028040, 224042062, ...
7 times: 242620882, 244220442, 260088080, ...
Therefore, the first terms that appear n times, with n >= 0, are 6, 0, 3, 248, 15711971, 42862042, 224026426, 242620882, 1, ... (End)

Examples

			a(1) = 1 because there is only one even digit before a(1): a(0) = 0.
a(2) = 1 because there is only one odd digit before a(2): a(1) = 1. Etc.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,d,d1,k,n,p,p1; a:=[0]: p:=1; d:=0;
    for n from 2 to q do a:=[op(a),p]: b:=[op(convert(p,base,10))]:
    p1:=0: d1:=0: for k from 1 to nops(b) do if b[k] mod 2=0
    then p1:=p1+1: else d1:=d1+1: fi; od; d:=d+d1: p:=p+p1:
    a:=[op(a),d]: b:=[op(convert(d,base,10))]: p1:=0: d1:=0:
    for k from 1 to nops(b) do if b[k] mod 2=0 then p1:=p1+1:
    else d1:=d1+1: fi; od; d:=d+d1: p:=p+p1: od; op(a); end: P(35);
  • PARI
    nb = [0,0]; for (n=1, 71, print1 (v=nb[1+n%2]", "); apply(d -> nb[1+d%2]++, if (v, digits(v), [0]))) \\ Rémy Sigrist, May 04 2019

Formula

a(2n+1) = total number of even digits from a(0) to a(2n).
a(2n+2) = total number of odd digits from a(0) to a(2n+1).