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.

A043276 a(n) = maximal run length in base-2 representation of n.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 3, 3, 4, 5, 5, 4, 3, 3, 2, 2, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 3, 3, 4, 5, 5, 4, 3, 3, 2, 2, 2, 3, 3, 2
Offset: 1

Views

Author

Keywords

Comments

First occurrence of k is when n=2^k-1 and there is no last occurrence. - Robert G. Wilson v, Dec 14 2008
Sequences A000975, A037969, A037970, A037971 list numbers for which a(n)=1, a(n)=2, a(n)=3, a(n)=4. - M. F. Hasler, Jul 23 2013
a(n) = max(A101211(n,k): k = 1..A005811(n)). - Reinhard Zumkeller, Dec 16 2013

Crossrefs

Cf. A043277-A043290 for base-3 to base-16 analogs.

Programs

  • Haskell
    a043276 = maximum . a101211_row  -- Reinhard Zumkeller, Dec 16 2013
    
  • Maple
    A043276 := proc(n)
        local a,rl,i ;
        if n > 0 then
            rl := 1 ;
        else
            rl := 0 ;
        end if;
        a := rl ;
        dgs := convert(n,base,2) ;
        for i from 2 to nops(dgs) do
            if op(i,dgs) = op(i-1,dgs) then
                rl := rl+1 ;
                a := max(a,rl) ;
            else
                a := max(a,rl) ;
                rl := 1;
            end if;
        end do:
        a ;
    end proc:
    seq(A043276(n),n=1...80) ; # R. J. Mathar, Jun 04 2021
  • Mathematica
    f[n_] := Max @@ Length /@ Split@IntegerDigits[n, 2]; Array[f, 105] (* Robert G. Wilson v, Dec 14 2008 *)
  • PARI
    A043276(n,b=2)={my(m,c=1);while(n>0,n%b==(n\=b)%b && c++ && next;m=max(m,c);c=1);m} \\ M. F. Hasler, Jul 23 2013
    
  • PARI
    a(n)=my(r,t); while(n, t=valuation(n,2); if(t>r, r=t); n>>=t; t=valuation(n+1,2); if(t>r, r=t); n>>=t); r \\ Charles R Greathouse IV, Nov 02 2016
    
  • Python
    from itertools import groupby
    def A043276(n): return max(len(list(g)) for k, g in groupby(bin(n)[2:])) # Chai Wah Wu, Mar 09 2023

Extensions

More terms from Robert G. Wilson v, Dec 14 2008

A043290 Maximal run length in base 16 representation of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    A043290[n_]:=Max[Map[Length,Split[IntegerDigits[n,16]]]];Array[A043290,100] (* Paolo Xausa, Sep 27 2023 *)
  • PARI
    A043290(n,b=16)={my(m,c=1);while(n>0,n%b==(n\=b)%b && c++ && next;m=max(m,c);c=1);m} \\ Use optional 2nd arg to get sequences A043276 through A043289. - M. F. Hasler, Jul 23 2013
    
  • Python
    from itertools import groupby
    def A043290(n): return max(len(list(g)) for k, g in groupby(hex(n)[2:])) # Chai Wah Wu, Mar 09 2023

Extensions

More terms from Antti Karttunen, Sep 21 2018

A031941 Numbers without consecutive equal base 3 digits.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 15, 16, 19, 20, 21, 23, 30, 32, 33, 34, 46, 47, 48, 50, 57, 59, 60, 61, 64, 65, 69, 70, 91, 92, 96, 97, 100, 101, 102, 104, 138, 140, 141, 142, 145, 146, 150, 151, 172, 173, 177, 178, 181, 182, 183, 185, 192
Offset: 1

Views

Author

Keywords

Comments

Essentially the same as A043089, b.t.w. the initial "0" could be as well included here. Also: numbers n such that A043277(n)=1. - M. F. Hasler, Jul 23 2013

Crossrefs

Cf. A000975 (base-2 analog), A031942 or A043090 (base-4 analog), A031943 or A043091 (base-5 analog), A043092, ..., A043096 (base-6 through base-10 analog).

Programs

  • Mathematica
    Select[Range[200],FreeQ[Differences[IntegerDigits[#,3]],0]&] (* Harvey P. Dale, Mar 03 2024 *)
  • PARI
    for(i=1,199,A043277(i)==1 & print1(i",")) \\ - M. F. Hasler, Jul 23 2013

Formula

A031941 = { n | A043277(n)=1 } = A043089 \ {0}. - M. F. Hasler, Jul 23 2013

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A043287 Maximal run length in base-13 representation of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    A043287[n_]:=Max[Map[Length,Split[IntegerDigits[n,13]]]];Array[A043287,100] (* Paolo Xausa, Sep 27 2023 *)
  • PARI
    A043287(n,b=13)={my(m,c=1);while(n>0,n%b==(n\=b)%b&&c++&&next;m=max(m,c);c=1);m} \\ M. F. Hasler, Jul 23 2013

Extensions

More terms from Antti Karttunen, Sep 21 2018

A043288 Maximal run length in base-14 representation of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    A043288[n_]:=Max[Map[Length,Split[IntegerDigits[n,14]]]];Array[A043288,100] (* Paolo Xausa, Sep 27 2023 *)
  • PARI
    A043288(n,b=14)={my(m,c=1);while(n>0,n%b==(n\=b)%b&&c++&&next;m=max(m,c);c=1);m} \\ M. F. Hasler, Jul 23 2013

Extensions

More terms from Antti Karttunen, Sep 21 2018

A037973 Numbers whose maximal base 3 run length is 2.

Original entry on oeis.org

4, 8, 9, 12, 14, 17, 18, 22, 24, 25, 28, 29, 31, 35, 36, 37, 38, 42, 43, 44, 45, 49, 51, 52, 55, 56, 58, 62, 63, 66, 68, 71, 72, 73, 74, 75, 76, 77, 84, 85, 86, 87, 88, 89, 90, 93, 95, 98, 99, 103, 105, 106, 109, 110, 111
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A043277.

A037974 Numbers whose maximal base-3 run length is 3.

Original entry on oeis.org

13, 26, 27, 39, 41, 53, 54, 67, 78, 79, 82, 83, 94, 107, 108, 117, 118, 119, 123, 124, 125, 134, 135, 148, 159, 160, 163, 164, 175, 188, 189, 201, 203, 215, 216, 229, 234, 235, 236, 237, 238, 239, 246, 247, 248, 249, 250, 251, 256
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A043277.

A037975 Maximal base 3 run length is 4.

Original entry on oeis.org

40, 80, 81, 120, 122, 161, 162, 202, 240, 241, 244, 245, 283, 323, 324, 360, 361, 362, 366, 367, 368, 404, 405, 445, 483, 484, 487, 488, 526, 566, 567, 606, 608, 647, 648, 688, 720, 721, 722, 723, 724, 725, 732, 733, 734, 735
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A043277.
Showing 1-8 of 8 results.