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.

A308003 A modified Sisyphus function: a(n) = concatenation of (number of even digits in n) (number of digits in n) (number of odd digits in n).

This page as a plain text file.
%I A308003 #30 Mar 29 2022 08:37:58
%S A308003 110,11,110,11,110,11,110,11,110,11,121,22,121,22,121,22,121,22,121,
%T A308003 22,220,121,220,121,220,121,220,121,220,121,121,22,121,22,121,22,121,
%U A308003 22,121,22,220,121,220,121,220,121,220,121,220,121,121,22,121,22,121
%N A308003 A modified Sisyphus function: a(n) = concatenation of (number of even digits in n) (number of digits in n) (number of odd digits in n).
%C A308003 If we start with n and repeatedly apply the map i -> a(i), we eventually reach 132 (see A073054).
%D A308003 M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.
%H A308003 N. J. A. Sloane, <a href="/A308003/b308003.txt">Table of n, a(n) for n = 0..28000</a>
%e A308003 11 has 2 digits, both odd, so a(11)=22 (leading zeros are omitted).
%e A308003 12 has 2 digits, one even and one odd, so a(12)=121. Then a(121) = 132.
%p A308003 # Maple code based on _R. J. Mathar_'s code for A171797:
%p A308003 nevenDgs := proc(n) local a, d; a := 0 ; for d in convert(n,base,10) do if type(d,'even') then a :=a +1 ; end if; end do; a ; end proc:
%p A308003 cat2 := proc(a,b) local ndigsb; ndigsb := max(ilog10(b)+1,1) ; a*10^ndigsb+b ; end:
%p A308003 catL := proc(L) local a, i; a := op(1,L) ; for i from 2 to nops(L) do a := cat2(a,op(i,L)) ; end do; a; end proc:
%p A308003 A055642 := proc(n) max(1,ilog10(n)+1) ; end proc:
%p A308003 A308003 := proc(n) local n1,n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n2,n1,n1-n2]) ; end proc:
%p A308003 seq(A308003(n),n=0..80) ;
%o A308003 (Python)
%o A308003 def a(n):
%o A308003     s = str(n)
%o A308003     e = sum(1 for c in s if c in "02468")
%o A308003     return int(str(e) + str(len(s)) + str(len(s)-e))
%o A308003 print([a(n) for n in range(55)]) # _Michael S. Branicky_, Mar 29 2022
%Y A308003 Cf. A073053 (Sisyphus), A171797, A171798, A171813, A055642, A196563, A196564, A308002.
%Y A308003 A073054 gives steps to reach 132.
%K A308003 nonn,base,easy
%O A308003 0,1
%A A308003 _N. J. A. Sloane_, May 12 2019