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 10 results.

A084213 Binomial transform of A081250.

Original entry on oeis.org

1, 4, 18, 76, 312, 1264, 5088, 20416, 81792, 327424, 1310208, 5241856, 20969472, 83881984, 335536128, 1342160896, 5368676352, 21474770944, 85899214848, 343597121536, 1374389010432, 5497557090304, 21990230458368, 87960926027776
Offset: 0

Views

Author

Paul Barry, May 19 2003

Keywords

Comments

When 5*2^n - 1 is prime, that is, n is in A001770, then a(n+1) is in A136539. - Farideh Firoozbakht and M. F. Hasler, Nov 03 2012

Programs

  • Magma
    [5*4^n/4-2^n/2+0^n/4: n in [0..30]]; // Vincenzo Librandi, Jun 15 2011
    
  • Maple
    seq(coeff(series((1-2*x+2*x^2)/((1-2*x)*(1-4*x)),x,n+1), x, n), n = 0 .. 25); # Muniru A Asiru, Oct 09 2018
  • Mathematica
    Table[If[n==0, 1, 2^(n-2)*(5*2^n - 2)], {n,0,30}] (* G. C. Greubel, Oct 08 2018 *)
    CoefficientList[Series[(1 - 2*x + 2*x^2)/((1-2*x)*(1-4*x)), {x, 0, 50}], x] (* or *)
    CoefficientList[Series[(5*Exp[4*x] - 2*Exp[2*x] + 1)/4, {x, 0, 50}], x]*Table[k!, {k, 0, 50}] (* Stefano Spezia, Oct 11 2018 *)
  • PARI
    vector(30, n, n--; (5*4^n - 2^(n+1) + 0^n)/4) \\ G. C. Greubel, Oct 08 2018

Formula

a(n) = (5*4^n - 2^(n+1) + 0^n)/4.
G.f.: (1 - 2*x + 2*x^2)/((1-2*x)*(1-4*x)).
E.g.f.: (5*exp(4*x) - 2*exp(2*x) + 1)/4.
a(n+1) = 2^n*(5*2^n - 1) for all n >= 0. - M. F. Hasler, Nov 03 2012

A081134 Distance to nearest power of 3.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7
Offset: 1

Views

Author

Klaus Brockhaus, Mar 08 2003

Keywords

