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-8 of 8 results.

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 15 2010

Keywords

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

Examples

			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.
		

References

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

Crossrefs

Cf. A073053 (Sisyphus), A171798, A171813, A055642, A196563, A196564, A308002, A308003 (another version).
A100961 gives steps to reach 312.

Programs

  • Haskell
    a171797 n = read $ concatMap (show . ($ n))
                       [a055642, a196563, a196564] :: Integer
    -- Reinhard Zumkeller, Feb 22 2012, Oct 15 2010
    
  • 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
  • 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

Extensions

More terms from R. J. Mathar, Oct 15 2010
a(0) added by N. J. A. Sloane, May 12 2019

A171798 a(n) = base-10 concatenation XYZ, where X = number of bits in binary expansion of n, Y = number of 0's, Z = number of 1's.

Original entry on oeis.org

101, 211, 202, 321, 312, 312, 303, 431, 422, 422, 413, 422, 413, 413, 404, 541, 532, 532, 523, 532, 523, 523, 514, 532, 523, 523, 514, 523, 514, 514, 505, 651, 642, 642, 633, 642, 633, 633, 624, 642, 633, 633, 624, 633, 624, 624, 615, 642, 633, 633, 624
Offset: 1

Views

Author

N. J. A. Sloane, Oct 15 2010, Oct 16 2010

Keywords

Comments

Start with n, repeatedly apply the map i -> a(i). Then every n converges to one of 1019, 1147, 1165 or 14311 (cf. A171813). Proof: this is true by direct calculation for n=1..2^14. For larger n, a(n) < n.

Examples

			14 = 1110 in base 2, so X=4, Y=1, Z=3, a(14)=413.
		

Crossrefs

Programs

  • Haskell
    a171798 n = read $ concatMap (show . ($ n))
                       [a070939, a023416, a000120] :: Integer
    -- Reinhard Zumkeller, Feb 22 2012
    
  • Maple
    # Maple code for trajectories of numbers from 1 to M:
    F:=proc(n) local s,t1,t2; t1:=convert(n,base,2); t2:=nops(t1); s:=add(t1[i],i=1..t2);
    parse(cat(t2,t2-s,s)); end;
    M:=16384;
    for n from 1 to M do t3:=F(n); sw:=-1;
    for i from 1 to 10 do
    if (t3 = 1147) or (t3 = 1165) or (t3 = 1019) or (t3 = 14311) then sw:=1; break; fi;
    t3:=F(t3);
    od;
    if sw < 0 then lprint(n); fi;
    od:
    Contribution from R. J. Mathar, Oct 15 2010: (Start)
    read("transforms") ; cat2 := proc(a,b) dgsb := max(1,ilog10(b)+1) ; a*10^dgsb+b ; end proc:
    catL := proc(L) local a; a := op(1,L) ; for i from 2 to nops(L) do a := cat2(a,op(i,L)) ; end do; a; end proc:
    A070939 := proc(n) max(1,ilog2(n)+1) ; end proc:
    A171798 := proc(n) local n1,n3 ; n1 := A070939(n) ; n3 := wt(n) ; catL([n1,n1-n3,n3]) ; end proc:
    seq(A171798(n),n=1..80) ; (End)
  • Mathematica
    ans[n_]:=Module[{idn2=IntegerDigits[n,2]},FromDigits[{Length[idn2],Count[idn2,0],Count[idn2,1]}]]; Table[ans[i], {i, 50}] (* Harvey P. Dale, Nov 06 2010 *)
  • Python
    def a(n):
        b = bin(n)[2:]
        z = b.count("0")
        return int(str(len(b)) + str(z) + str(len(b)-z))
    print([a(n) for n in range(1, 52)]) # Michael S. Branicky, Mar 28 2022

Extensions

More terms from R. J. Mathar, Oct 15 2010

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

A350709 Modified Sisyphus function of order 3: a(n) is the concatenation of (number of digits of n)(number digits of n congruent to 0 modulo 3)(number of digits of n congruent to 1 modulo 3)(number of digits of n congruent to 2 modulo 3).

Original entry on oeis.org

1100, 1010, 1001, 1100, 1010, 1001, 1100, 1010, 1001, 1100, 2110, 2020, 2011, 2110, 2020, 2011, 2110, 2020, 2011, 2110, 2101, 2011, 2002, 2101, 2011, 2002, 2101, 2011, 2002, 2101, 2200, 2110, 2101, 2200, 2110, 2101, 2200
Offset: 0

Views

Author

Keywords

Comments

If we start with n and repeatedly apply the map i -> a(i), we eventually get the cycle {4031, 4112, 4220}

Examples

			11 has two digits, both congruent to 1 modulo 3, so a(11) = 2020.
a(20) = 2101.
a(30) = 2200.
a(1111123567) = 10262.
		

References

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

Crossrefs

Programs

  • Python
    def a(n):
        d, m = list(map(int, str(n))), [0, 0, 0]
        for di in d: m[di%3] += 1
        return int(str(len(d)) + "".join(map(str, m)))
    print([a(n) for n in range(37)]) # Michael S. Branicky, Mar 28 2022

A171823 a(n) = base-2 concatenation XYZ, where X = number of bits in binary expansion of n, Y = number of 0's, Z = number of 1's.

Original entry on oeis.org

101, 1011, 10010, 11101, 11110, 11110, 11011, 100111, 1001010, 1001010, 100111, 1001010, 100111, 100111, 1000100, 1011001, 1011110, 1011110, 1011011, 1011110, 1011011, 1011011, 1011100, 1011110, 1011011, 1011011, 1011100, 1011011, 1011100, 1011100
Offset: 1

Views

Author

N. J. A. Sloane, Oct 16 2010

Keywords

