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.

This page as a plain text file.
%I A307153 #25 Aug 01 2019 00:28:49
%S A307153 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,
%T A307153 13,28,15,30,16,32,18,34,20,35,22,37,24,39,26,41,29,43,31,46,33,48,35,
%U A307153 50,36,52,38,54,40,55,42,57,44,59,46,61,49,63,51,66,53,68
%N A307153 Sequence gives pair of terms giving the numbers of previous even digits and previous odd digits; a(0)=0.
%C A307153 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.
%C A307153 Are there any numbers that appear 4, 5 or more times?
%C A307153 From _Giovanni Resta_, Apr 01 2019: (Start)
%C A307153 4 times: 15711971, 22606282, 22826268, ...
%C A307153 5 times: 42862042, 44464482, 82802082, ...
%C A307153 6 times: 224026426, 224028040, 224042062, ...
%C A307153 7 times: 242620882, 244220442, 260088080, ...
%C A307153 Therefore, the first terms that appear n times, with n >= 0, are 6, 0, 3, 248, 15711971, 42862042, 224026426, 242620882, 1, ... (End)
%H A307153 Paolo P. Lava, <a href="/A307153/b307153.txt">Table of n, a(n) for n = 0..10000</a>
%F A307153 a(2n+1) = total number of even digits from a(0) to a(2n).
%F A307153 a(2n+2) = total number of odd digits from a(0) to a(2n+1).
%e A307153 a(1) = 1 because there is only one even digit before a(1): a(0) = 0.
%e A307153 a(2) = 1 because there is only one odd digit before a(2): a(1) = 1. Etc.
%p A307153 P:=proc(q) local a,b,d,d1,k,n,p,p1; a:=[0]: p:=1; d:=0;
%p A307153 for n from 2 to q do a:=[op(a),p]: b:=[op(convert(p,base,10))]:
%p A307153 p1:=0: d1:=0: for k from 1 to nops(b) do if b[k] mod 2=0
%p A307153 then p1:=p1+1: else d1:=d1+1: fi; od; d:=d+d1: p:=p+p1:
%p A307153 a:=[op(a),d]: b:=[op(convert(d,base,10))]: p1:=0: d1:=0:
%p A307153 for k from 1 to nops(b) do if b[k] mod 2=0 then p1:=p1+1:
%p A307153 else d1:=d1+1: fi; od; d:=d+d1: p:=p+p1: od; op(a); end: P(35);
%o A307153 (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
%Y A307153 Cf. A196563, A196564.
%K A307153 nonn,base,easy
%O A307153 0,5
%A A307153 _Paolo P. Lava_, Mar 27 2019