Examples

			a(7) = 2 since 9 is closest power of 3 to 7 and 9 - 7 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (h-> min(n-h, 3*h-n))(3^ilog[3](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 28 2021
  • Mathematica
    Flatten[Table[Join[Range[0,3^n],Range[3^n-1,1,-1]],{n,0,4}]] (* Harvey P. Dale, Dec 31 2013 *)
  • PARI
    a(n) = my (p=#digits(n,3)); return (min(n-3^(p-1), 3^p-n)) \\ Rémy Sigrist, Mar 24 2018
    
  • Python
    def A081134(n):
        kmin, kmax = 0,1
        while 3**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if 3**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return min(n-3**kmin, 3*3**kmin-n) # Chai Wah Wu, Mar 31 2021

Formula

a(n) = min(n-3^floor(log(n)/log(3)), 3*3^floor(log(n)/log(3))-n).
From Peter Bala, Sep 30 2022: (Start)
a(n) = n - A006166(n); a(n) = 2*n - A003605(n).
a(1) = 0, a(2) = 1, a(3) = 0; thereafter, a(3*n) = 3*a(n), a(3*n+1) = 2*a(n) + a(n+1) and a(3*n+2) = a(n) + 2*a(n+1). (End)

A081251 Numbers n such that A081249(m)/m^2 has a local maximum for m = n.

Original entry on oeis.org

2, 6, 20, 60, 182, 546, 1640, 4920, 14762, 44286, 132860, 398580, 1195742, 3587226, 10761680, 32285040, 96855122, 290565366, 871696100, 2615088300, 7845264902, 23535794706, 70607384120, 211822152360, 635466457082, 1906399371246
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local maxima, lim A081249(n)/n^2 = 1/6. For local minima cf. A081250.
Also the number of different 4- and 3-colorings for the vertices of all triangulated planar polygons on a base with n+2 vertices, if the colors of the two base vertices are fixed. - Patrick Labarque, Mar 23 2010
From Toby Gottfried, Apr 18 2010: (Start)
a(n) = the number of ternary sequences of length n+1 where the numbers of (0's, 1's) are both odd.
A015518 covers the (odd, even) and (even, odd) cases, and A122983 covers (even, even). (End)

Examples

			6 is a term since A081249(5)/5^2 = 4/25 = 0.160, A081249(6)/6^2 = 7/36 = 0.194, A081249(7)/7^2 = 9/49 = 0.184.
		

Crossrefs

Programs

  • GAP
    List([1..30], n-> (9*3^(n-1) -(-1)^n -2)/4); # G. C. Greubel, Jul 14 2019
  • Magma
    [Floor(3^(n+1)/4) : n in [1..30]]; // Vincenzo Librandi, Jun 25 2011
    
  • Maple
    seq(floor(3^(n+1)/4), n=1..30). # Mircea Merca, Dec 27 2010
  • Mathematica
    a[n_]:= Floor[3^(n+1)/4]; Array[a, 30]
    Table[(9*3^(n-1) -(-1)^n -2)/4, {n, 1, 30}] (* G. C. Greubel, Jul 14 2019 *)
  • PARI
    vector(30, n, (9*3^(n-1) -(-1)^n -2)/4) \\ G. C. Greubel, Jul 14 2019
    
  • Sage
    [(9*3^(n-1) -(-1)^n -2)/4 for n in (1..30)] # G. C. Greubel, Jul 14 2019
    

Formula

G.f.: 2/((1-x)*(1+x)*(1-3*x)).
a(n) = a(n-2) + 2*3^(n) for n > 1.
a(n+2) - a(n) = A008776(n).
a(n) = 2*A033113(n+1).
a(2*n+1) = A054880(n+1).
a(n) = floor(3^(n+1)/4). - Mircea Merca, Dec 26 2010
From G. C. Greubel, Jul 14 2019: (Start)
a(n) = (9*3^(n-1) -(-1)^n -2)/4.
E.g.f.: (3*exp(3*x) - 2*exp(x) - exp(-x))/4. (End)

A081249 Partial sums of A081134.

Original entry on oeis.org

0, 1, 1, 2, 4, 7, 9, 10, 10, 11, 13, 16, 20, 25, 31, 38, 46, 55, 63, 70, 76, 81, 85, 88, 90, 91, 91, 92, 94, 97, 101, 106, 112, 119, 127, 136, 146, 157, 169, 182, 196, 211, 227, 244, 262, 281, 301, 322, 344, 367, 391, 416, 442, 469, 495, 520, 544, 567, 589, 610, 630
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Examples

			First seven terms of A081134 are 0,1,0,1,2,3,2, so a(7) = 9.
		

Programs

  • Mathematica
    Accumulate[Flatten[Table[Join[Range[0,3^n],Range[3^n-1,1,-1]],{n,0,4}]]] (* Harvey P. Dale, Sep 21 2016 *)
  • PARI
    {s=0; for(n=1,62,p=3^floor(0.1^25+log(n)/log(3)); print1(s=s+min(n-p,3*p-n),","))}

Formula

a(n) = sum{j=1..n, A081134(j)}.

A209763 Triangle of coefficients of polynomials u(n,x) jointly generated with A209764; see the Formula section.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 3, 9, 13, 8, 4, 15, 31, 35, 16, 5, 23, 61, 97, 85, 32, 6, 33, 107, 219, 279, 203, 64, 7, 45, 173, 433, 717, 761, 469, 128, 8, 59, 263, 779, 1583, 2195, 1991, 1067, 256, 9, 75, 381, 1305, 3141, 5361, 6381, 5049, 2389, 512, 10, 93, 531
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Row n begins with n and ends with 2^(n-1).
Row sums: 1,3,11,33,101,303,911,... A081250
Alternating row sums: 1,-1,1,-1,1,.. A033999
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...2
2...5....4
3...9....13...8
4...15...31...35...16
First three polynomials u(n,x): 1, 1 + 2x, 2 + 5x + 4x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209763 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209764 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A004442 *)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A209764 Triangle of coefficients of polynomials v(n,x) jointly generated with A209763; see the Formula section.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 4, 8, 14, 8, 5, 14, 32, 34, 16, 6, 22, 62, 96, 86, 32, 7, 32, 108, 218, 280, 202, 64, 8, 44, 174, 432, 718, 760, 470, 128, 9, 58, 264, 778, 1584, 2194, 1992, 1066, 256, 10, 74, 382, 1304, 3142, 5360, 6382, 5048, 2390, 512, 11, 92, 532
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Row n begins with n and ends with 2^(n-1).
Row sums: 1,4,11,34,101,304,911,2734,... A060925.
Alternating row sums: 1,0,3,2,5,4,7,6,... A060925.
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
2...2
3...4....4
4...8....14...8
5...14...32...34...16
First three polynomials v(n,x): 1, 2 + 2x , 3 + 4x + 4x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209763 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209764 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A004442*)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A209765 Triangle of coefficients of polynomials u(n,x) jointly generated with A209766; see the Formula section.

Original entry on oeis.org

1, 1, 2, 1, 5, 5, 1, 5, 15, 12, 1, 5, 21, 45, 29, 1, 5, 21, 77, 129, 70, 1, 5, 21, 89, 265, 361, 169, 1, 5, 21, 89, 353, 865, 991, 408, 1, 5, 21, 89, 377, 1325, 2717, 2681, 985, 1, 5, 21, 89, 377, 1549, 4733, 8281, 7169, 2378, 1, 5, 21, 89, 377, 1597, 6125
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Limiting row: F(2+3k), where F=A000045 (Fibonacci numbers)
Coefficient of x^n in u(n,x): 1,2,5,12,.... A000129(n)
Row sums: 1,3,11,33,101,303,911,2733,..... A081250
Alternating row sums: 1,-1,1,-1,1,-1,,..... A033999
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...2
1...5...5
1...5...15...12
1...5...21...45...29
First three polynomials u(n,x): 1, 1 + 2x, 1 + 5x + 5x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + x*v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209765 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209766 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A042963 signed *)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+x*v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A209766 Triangle of coefficients of polynomials v(n,x) jointly generated with A209765; see the Formula section.

