|
|
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).
|
|
3
|
|
|
110, 11, 110, 11, 110, 11, 110, 11, 110, 11, 121, 22, 121, 22, 121, 22, 121, 22, 121, 22, 220, 121, 220, 121, 220, 121, 220, 121, 220, 121, 121, 22, 121, 22, 121, 22, 121, 22, 121, 22, 220, 121, 220, 121, 220, 121, 220, 121, 220, 121, 121, 22, 121, 22, 121
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
If we start with n and repeatedly apply the map i -> a(i), we eventually reach 132 (see A073054).
|
|
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)=22 (leading zeros are omitted).
12 has 2 digits, one even and one odd, so a(12)=121. Then a(121) = 132.
|
|
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:
A308003 := proc(n) local n1, n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n2, n1, n1-n2]) ; end proc:
|
|
PROG
|
(Python)
def a(n):
s = str(n)
e = sum(1 for c in s if c in "02468")
return int(str(e) + str(len(s)) + str(len(s)-e))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|