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-10 of 22 results. Next

A175055 a(n) = decimal equivalent of {A033015(n) written in binary, and each run of 0's reduced in length by one digit, and each run of 1's reduced in length by one digit}.

Original entry on oeis.org

1, 3, 2, 7, 4, 6, 15, 8, 5, 12, 14, 31, 16, 9, 11, 24, 13, 28, 30, 63, 32, 17, 19, 10, 23, 48, 25, 27, 56, 29, 60, 62, 127, 64, 33, 35, 18, 39, 20, 22, 47, 96, 49, 51, 26, 55, 112, 57, 59, 120, 61, 124, 126, 255, 128, 65, 67, 34, 71, 36, 38, 79, 40, 21, 44, 46, 95, 192, 97, 99
Offset: 1

Views

Author

Leroy Quet, Dec 08 2009

Keywords

Comments

This is a permutation of the positive integers. Sequence A175056 is its inverse permutation.

Crossrefs

Programs

  • Mathematica
    FromDigits[Join @@ #, 2] & /@ Map[Drop[#, 1] &, Select[Array[Split@ IntegerDigits[#, 2] &, 905], Min[Length /@ #] > 1 &], {2}] (* Michael De Vlieger, Sep 03 2017 *)

Extensions

Extended by Ray Chandler, Dec 18 2009

A033001 Every run of digits of n in base 3 has length 2.

Original entry on oeis.org

4, 8, 36, 44, 72, 76, 328, 332, 396, 400, 652, 656, 684, 692, 2952, 2960, 2988, 2992, 3568, 3572, 3600, 3608, 5868, 5876, 5904, 5908, 6160, 6164, 6228, 6232, 26572, 26576, 26640, 26644, 26896, 26900, 26928, 26936, 32112, 32120
Offset: 1

Views

Author

Keywords

Comments

See A043291 for the base 2 version (which has a very simple formula), A033002 - A033014 for bases 4 through 16, A033015 - A033029 for the variants with runs of length >= 2. - M. F. Hasler, Feb 01 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 3]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)
  • PARI
    is_A033001(n)=!until(!n\=9,bittest(4588304,n%27)||return)
    
  • PARI
    for(n=1,9999,is_A033001(n)&&print1(n",")) \\ (End)
    
  • PARI
    a(n) = my(v=binary(n+1)); v[1]=0; for(i=2,#v, v[i]+=(v[i]>=v[i-1])); 4*fromdigits(v,9); \\ Kevin Ryde, Mar 13 2021

Formula

a(n)=4*A043307(n). - M. F. Hasler, Feb 01 2014

A043320 Numbers which, written in base 256, have all digits less than 16 and no two adjacent digits equal.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 256, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 512, 513, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 768, 769, 770, 772, 773, 774
Offset: 1

Views

Author

Keywords

Comments

Sequence A033014 consists of the numbers that have all base 16 digits repeated *exactly* twice. (This is equivalent to say that the base-256 digits are 0x00, 0x11, 0x22,... or 0xFF, in hex notation, and no two adjacent base-256 digits are equal.) Thus, these numbers are divisible by 0x11 = 17, and the result of the division is a number which has no other base-256 digits than 0x00, 0x01,... or 0x0F, and no two adjacent digits equal. Conversely, it is clear that exactly these numbers are terms of A033014 when multiplied by 17 = 0x11. - M. F. Hasler, Feb 05 2014

Crossrefs

Programs

  • Mathematica
    Select[Range[20000], Union[Length/@Split[IntegerDigits[#, 16]]]=={2}&]/17 (* Vincenzo Librandi, Feb 06 2014 *)
  • PARI
    is_A043320(n)={(n=[n])&&!until(!n[1], ((n=divrem(n[1], 256))[2]<16 && n[1]%16!=n[2])||return)} \\ M. F. Hasler, Feb 03 2014
    
  • Python
    from itertools import count, islice, groupby
    def A043320_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:set(len(list(g)) for k, g in groupby(hex(17*n)[2:]))=={2},count(max(startvalue,1)))
    A043320_list = list(islice(A043320_gen(),20)) # Chai Wah Wu, Mar 10 2023

Formula

a(n) = A033014(n)/17. [This was initially the definition of the sequence. - M. F. Hasler, Feb 03 2014]

Extensions

New definition by M. F. Hasler, Feb 03 2014

A033002 Every run of digits of n in base 4 has length 2.

Original entry on oeis.org

5, 10, 15, 80, 90, 95, 160, 165, 175, 240, 245, 250, 1285, 1290, 1295, 1440, 1445, 1455, 1520, 1525, 1530, 2565, 2570, 2575, 2640, 2650, 2655, 2800, 2805, 2810, 3845, 3850, 3855, 3920, 3930, 3935, 4000, 4005, 4015, 20560
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 04 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 4]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 5*A043308(n) (= 5*n for n<4). - M. F. Hasler, Feb 04 2014

A033008 Every run of digits of n in base 10 has length 2.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 1100, 1122, 1133, 1144, 1155, 1166, 1177, 1188, 1199, 2200, 2211, 2233, 2244, 2255, 2266, 2277, 2288, 2299, 3300, 3311, 3322, 3344, 3355, 3366, 3377, 3388, 3399, 4400, 4411, 4422, 4433
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 10]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 11*A043314(n) (= 11*n for n<10). - M. F. Hasler, Feb 02 2014

A226227 Numbers m such that all lengths of runs of 0's in the binary representation of m are prime numbers.

Original entry on oeis.org

1, 3, 4, 7, 8, 9, 12, 15, 17, 19, 24, 25, 28, 31, 32, 35, 36, 39, 49, 51, 56, 57, 60, 63, 65, 68, 71, 72, 73, 76, 79, 96, 99, 100, 103, 113, 115, 120, 121, 124, 127, 128, 131, 136, 137, 140, 143, 145, 147, 152, 153, 156, 159, 193, 196, 199, 200, 201, 204, 207, 224, 227
Offset: 1

Views

Author

Alex Ratushnyak, May 31 2013

Keywords

Comments

Numbers with no 0's in base 2 (that is, 2^k - 1) are included.

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 runs[] = {0,2,3,5,7,11,13,17,19,23,29,31,37,41,43}, *wr;
    #define MemUSAGE 1ULL<<33
    #define TOP (1ULL<<9)  // <<40 ok if MemUSAGE = 1ULL<<33
    int compare64(const void *p1, const void *p2) {
      if (*(U64*)p1 == *(U64*)p2) return 0;
      return (*(U64*)p1 < *(U64*)p2) ? -1 : 1;
    }
    void rec(U64 bits) {
      for (U64 i = 0, b; (b = bits << runs[i]) < TOP; ++i)
        *wr++ = b, rec(b*2+1);
    }
    int main() {
      U64 *wr0 = (wr = (U64*)malloc(MemUSAGE));
      rec(1);
      //printf("%llu\n", wr-wr0);
      qsort(wr0, wr-wr0, 8, compare64);
      while (wr0
    				
  • Haskell
    import Data.List (group, genericLength)
    a226227 n = a226227_list !! (n-1)
    a226227_list = filter (all (== 1) .
                   map (a010051 . genericLength) .
                       other . tail . reverse . group . a030308_row) [1..]
       where other [] = []; other [x] = [x]; other (x:_:xs) = x : other xs
    -- Reinhard Zumkeller, Jun 05 2013
  • Mathematica
    Select[Range@227, And @@ PrimeQ[(Length /@ Split@ IntegerDigits[#, 2])[[2 ;; ;; 2]]] &] (* Giovanni Resta, Jun 01 2013 *)
    Select[Range[250],AllTrue[Length/@Select[Split[IntegerDigits[#,2]],MemberQ[ #,0]&],PrimeQ]&] (* Harvey P. Dale, Aug 07 2021 *)

A226228 Numbers m such that all lengths of runs of 1's in the binary representation of m are prime numbers.

Original entry on oeis.org

3, 6, 7, 12, 14, 24, 27, 28, 31, 48, 51, 54, 55, 56, 59, 62, 96, 99, 102, 103, 108, 110, 112, 115, 118, 119, 124, 127, 192, 195, 198, 199, 204, 206, 216, 219, 220, 223, 224, 227, 230, 231, 236, 238, 248, 251, 254, 384, 387, 390, 391, 396, 398, 408, 411, 412, 415, 432
Offset: 1

Views

Author

Alex Ratushnyak, May 31 2013

Keywords

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 runs[] = {0,2,3,5,7,11,13,17,19,23,29,31,37,41,43}, *wr;
    #define MemUSAGE 1ULL<<33
    #define TOP (1ULL<<9)  // <<40 ok if MemUSAGE = 1ULL<<33
    int compare64(const void *p1, const void *p2) {
      if (*(U64*)p1 == *(U64*)p2) return 0;
      return (*(U64*)p1 < *(U64*)p2) ? -1 : 1;
    }
    void rec(U64 bits) {
      for (U64 i = 0, b; (b = ((bits*2+1) << runs[i])-1) < TOP; ++i)
        if (b) *wr++ = b, rec(b);
    }
    int main() {
      U64 *wr0 = (wr = (U64*)malloc(MemUSAGE));
      rec(0);
      //printf("%llu\n", wr-wr0);
      qsort(wr0, wr-wr0, 8, compare64);
      while (wr0
    				
  • Haskell
    import Data.List (group, genericLength)
    a226228 n = a226228_list !! (n-1)
    a226228_list = filter (all (== 1) .
                   map (a010051 . genericLength) .
                       other . reverse . group . a030308_row) [1..]
       where other [] = []; other [x] = [x]; other (x:_:xs) = x : other xs
    -- Reinhard Zumkeller, Jun 05 2013
  • Mathematica
    Select[Range@432, And @@ PrimeQ[(Length /@ Split@ IntegerDigits[#, 2])[[;; ;; 2]]] &] (* Giovanni Resta, Jun 01 2013 *)

A226229 Numbers m such that all lengths of runs of digits in base 2 representation of m are primes.

Original entry on oeis.org

3, 7, 12, 24, 28, 31, 51, 56, 96, 99, 103, 115, 124, 127, 199, 204, 224, 227, 231, 248, 384, 387, 396, 408, 412, 415, 455, 460, 499, 508, 775, 792, 796, 799, 819, 824, 896, 899, 908, 920, 924, 927, 992, 995, 999, 1016, 1539, 1548, 1587, 1592, 1632, 1635, 1639, 1651, 1660
Offset: 1

Views

Author

Alex Ratushnyak, May 31 2013

Keywords

Comments

Intersection of A226227 and A226228.
From Emeric Deutsch, Jan 27 2018: (Start)
Also the indices of the compositions having only prime parts. For the definition of the index of a composition see A298644. For example, 387 is in the sequence since its binary form is 110000011 and the parts of the composition [2,5,2] are prime numbers. 540 is not in the sequence since its binary form is 1000011100 and not all the parts of the composition [1,4,3,2] are primes.
The command c(n) from the Maple program yields the composition having index n. (End)

Crossrefs

Programs

  • Haskell
    import Data.List (group, genericLength)
    a226229 n = a226229_list !! (n-1)
    a226229_list = filter
       (all (== 1) . map (a010051 . genericLength) . group . a030308_row) [1..]
    -- Reinhard Zumkeller, Jun 05 2013
  • Maple
    Runs := proc (L) local j, r, i, k: npr: j := 1; r[j] := L[1]: for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1: r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc: RunLengths := proc (L) map(nops, Runs(L)) end proc: c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc: npr := proc (s) local q, j: q := 0: for j to nops(s) do if isprime(s[j]) = true then q := q+1 else  end if end do end proc: A := {}: for n to 1661 do if npr(c(n)) = nops(c(n)) then A := `union`(A, {n}) else  end if end do: A; # most of the Maple program is due to W. Edwin Clark. # Emeric Deutsch, Jan 27 2018
  • Mathematica
    Select[Range@1660, And @@ PrimeQ[Length /@ Split@ IntegerDigits[#, 2]] &] (* Giovanni Resta, Jun 01 2013 *)

A033003 Every run of digits of n in base 5 has length 2.

Original entry on oeis.org

6, 12, 18, 24, 150, 162, 168, 174, 300, 306, 318, 324, 450, 456, 462, 474, 600, 606, 612, 618, 3756, 3762, 3768, 3774, 4050, 4056, 4068, 4074, 4200, 4206, 4212, 4224, 4350, 4356, 4362, 4368, 7506, 7512, 7518, 7524, 7650, 7662
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000],Union[Length/@Split[IntegerDigits[#, 5]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 6*A043309(n) (= 6*n for n<5). - M. F. Hasler, Feb 02 2014

A033007 Every run of digits of n in base 9 has length 2.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 810, 830, 840, 850, 860, 870, 880, 890, 1620, 1630, 1650, 1660, 1670, 1680, 1690, 1700, 2430, 2440, 2450, 2470, 2480, 2490, 2500, 2510, 3240, 3250, 3260, 3270, 3290, 3300, 3310, 3320, 4050
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 9]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 10*A043313(n) (= 10*n for n<9). - M. F. Hasler, Feb 02 2014
Showing 1-10 of 22 results. Next