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.

A043698 Numbers whose base-9 representation has an even number of runs.

This page as a plain text file.
%I A043698 #11 Feb 20 2023 12:42:31
%S A043698 9,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,31,32,33,34,
%T A043698 35,36,37,38,39,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,
%U A043698 61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,81,90,92,93,94,95,96,97,98,101,111,121,131,141
%N A043698 Numbers whose base-9 representation has an even number of runs.
%p A043698 isA043698 := proc(n)
%p A043698     local dgs,runs,i ;
%p A043698     dgs := convert(n,base,9) ;
%p A043698     runs :=1 ;
%p A043698     for i from 2 to nops(dgs) do
%p A043698         if op(i,dgs) <> op(i-1,dgs) then
%p A043698             runs := runs+1 ;
%p A043698         end if;
%p A043698     end do:
%p A043698     if type(runs,'even') then
%p A043698         true;
%p A043698     else
%p A043698         false;
%p A043698     end if;
%p A043698 end proc:
%p A043698 A043698 := proc(n)
%p A043698     option remember;
%p A043698     local a;
%p A043698     if n = 1 then
%p A043698         9;
%p A043698     else
%p A043698         for a from procname(n-1)+1 do
%p A043698             if isA043698(a) then
%p A043698                 return a ;
%p A043698             end if;
%p A043698         end do:
%p A043698     end if
%p A043698 end proc:
%p A043698 seq(A043698(n),n=1..120) ; # _R. J. Mathar_, Feb 20 2023
%K A043698 nonn,base
%O A043698 1,1
%A A043698 _Clark Kimberling_