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

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

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)

A048328 Numbers that are repdigits in base 3.

Original entry on oeis.org

0, 1, 2, 4, 8, 13, 26, 40, 80, 121, 242, 364, 728, 1093, 2186, 3280, 6560, 9841, 19682, 29524, 59048, 88573, 177146, 265720, 531440, 797161, 1594322, 2391484, 4782968, 7174453, 14348906, 21523360, 43046720, 64570081, 129140162, 193710244, 387420488, 581130733
Offset: 0

Views

Author

Patrick De Geest, Feb 15 1999

Keywords

Comments

Case for base 2 see A000225: 2^n - 1.
If the sequence b(n) represents the number of paths of length n, n >= 1, starting at node 1 and ending at nodes 1, 2, 3 and 4 on the path graph P_5 then a(n-1) = b(n) - 1. - Johannes W. Meijer, May 29 2010

Crossrefs

Programs

  • Maple
    nmax := 35; a(0) := 0: for n from 1 to nmax do a(2*n) := a(2*n-2) + 2*3^(n-1); od: a(1) := 1: for n from 1 to nmax do a(2*n+1) := 1*a(2*n-1) + 3^n; od: seq(a(n), n=0..nmax);
    # End program 1
    with(GraphTheory): G := PathGraph(5): A:= AdjacencyMatrix(G): nmax := nmax; for n from 1 to nmax+1 do B(n) := A^n; b(n) := add(B(n)[1, k], k=1..4); a1(n-1) := b(n)-1; od: seq(a1(n), n=0..nmax);
    # End program 2
    # From Johannes W. Meijer, May 29 2010, revised Sep 23 2012
    # third Maple program:
    a:= n->(<<0|1>, <-3|4>>^iquo(n, 2, 'r').`if`(r=0, <<0, 2>>, <<1, 4>>))[1, 1]:
    seq (a(n), n=0..60);  # Alois P. Heinz, Sep 23 2012
  • Mathematica
    Rest[FromDigits[#, 3]&/@Flatten[Table[{PadRight[{1}, n, 1], PadRight[{2}, n, 2]}, {n, 0, 20}], 1]] (* Harvey P. Dale, Feb 03 2011 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -3,0,4,0]^n*[0;1;2;4])[1,1] \\ Charles R Greathouse IV, Oct 07 2015

Formula

G.f.: (2*x^2+x)/(1-4*x^2+3*x^4). - Alois P. Heinz, Sep 23 2012
Sum_{n>=1} 1/a(n) = 3 * A214369 = 2.04646050781571420028... - Amiram Eldar, Jan 21 2022
a(n) = (3^(n/2)*(sqrt(3) + 2 - (-1)^n*(sqrt(3) - 2)) - 3 - (-1)^n)/4. - Stefano Spezia, Feb 18 2022

A043308 a(n)=A033002(n)/5.

Original entry on oeis.org

1, 2, 3, 16, 18, 19, 32, 33, 35, 48, 49, 50, 257, 258, 259, 288, 289, 291, 304, 305, 306, 513, 514, 515, 528, 530, 531, 560, 561, 562, 769, 770, 771, 784, 786, 787, 800, 801, 803, 4112, 4114, 4115, 4128, 4129, 4131, 4144, 4145
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 16, have all digits less than 4 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • PARI
    is_A043308(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],16))[2]<4 && n[1]%4!=n[2])||return) \\ M. F. Hasler, Feb 03 2014

A043312 a(n) = A033006(n)/9.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 64, 66, 67, 68, 69, 70, 71, 128, 129, 131, 132, 133, 134, 135, 192, 193, 194, 196, 197, 198, 199, 256, 257, 258, 259, 261, 262, 263, 320, 321, 322, 323, 324, 326, 327, 384, 385, 386, 387, 388, 389, 391, 448, 449
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 64, have only digits 0 through 7, and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • Maple
    f:= proc(n) local i;
          seq(64*n+i, i= subs(n mod 64 = NULL, [$0..7]))
    end proc:
    A:= $1..7: R:= [A]:
    for d from 2 to 3 do
      R:= map(f, R);
      A:= A, op(R);
    od:
    A; # Robert Israel, Jun 11 2019
  • PARI
    is_A043312(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],64))[2]<8 && n[1]%8!=n[2])||return) \\ M. F. Hasler, Feb 03 2014

A043317 a(n)=A033011(n)/14.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 338, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 507, 508, 509, 511, 512, 513, 514, 515, 516, 517, 518, 519, 676, 677, 678
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 169, have all digits less than 13 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • Mathematica
    Select[Range[700],Max[IntegerDigits[#,169]]<13&&SequenceCount[ IntegerDigits[ #,169],{x_,x_}]==0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 07 2018 *)
  • PARI
    is_A043317(n)=(n=[n])&&!until(!n[1],((n=divrem(n,169))[2]<13 && n[2]!=n[1]%13)||return) \\ M. F. Hasler, Feb 03 2014

A043319 a(n)=A033013(n)/16.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 225, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 450, 451, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 675, 676, 677, 679, 680, 681, 682, 683, 684
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 225, have all digits less than 15 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • PARI
    is_A043319(n)=(n=[n])&&!until(!n[1], ((n=divrem(n[1], 225))[2]<15 && n[1]%15!=n[2])||return) \\ M. F. Hasler, Feb 03 2014

A043309 a(n)=A033003(n)/6.

Original entry on oeis.org

1, 2, 3, 4, 25, 27, 28, 29, 50, 51, 53, 54, 75, 76, 77, 79, 100, 101, 102, 103, 626, 627, 628, 629, 675, 676, 678, 679, 700, 701, 702, 704, 725, 726, 727, 728, 1251, 1252, 1253, 1254, 1275, 1277, 1278, 1279, 1325, 1326, 1327, 1329
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 25, have all digits less than 5 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • PARI
    is_A043309(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],25))[2]<5 && n[1]%5!=n[2])||return) \\ M. F. Hasler, Feb 03 2014

A043310 a(n)=A033004(n)/7.

Original entry on oeis.org

1, 2, 3, 4, 5, 36, 38, 39, 40, 41, 72, 73, 75, 76, 77, 108, 109, 110, 112, 113, 144, 145, 146, 147, 149, 180, 181, 182, 183, 184, 1297, 1298, 1299, 1300, 1301, 1368, 1369, 1371, 1372, 1373, 1404, 1405, 1406, 1408, 1409, 1440, 1441, 1442, 1443, 1445, 1476, 1477
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 36, have all digits less than 6 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • PARI
    is_A043310(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],36))[2]<6 && n[1]%6!=n[2])||return) \\ M. F. Hasler, Feb 03 2014

Extensions

Definition corrected by and more terms from Georg Fischer, Mar 04 2021

A043311 a(n)=A033005(n)/8.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 49, 51, 52, 53, 54, 55, 98, 99, 101, 102, 103, 104, 147, 148, 149, 151, 152, 153, 196, 197, 198, 199, 201, 202, 245, 246, 247, 248, 249, 251, 294, 295, 296, 297, 298, 299, 2402, 2403, 2404, 2405, 2406, 2407, 2499
Offset: 1

Views

Author

Keywords

Comments

Numbers which, written in base 49, have only digits 0 through 6 and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • PARI
    is_A043311(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],49))[2]<7 && n[1]%7!=n[2])||return) \\ M. F. Hasler, Feb 03 2014
Showing 1-10 of 15 results. Next