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.

Showing 1-5 of 5 results.

A073053 Apply DENEAT operator (or the Sisyphus function) to n.

Original entry on oeis.org

101, 11, 101, 11, 101, 11, 101, 11, 101, 11, 112, 22, 112, 22, 112, 22, 112, 22, 112, 22, 202, 112, 202, 112, 202, 112, 202, 112, 202, 112, 112, 22, 112, 22, 112, 22, 112, 22, 112, 22, 202, 112, 202, 112, 202, 112, 202, 112, 202, 112, 112, 22, 112, 22
Offset: 0

Views

Author

Michael Joseph Halm, Aug 16 2002

Keywords

Comments

DENEAT(n): concatenate number of even digits in n, number of odd digits and total number of digits. E.g., 25 -> 1.1.2 = 112 (Digits: Even, Not Even, And Total). Leading zeros are then omitted.
This is also known as the Sisyphus function. - N. J. A. Sloane, Jun 25 2018
Repeated application of the DENEAT operator reduces all numbers to 123. This is easy to prove. Compare A073054, A100961. - N. J. A. Sloane Jun 18 2005

Examples

			a(1) = 0.1.1 -> 11.
a(10000000000) = 10111 because 10000000000 has 10 even digits, 1 odd digit and 11 total digits
		

References

  • M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.
  • M. Ecker, Caution: Black Holes at Work, New Scientist (Dec. 1992)
  • M. J. Halm, Blackholing, Mpossibilities 69, (Jan 01 1999), p. 2.
  • J. Schram, The Sisyphus string, J. Rec. Math., 19:1 (1987), 43-44.
  • M. Zeger, Fatal attraction, Mathematics and Computer Education, 27:2 (1993), 118-123.

Crossrefs

