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.

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

This page as a plain text file.
%I A171797 #39 Jun 15 2021 11:05:29
%S A171797 110,101,110,101,110,101,110,101,110,101,211,202,211,202,211,202,211,
%T A171797 202,211,202,220,211,220,211,220,211,220,211,220,211,211,202,211,202,
%U A171797 211,202,211,202,211,202,220,211,220,211,220,211,220,211,220,211,211,202
%N A171797 A modified Sisyphus function: a(n) = concatenation of (number of digits in n) (number of even digits) (number of odd digits).
%C A171797 Start with n, repeatedly apply the map i -> a(i). Then every number converges to 312. - _Eric Angelini_ and _Alexandre Wajnberg_, Oct 15 2010
%D A171797 M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.
%H A171797 Reinhard Zumkeller, <a href="/A171797/b171797.txt">Table of n, a(n) for n = 0..25000</a>
%e A171797 11 has 2 digits, both odd, so a(11) = 202.
%e A171797 12 has 2 digits, one even and one odd, so a(12)=211. Then a(211) = 312.
%p A171797 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 A171797 cat2 := proc(a,b) local ndigsb; ndigsb := max(ilog10(b)+1,1) ; a*10^ndigsb+b ; end:
%p A171797 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 A171797 A055642 := proc(n) max(1,ilog10(n)+1) ; end proc:
%p A171797 A171797 := proc(n) local n1,n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n1,n2,n1-n2]) ; end proc:
%p A171797 seq(A171797(n),n=1..80) ; # _R. J. Mathar_, Oct 15 2010 and Oct 18 2010
%o A171797 (Haskell)
%o A171797 a171797 n = read $ concatMap (show . ($ n))
%o A171797                    [a055642, a196563, a196564] :: Integer
%o A171797 -- _Reinhard Zumkeller_, Feb 22 2012, Oct 15 2010
%o A171797 (Python)
%o A171797 def a(n):
%o A171797     s = str(n); e = sum(d in "02468" for d in s)
%o A171797     return int("".join(map(str, (len(s), e, len(s)-e))))
%o A171797 print([a(n) for n in range(52)]) # _Michael S. Branicky_, Jun 15 2021
%Y A171797 Cf. A073053 (Sisyphus), A171798, A171813, A055642, A196563, A196564, A308002, A308003 (another version).
%Y A171797 A100961 gives steps to reach 312.
%K A171797 nonn,base,easy,look
%O A171797 0,1
%A A171797 _N. J. A. Sloane_, Oct 15 2010
%E A171797 More terms from _R. J. Mathar_, Oct 15 2010
%E A171797 a(0) added by _N. J. A. Sloane_, May 12 2019