Original entry on oeis.org

1, 1, 3, 1, 3, 7, 1, 3, 13, 17, 1, 3, 13, 43, 41, 1, 3, 13, 55, 133, 99, 1, 3, 13, 55, 209, 391, 239, 1, 3, 13, 55, 233, 739, 1113, 577, 1, 3, 13, 55, 233, 939, 2469, 3095, 1393, 1, 3, 13, 55, 233, 987, 3589, 7903, 8457, 3363, 1, 3, 13, 55, 233, 987, 4085
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Limiting row: F(1+3k), where F=A000045 (Fibonacci numbers)
Coefficient of x^n in u(n,x): A001333(n)
Row sums: 1,4,11,34,101,304,... A060925.
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...3
1...3...7
1...3...13...17
1...3...13...43...41
First three polynomials v(n,x): 1, 1 + 3x , 1 + 3x + 7x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + x*v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209765 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209766 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A042963 signed *)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+x*v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A209769 Triangle of coefficients of polynomials u(n,x) jointly generated with A209770; see the Formula section.

Original entry on oeis.org

1, 1, 2, 3, 5, 3, 5, 12, 11, 5, 9, 26, 34, 24, 8, 15, 53, 88, 86, 48, 13, 25, 104, 210, 258, 200, 93, 21, 41, 198, 470, 695, 680, 440, 175, 34, 67, 369, 1007, 1737, 2043, 1671, 929, 323, 55, 109, 676, 2085, 4107, 5625, 5529, 3895, 1901, 587, 89, 177
Offset: 1

Views

Author

Clark Kimberling, Mar 15 2012

Keywords

Comments

Column 1: A001595
Row n ends with F(n+1), where F=A000045 (Fibonacci numbers).
Row sums: 1,3,11,33,101,303,911,2733,... A081250
Alternating row sums: 1,-1,1,-1,1,-1,... A033999
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...2
3...5....3
5...12...11...5
9...26...34...24...8
First three polynomials u(n,x): 1, 1 + 2x, 3 + 5x + 3x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := (x + 1)*u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209769 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209770 *)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=(x+1)*u(n-1,x)+v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A104522 Expansion of (-1+x+3*x^2-x^3)/((x+1)(3*x-1)(x-1)^2).

Original entry on oeis.org

1, 3, 7, 19, 53, 155, 459, 1371, 4105, 12307, 36911, 110723, 332157, 996459, 2989363, 8968075, 26904209, 80712611, 242137815, 726413427, 2179240261, 6537720763, 19613162267, 58839486779, 176518460313, 529555380915, 1588666142719, 4765998428131
Offset: 0

Views

Author

Creighton Dement, Apr 20 2005

Keywords

Comments

A floretion-generated sequence relating to A081250 (Numbers n such that A081249(m)/m^2 has a local minimum for m = n).
Binomial transform starts: 1, 4, 14, 50, 184, 696, 2688, 10528, 41600, 165248, ... - Wesley Ivan Hurt, Sep 12 2014
Floretion Algebra Multiplication Program, FAMP Code: 1famforrokseq[ - .5'j + .5'k - .5j' + .5k' - 'ii' - .5'ij' - .5'ik' - .5'ji' - .5'ki']

Crossrefs

Programs

  • Magma
    [(5*3^n+4*(n+1)-(-1)^n)/8 : n in [0..30]]; // Wesley Ivan Hurt, Sep 12 2014
  • Maple
    A104522:=n->(5*3^n+4*(n+1)-(-1)^n)/8: seq(A104522(n), n=0..30); # Wesley Ivan Hurt, Sep 12 2014
  • Mathematica
    CoefficientList[Series[(-1 + x + 3 x^2 - x^3)/((x + 1) (3*x - 1) (x - 1)^2), {x, 0, 30}], x] (* Wesley Ivan Hurt, Sep 12 2014 *)

Formula

a(n) = (1/8) * (5*3^n + 4*(n+1) - (-1)^n). - Ralf Stephan, Nov 13 2010.
a(n+2) - 2a(n+1) + a(n) = A081250(n+1) - A081250(n).
a(n) = 4*a(n-1)-2*a(n-2)-4*a(n-3)+3*a(n-4). - Wesley Ivan Hurt, Sep 12 2014
Showing 1-10 of 10 results.