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 30 results. Next

A043307 a(n) = A033001(n)/4.

Original entry on oeis.org

1, 2, 9, 11, 18, 19, 82, 83, 99, 100, 163, 164, 171, 173, 738, 740, 747, 748, 892, 893, 900, 902, 1467, 1469, 1476, 1477, 1540, 1541, 1557, 1558, 6643, 6644, 6660, 6661, 6724, 6725, 6732, 6734, 8028, 8030, 8037, 8038, 8101, 8102, 8118, 8119
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 9, have only digits 0, 1 or 2, and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • Maple
    A[1]:= [1,2]:
    for d from 2 to 6 do
      A[d]:= map(t -> seq(9*t+j,j=subs(t mod 9 = NULL, [0,1,2])), A[d-1])
    od:
    seq(op(A[d]),d=1..6); # Robert Israel, Jan 29 2017
  • Mathematica
    Table[FromDigits[#,9]&/@Select[Tuples[{0,1,2},n],Min[Abs[Differences[#]]]>0&],{n,2,5}]// Flatten// Union (* Harvey P. Dale, May 27 2023 *)
  • PARI
    is_A043307(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],9))[2]<3 && n[1]%3!=n[2])||return) \\ M. F. Hasler, Feb 03 2014
    
  • PARI
    a(n) = my(v=binary(n+1)); v[1]=0; for(i=2,#v, v[i]+=(v[i]>=v[i-1])); fromdigits(v,9); \\ Kevin Ryde, Mar 13 2021

Formula

From Robert Israel, Jan 29 2017: (Start)
If a(n) == 0 (mod 3) then a(2*n+1) = 9*a(n) + 1 else a(2*n+1) = 9*a(n).
If a(n) == 2 (mod 3) then a(2*n+2) = 9*a(n) + 1 else a(2*n+1) = 9*a(n)+2.
a(4k+5) = 9*a(2k+2).
(End)

A043291 Every run length in base 2 is 2.

Original entry on oeis.org

3, 12, 51, 204, 819, 3276, 13107, 52428, 209715, 838860, 3355443, 13421772, 53687091, 214748364, 858993459, 3435973836, 13743895347, 54975581388, 219902325555, 879609302220, 3518437208883, 14073748835532, 56294995342131, 225179981368524, 900719925474099
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number whose binary representation is A153435(n). - Omar E. Pol, Jan 18 2009
See A033001 and following for the analog in other bases and the variant with runs of length >= 2. - M. F. Hasler, Feb 01 2014

Crossrefs

Cf. A153435 (binary).
Bisections: A108020, A182512. Bisection of A077854.

Programs

  • Magma
    [Floor(4^(n+1)/5): n in [1..30]]; // Vincenzo Librandi, Jun 26 2011
    
  • Maple
    seq(floor(4^(n+1)/5),n=1..25); # Mircea Merca, Dec 26 2010
  • Mathematica
    f[n_] := Floor[4^(n + 1)/5]; Array[f, 23] (* or *)
    a[1] = 3; a[2] = 12; a[3] = 51; a[n_] := a[n] = 4 a[n - 1] + a[n - 2] - 4 a[n - 3]; Array[a, 23] (* or *)
    3 LinearRecurrence[{4, 1, -4}, {1, 4, 17}, 23] (* Robert G. Wilson v, Jul 01 2014 *)
  • PARI
    A043291 = n->4^(n+1)\5 \\ M. F. Hasler, Feb 01 2014
    
  • Python
    def a(n): return int(''.join([['11', '00'][i%2] for i in range(n)]), 2)
    print([a(n) for n in range(1, 26)]) # Michael S. Branicky, Mar 12 2021

Formula

a(n) = 4*a(n-1)+a(n-2)-4*a(n-3), n>3. - John W. Layman, Feb 01 2000
a(n) = floor(4^(n+1)/5). - Mircea Merca, Dec 26 2010
G.f.: 3*x / ( (x-1)*(4*x-1)*(1+x) ). - Joerg Arndt, Jan 08 2011
a(n) = 3*A033114(n). - R. J. Mathar, Jan 08 2011

A033014 Every run of digits of n in base 16 has length 2.

Original entry on oeis.org

17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 4352, 4386, 4403, 4420, 4437, 4454, 4471, 4488, 4505, 4522, 4539, 4556, 4573, 4590, 4607, 8704, 8721, 8755, 8772, 8789, 8806, 8823, 8840, 8857, 8874
Offset: 1

Views

Author

Keywords

Examples

			In base 16, a(1)=17 is written 11; the subsequent 14 values are the multiples of 17, corresponding to 22, 33, 44, ..., FF.
This is followed by a(16) = 4352 = 1100[16], then (still in base 16): 1122, 1133,..., 11FF, 2200, 2211, 2233, etc...
		

Crossrefs

See A033001 for further cross-references.

Programs

  • Mathematica
    Select[Range[9000],Union[Length/@Split[IntegerDigits[#,16]]]=={2}&] (* Harvey P. Dale, Jan 19 2013 *)
  • Python
    from itertools import count, islice, groupby
    def A033014_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:set(len(list(g)) for k, g in groupby(hex(n)[2:]))=={2},count(max(startvalue,1)))
    A033014_list = list(islice(A033014_gen(),20)) # Chai Wah Wu, Mar 10 2023

Formula

a(n) = 17*A043320(n) (= 17n for n<16, cf Example). - M. F. Hasler, Feb 02 2014

A033015 Numbers whose base-2 expansion has no run of digits with length < 2.

Original entry on oeis.org

3, 7, 12, 15, 24, 28, 31, 48, 51, 56, 60, 63, 96, 99, 103, 112, 115, 120, 124, 127, 192, 195, 199, 204, 207, 224, 227, 231, 240, 243, 248, 252, 255, 384, 387, 391, 396, 399, 408, 412, 415, 448, 451, 455, 460, 463, 480, 483, 487, 496, 499, 504, 508, 511, 768
Offset: 1

Views

Author

Keywords

Comments

See A033016 and following for the variants in other bases, A043291 for run lengths equal to 2 (which has a very simple formula) and A033001 and following for the analog of the latter in other bases. - M. F. Hasler, Feb 01 2014
The number zero also satisfies the definition if we consider that its base-2 expansion is empty. - M. F. Hasler, Oct 06 2022
If we define row n as subset of terms with n bits, i.e., 2^(n-1) < a(k) < 2^n, then we get row n by duplicating the last bit (LSB) of the terms in row n-1 and appending twice the negated LSB to the terms in row n-2. This gives the FORMULA for the number of terms in row n. - M. F. Hasler, Oct 17 2022

Examples

			The first terms, written in binary, are: 11, 111, 1100, 1111, 11000, 11100, 11111, 110000, 110011, ...; cf. sequence A355280. - _M. F. Hasler_, Oct 06 2022
		

Crossrefs

Cf. A355280 (in binary).
Cf. A222813 (palindromes subsequence).
See A033001 for further cross-references.

Programs

  • Mathematica
    Select[Range[2000], Min[Length/@Split[IntegerDigits[#, 2]]]>1&] (* Vincenzo Librandi, Feb 05 2014 *)
  • PARI
    is(n)=my(t); if(n%2, t=valuation(n+1,2); if(t==1,return(0)); n>>=t); while(n, t=valuation(n,2); if(t==1,return(0)); n>>=t; t=valuation(n+1,2); if(t==1,return(0)); n>>=t); 1 \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    select( is_A033015(n)=!bitand(n=bitxor(n,n<<1),n<<1)&&bitand(n,3)!=2, [1..770]) \\ M. F. Hasler, Oct 06 2022 (replacing less efficient code from 2014)
    
  • PARI
    {A033015_row(n)=if(n>3, setunion([x*2+x%2|x<-A033015_row(n-1)], [x*4+3-x%2*3|x<-A033015_row(n-2)]), n>1, [2^n-1], [])} \\ "Row" of n-digit terms. For (very) large n one could use memoization rather than this naive recursive definition.
    concat(apply(A033015_row, [1..9])) \\ To get the "flattened" sequence. - M. F. Hasler, Oct 17 2022
    
  • Python
    from itertools import groupby
    def ok(n): return all(len(list(g)) >= 2 for k, g in groupby(bin(n)[2:]))
    print([i for i in range(1, 769) if ok(i)]) # Michael S. Branicky, Jan 04 2021
    
  • Python
    def A033015_row(n): # terms with n bits <=> in [2^(n-1) .. 2^n]
        return [[], [], [3], [7]][n] if n < 4 else sorted(
        [x*2+x%2 for x in A033015_row(n-1)] +
        [x*4+3-x%2*3 for x in A033015_row(n-2)]) # M. F. Hasler, Oct 17 2022
    print(sum((A033015_row(n)for n in range(11)),[]))

Formula

The number of n-bit terms is Fibonacci(n-1) = A000045(n-1). - M. F. Hasler, Oct 17 2022

Extensions

Extended by Ray Chandler, Dec 18 2009

A033016 Numbers whose base-3 expansion has no run of digits with length < 2.

Original entry on oeis.org

4, 8, 13, 26, 36, 40, 44, 72, 76, 80, 108, 117, 121, 125, 134, 216, 229, 234, 238, 242, 324, 328, 332, 351, 360, 364, 368, 377, 396, 400, 404, 648, 652, 656, 684, 688, 692, 702, 715, 720, 724, 728, 972, 976, 980, 985, 998, 1053
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007089. Supersequence of A033001.

Programs

  • Mathematica
    Select[Range[10000], Min[Length/@Split[IntegerDigits[#, 3]]]>1&] (* Vincenzo Librandi, Feb 05 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

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 30 results. Next