Programs

  • Maple
    read("transforms") :
    A073053 := proc(n)
        local e,o,L ;
        if n = 0 then
            0 ;
        else
            e := A196563(n) ;
            o := A196564(n) ;
            L := [e,o,e+o] ;
            digcatL(L) ;
        end if;
    end proc: # R. J. Mathar, Jul 13 2012
    # Maple code based on R. J. Mathar's code for A171797, added by N. J. A. Sloane, May 12 2019 (Start)
    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:
    A073053 := proc(n) local n1, n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n2, n1-n2, n1]) ; end proc:
    seq(A073053(n), n=1..80) ; (End)
    L:=proc(n) if n=0 then 1 else floor(evalf(log(n)/log(10)))+1; fi; end;
    S:=proc(n) local Le,Ld,Lt,t1,e,d,t; global L;
    t1:=convert(n,base,10); e:=0; d:=0; t:=nops(t1);
    for i from 1 to t do if (t1[i] mod 2) = 0 then e:=e+1; else d:=d+1; fi; od:
    Le:=L(e); Ld:=L(d); Lt:=L(t);
    if e=0 then 10^Lt*d+t
    elif d=0 then 10^(Ld+Lt)*e+10^Lt*d+t
    else 10^(Ld+Lt)*e+10^Lt*d+t; fi;
    end;
    [seq(S(n),n=1..200)]; # N. J. A. Sloane, Jun 25 2018
    # alternative Maple program:
    a:= n-> (l-> (e-> parse(cat(e, (h-> [h-e, h][])(nops(l))))
        )(nops(select(x-> x::even, l))))(convert(n, base, 10)):
    seq(a(n), n=0..200);  # Alois P. Heinz, Jan 21 2022
  • Mathematica
    f[n_] := Block[{id = IntegerDigits[n]}, FromDigits[ Join[ IntegerDigits[ Length[ Select[id, EvenQ[ # ] &]]], IntegerDigits[ Length[ Select[id, OddQ[ # ] &]]], IntegerDigits[ Length[ id]] ]]]; Table[ f[n], {n, 0, 55}] (* Robert G. Wilson v, Jun 09 2005 *)
    s={};Do[id=IntegerDigits[n];ev=Select[id, EvenQ];ne=Select[id, OddQ];fd=FromDigits[{Length[ev], Length[ne], Length[id]}]; s=Append[s, fd], {n, 81}];SameQ[newA073053-s] (* Zak Seidov *)
    deneat[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[Flatten[ IntegerDigits/@ {Count[ idn,?EvenQ],Count[ idn,?OddQ],Length[ idn]}]]] Array[ deneat,60,0]// Flatten (* Harvey P. Dale, Aug 13 2021 *)
  • 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)-e) + str(len(s)))
    print([a(n) for n in range(54)]) # Michael S. Branicky, Jan 21 2022

Extensions

Edited and corrected by Jason Earls and Robert G. Wilson v, Jun 03 2005
a(0) added by N. J. A. Sloane, May 12 2019

A100961 For a decimal string s, let f(s) = decimal string ijk, where i = number of even digits in s, j = number of odd digits in s, k=i+j (see A171797). Start with s = decimal expansion of n; a(n) = number of applications of f needed to reach the string 123.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2
Offset: 0

Views

Author

N. J. A. Sloane, Jun 17 2005

Keywords

Comments

Obviously if the digits of m and n have the same parity then a(m) = a(n). E.g. a(334) = a(110). In other words, a(n) = a(A065031(n)).
It is easy to show that (i) the trajectory of every number under f eventually reaches 123 (if s has more than three digits then f(s) has fewer digits than s) and (ii) since each string ijk has only finitely many preimages, a(n) is unbounded.

Examples

			n=0: s=0 -> f(s) = 101 -> f(f(s)) = 123, stop, a(0) = 2.
n=1: s=1 => f(s) = 011 -> f(f(s)) = 123, stop, f(1) = 2.
		

Crossrefs

A073054 gives another version. f(n) is (essentially) A171797 or A073053.

Extensions

More terms from Zak Seidov, Jun 18 2005

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).

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2019

Keywords

Comments

If we start with n and repeatedly apply the map i -> a(i), we eventually reach 132 (see A073054).

Examples

			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.
		

References

  • M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.

Crossrefs

A073054 gives steps to reach 132.

Programs

  • Maple
    # Maple code based on R. J. Mathar's code for 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:
    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:
    seq(A308003(n),n=0..80) ;
  • 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))
    print([a(n) for n in range(55)]) # Michael S. Branicky, Mar 29 2022

A308004 a(n) = smallest nonnegative number that requires n applications of the Sisyphus function x -> A073053(x) to reach 123.

Original entry on oeis.org

123, 101, 0, 20, 11, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2019

Keywords

Comments

a(n) = index of first n in A073054.
a(6) is currently unknown.

Examples

			0 -> 101 -> 123 reaches 123 in two steps, so a(2) = 0.
1 -> 11 -> 22 -> 202 -> 303 -> 123 reaches 123 in 5 steps, so a(5) = 1.
		

References

  • M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.

Crossrefs

Programs

  • Mathematica
    id[n_]:=IntegerDigits[n]; il[n_]:=If[n!=0,IntegerLength[n],1]
    den[n_]:=FromDigits[{Length[Select[id[n],EvenQ]],Length[Select[id[n],OddQ]],il[n]}]; numD[n_]:=Length[FixedPointList[den,n]]-2;
    a308004[n_]:=Module[{k=0},While[numD[k]!=n,k++];k];
    a308004/@Range[0,5] (* Ivan N. Ianakiev, May 13 2019 *)

A308125 Numbers k that are a multiple of the DENEAT operator applied to k (A073053).

Original entry on oeis.org

0, 22, 44, 66, 88, 123, 264, 369, 462, 615, 660, 738, 759, 852, 957, 1120, 1344, 1568, 1884, 2024, 2068, 2200, 2244, 2288, 2420, 2464, 2640, 2684, 2860, 2912, 3350, 3360, 3584, 3752, 4004, 4048, 4224, 4268, 4400, 4444, 4488, 4620, 4664, 4840, 4884, 5024, 6028, 6204
Offset: 0

Views

Author

Paolo P. Lava, May 14 2019

Keywords

Comments

The DENEAT operator is also known as the Sisyphus function.
On the other hand, the sequence of numbers k such that DENEAT(k) is a multiple of k, is the finite sequence {1, 11, 14, 16, 22, 56, 123}.

Examples

			2912 / DENEAT(2912) = 2912 / 224 = 13.
		

References

  • J. Schram, The Sisyphus string, J. Rec. Math., 19:1 (1987), 43-44.

Crossrefs

Programs

  • Maple
    P:=proc(n) local a,b,c,d,k; a:=convert(n,base,10); b:=0: c:=0:
    for k from 1 to nops(a) do if a[k] mod 2=0 then b:=b+1; else c:=c+1; fi;
    od: d:=b*10^length(c)+c; a:=n/(d*10^length(length(n))+length(n)):
    if frac(a)=0 then n; fi; end: 0,seq(P(i),i=1..6204);
Showing 1-5 of 5 results.