Examples

			14 = 1110 in base 2, so X = 4 = 100, Y = 1, Z = 3 = 11, a(14) = 100.1.11 = 100111.
		

Crossrefs

Programs

  • Maple
    F:=proc(n) local t1,t2,t2b,n1,n1b,n0,n0b,t3,t4;
    t1:=convert(n,base,2);
    t2:=nops(t1);
    t2b:=convert(t2,base,2);
    n1:=add(t1[i],i=1..t2);
    n1b:=convert(n1,base,2);
    n0:=t2-n1;
    n0b:=convert(n0,base,2);
    t3:=[
    seq(t2b[nops(t2b)+1-i],i=1..nops(t2b)),
    seq(n0b[nops(n0b)+1-i],i=1..nops(n0b)),
    seq(n1b[nops(n1b)+1-i],i=1..nops(n1b))
    ];
    t4:="";
    for i from 1 to nops(t3) do t4:=cat(t4,t3[i]); od:
    parse(t4);
    end;
  • Mathematica
    a[n_] := IntegerDigits[{z, y} = DigitCount[n, 2]; {y+z, y, z}, 2] // Flatten // FromDigits; Array[a, 30] (* Jean-François Alcover, Oct 20 2016 *)

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

Original entry on oeis.org

11, 110, 11, 110, 11, 110, 11, 110, 11, 110, 121, 220, 121, 220, 121, 220, 121, 220, 121, 220, 22, 121, 22, 121, 22, 121, 22, 121, 22, 121, 121, 220, 121, 220, 121, 220, 121, 220, 121, 220, 22, 121, 22, 121, 22, 121, 22, 121, 22, 121, 121, 220, 121, 220, 121, 220, 121, 220, 121, 220, 22, 121, 22, 121, 22
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), it appears that we eventually reach one of the two fixed points 22 or 231, or enter the two-cycle (33, 220). Are there any other possibilities? This is in contrast to the behavior of the closely related A308003.

Examples

			11 has 2 digits, both odd, so a(11)=220.
12 has 2 digits, one even and one odd, so a(12)=121. Then a(121) = 231, a fixed point.
22 has two digits, both even, so 22 -> 22, another fixed point  (leading zeros are omitted).
		

References

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

Crossrefs

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:
    A308005 := proc(n) local n1, n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n1-n2, n1, n2]) ; end proc:
    [seq(A308005(n), n=0..80)];

A375208 Modified Sisyphus function of order 5.

Original entry on oeis.org

110000, 101000, 100100, 100010, 100001, 110000, 101000, 100100, 100010, 100001, 211000, 202000, 201100, 201010, 201001, 211000, 202000, 201100, 201010, 201001, 210100, 201100, 200200, 200110, 200101, 210100, 201100, 200200, 200110, 200101, 210010, 201010, 200110, 200020, 200011, 210010, 201010, 200110, 200020, 200011, 210001, 201001, 200101, 200011, 200002
Offset: 0

Views

Author

Matt Coppenbarger, Oct 16 2024

Keywords

Comments

a(n) is the concatenation of the number of digits in n with number of digits of n congruent to k modulo 5 for each k from 0 to 4 in turn. See Example.
If we start with n and repeatedly apply the map i -> a(i), we eventually get the cycle {613200, 622110}.

Examples

			11 has two digits, both congruent to 1 modulo 5, so a(11) = 202000.
a(20) = 210100.
a(30) = 210010.
a(2527200000) = 1060400.
		

Crossrefs

Programs

  • Maple
    a:= n-> (l-> parse(cat(nops(l), seq(add(`if`(irem(i, 5)=k
              , 1, 0), i=l), k=0..4))))(convert(n, base, 10)):
    seq(a(n), n=0..44);  # Alois P. Heinz, Oct 23 2024
  • Python
    # based on Michael S. Branicky in A350709
    def a(n, order=5):
        d, m = list(map(int, str(n))), [0]*order
        for di in d: m[di%order] += 1
        return int(str(len(d)) + "".join(map(str, m)))
    print([a(n) for n in range(37)])
    
  • Python
    from collections import Counter
    def A375208(n):
        s = str(n)
        c = Counter(int(d)%5 for d in s)
        return int(str(len(s))+''.join(str(c[i]) for i in range(5))) # Chai Wah Wu, Nov 26 2024

A352751 Modified Sisyphus function of order 4: a(n) is the concatenation of (number of digits of n)(number digits of n congruent to 0 modulo 4)(number of digits of n congruent to 1 modulo 4)(number of digits of n congruent to 2 modulo 4)(number of digits of n congruent to 3 modulo 4).

Original entry on oeis.org

11000, 10100, 10010, 10001, 11000, 10100, 10010, 10001, 11000, 10100, 21100, 20200, 20110, 20101, 21100, 20200, 20110, 20101, 21100, 20200, 21010, 20110, 20020, 20011, 21010, 20110, 20020, 20011, 21010, 20110, 21001, 20101, 20011, 20002, 21001, 20101, 20011, 20002, 21001, 20101, 22000, 21100, 21010
Offset: 0

Views

Author

Keywords

Comments

If we start with n and repeatedly apply the map i -> a(i), we eventually get one of three cycles: {51220}, {50410, 52111, 53200}, or {51301}

Examples

			11 has two digits, both congruent to 1 modulo 4, so a(11) = 20200.
a(20) = 21010.
a(30) = 21001.
a(1111123567) = 100622.
		

References

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

Crossrefs

Programs

  • Python
    def a(n, order=4):
        d, m = list(map(int, str(n))), [0]*order
        for di in d: m[di%order] += 1
        return int(str(len(d)) + "".join(map(str, m)))
    print([a(n) for n in range(37)]) # Michael S. Branicky, Apr 01 2022
Showing 1-8 of 8 results.