login
A171797
A modified Sisyphus function: a(n) = concatenation of (number of digits in n) (number of even digits) (number of odd digits).
11
110, 101, 110, 101, 110, 101, 110, 101, 110, 101, 211, 202, 211, 202, 211, 202, 211, 202, 211, 202, 220, 211, 220, 211, 220, 211, 220, 211, 220, 211, 211, 202, 211, 202, 211, 202, 211, 202, 211, 202, 220, 211, 220, 211, 220, 211, 220, 211, 220, 211, 211, 202
OFFSET
0,1
COMMENTS
Start with n, repeatedly apply the map i -> a(i). Then every number converges to 312. - Eric Angelini and Alexandre Wajnberg, Oct 15 2010
REFERENCES
M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.
LINKS
EXAMPLE
11 has 2 digits, both odd, so a(11) = 202.
12 has 2 digits, one even and one odd, so a(12)=211. Then a(211) = 312.
MAPLE
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:
cat2 := proc(a, b) local ndigsb; ndigsb := max(ilog10(b)+1, 1) ; a*10^ndigsb+b ; end:
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:
A055642 := proc(n) max(1, ilog10(n)+1) ; end proc:
A171797 := proc(n) local n1, n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n1, n2, n1-n2]) ; end proc:
seq(A171797(n), n=1..80) ; # R. J. Mathar, Oct 15 2010 and Oct 18 2010
PROG
(Haskell)
a171797 n = read $ concatMap (show . ($ n))
[a055642, a196563, a196564] :: Integer
-- Reinhard Zumkeller, Feb 22 2012, Oct 15 2010
(Python)
def a(n):
s = str(n); e = sum(d in "02468" for d in s)
return int("".join(map(str, (len(s), e, len(s)-e))))
print([a(n) for n in range(52)]) # Michael S. Branicky, Jun 15 2021
CROSSREFS
Cf. A073053 (Sisyphus), A171798, A171813, A055642, A196563, A196564, A308002, A308003 (another version).
A100961 gives steps to reach 312.
Sequence in context: A084292 A266849 A278758 * A281173 A281219 A266979
KEYWORD
nonn,base,easy,look
AUTHOR
N. J. A. Sloane, Oct 15 2010
EXTENSIONS
More terms from R. J. Mathar, Oct 15 2010
a(0) added by N. J. A. Sloane, May 12 2019
STATUS
approved