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-5 of 5 results.

A122552 a(0)=a(1)=a(2)=1, a(n) = a(n-1) + a(n-2) + 2*a(n-3) for n > 2.

Original entry on oeis.org

1, 1, 1, 4, 7, 13, 28, 55, 109, 220, 439, 877, 1756, 3511, 7021, 14044, 28087, 56173, 112348, 224695, 449389, 898780, 1797559, 3595117, 7190236, 14380471, 28760941, 57521884, 115043767, 230087533, 460175068, 920350135, 1840700269, 3681400540
Offset: 0

Views

Author

Philippe Deléham, Sep 20 2006

Keywords

Comments

Equals INVERT transform of (1, 0, 3, 0, 3, 0, 3, ...). - Gary W. Adamson, Apr 27 2009
No term is divisible by 3. - Vladimir Joseph Stephan Orlovsky, Mar 24 2011
For n > 3, a(n) is the number of quaternary sequences of length n-1 starting with q(0) = 0, in which all triples (q(i), q(i+1), q(i+2)) contain digits 0 and 3; cf. A294627. - Wojciech Florek, Jul 30 2018
For n > 0, a(n) is the number of ways to tile a strip of length n with squares, dominoes, and two colors of trominoes, with the restriction that the first tile cannot be a domino. - Greg Dresden and Bora Bursalı, Aug 31 2023

Examples

			It is shown in A294627 that there are 42 quaternary sequences (i.e., build from four digits 0, 1, 2, 3) and having both 0 and 3 in every (consecutive) triple. Only a(5=4+1) = 13 of them start with 0: 003x, 030x, 03y0, 0y30, 0330, where x = 0, 1, 2, 3 and y = 1, 2.
		

Crossrefs

Cf. A294627.

Programs

  • GAP
    a:=[1,1,1];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+2*a[n-3]; od; a; # Muniru A Asiru, Jul 30 2018
  • Maple
    seq(coeff(series((1-x^2)/(1-x-x^2-2*x^3), x,n+1),x,n),n=0..40); # Muniru A Asiru, Aug 02 2018
  • Mathematica
    LinearRecurrence[{1, 1, 2}, {1, 1, 1}, 40]
    CoefficientList[ Series[(x^2 - 1)/(2x^3 + x^2 + x - 1), {x, 0, 35}], x] (* Robert G. Wilson v, Jul 30 2018 *)
  • PARI
    Vec((1-x^2)/(1-x-x^2-2*x^3)+O(x^99)) \\ Charles R Greathouse IV, Jan 17 2012
    
  • Sage
    from sage.combinat.sloane_functions import recur_gen3; it = recur_gen3(1,1,1,1,1,2); [next(it) for i in range(30)] # Zerinvary Lajos, Jun 25 2008
    

Formula

a(3*n) = 2*a(3*n-1)+2, a(3*n+1) = 2*a(3*n)-1, a(3*n+2) = 2*a(3*n+1)-1, a(0)=1.
G.f.: (1-x^2)/(1-x-x^2-2*x^3).
a(n) = ((-1)^n*A130815(n+2) + 3*2^n)/7. - R. J. Mathar, Nov 30 2008
From Paul Curtz, Oct 02 2009: (Start)
a(n) = A140295(n+2)/4.
a(n+1) - 2a(n) = period 3: repeat -1,-1,2 = -A061347.
a(n) - a(n-1) = 0,0,3,3,6,15,27,54,111,... = 3*A077947.
a(n) - a(n-2) = 0,3,6,9,21,42,81,....
a(n) - a(n-3) = 3,6,12,24,... = A007283 = 3*A000079.
a(3n) + a(3n+1) + a(3n+2) = 3,24,192,... = A103333(n+1) = A140295(3n) + A140295(3n+1) + A140295(3n+2).
See A078010, A139217, A139218. (End)

Extensions

Corrected by T. D. Noe, Nov 01 2006, Nov 07 2006
Typo in definition corrected by Paul Curtz, Oct 02 2009

A207607 Triangle of coefficients of polynomials v(n,x) jointly generated with A207606; see Formula section.

Original entry on oeis.org

1, 1, 2, 1, 5, 2, 1, 9, 9, 2, 1, 14, 25, 13, 2, 1, 20, 55, 49, 17, 2, 1, 27, 105, 140, 81, 21, 2, 1, 35, 182, 336, 285, 121, 25, 2, 1, 44, 294, 714, 825, 506, 169, 29, 2, 1, 54, 450, 1386, 2079, 1716, 819, 225, 33, 2, 1, 65, 660, 2508, 4719, 5005, 3185, 1240, 289, 37, 2
Offset: 1

Views

Author

Clark Kimberling, Feb 19 2012

Keywords

Comments

Subtriangle of the triangle T(n,k) given by (1, 0, 1/2, 1/2, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Mar 03 2012

Examples

			First five rows:
  1;
  1,  2;
  1,  5,  2;
  1,  9,  9,  2;
  1, 14, 25, 13,  2;
Triangle (1, 0, 1/2, 1/2, 0, 0, 0, ...) DELTA (0, 2, -1, 0, 0, 0, 0, ...) begins:
  1;
  1,  0;
  1,  2,  0;
  1,  5,  2,  0;
  1,  9,  9,  2,  0;
  1, 14, 25, 13,  2,  0;
  1, 20, 55, 49, 17,  2,  0;
  ...
1 = 2*1 - 1, 20 = 2*14 + 1 - 9, 55 = 2*25 + 14 - 9, 49 = 2*13 + 25 - 2, 17 = 2*2 + 1 - 0, 2 = 2*0 + 2 - 0. - _Philippe Deléham_, Mar 03 2012
		

Crossrefs

Cf. A207606.

Programs

  • Maple
    A207607:= (n,k) -> `if`(k=1, 1, binomial(n+k-3, 2*k-2) + 2*binomial(n+k-3, 2*k-3) ); seq(seq(A207607(n, k), k = 1..n), n = 1..10); # G. C. Greubel, Mar 15 2020
  • Mathematica
    (* First program *)
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + v[n - 1, x]
    v[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x]
    Table[Factor[u[n, x]], {n, 1, z}]
    Table[Factor[v[n, x]], {n, 1, z}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]  (* A207606 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]  (* A207607 *)
    (* Second program *)
    Table[If[k==1, 1, Binomial[n+k-3, 2*k-2] + 2*Binomial[n+k-3, 2*k-3]], {n, 10}, {k, n}]//Flatten (* G. C. Greubel, Mar 15 2020 *)
  • Python
    from sympy import Poly
    from sympy.abc import x
    def u(n, x): return 1 if n==1 else u(n - 1, x) + v(n - 1, x)
    def v(n, x): return 1 if n==1 else x*u(n - 1, x) + (x + 1)*v(n - 1, x)
    def a(n): return Poly(v(n, x), x).all_coeffs()[::-1]
    for n in range(1, 13): print(a(n)) # Indranil Ghosh, May 28 2017
    
  • Sage
    def T(n, k):
        if k == 1: return 1
        else: return binomial(n+k-3, 2*k-2) + 2*binomial(n+k-3, 2*k-3)
    [[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Mar 15 2020

Formula

u(n,x) = u(n-1,x) + v(n-1,x), v(n,x) = x*u(n-1,x) + (x+1)v(n-1,x), where u(1,x)=1, v(1,x)=1.
T(n,k) = 2*T(n-1,k) + T(n-1,k-1) - T(n-2,k). - Philippe Deléham, Mar 03 2012
G.f.: (1-x+y*x)/(1-(y+2)*x+x^2). - Philippe Deléham, Mar 03 2012
For n >= 1, Sum{k=0..n} T(n,k)*x^k = A000012(n), A001906(n), A001834(n-1), A055271(n-1), A038761(n-1), A056914(n-1) for x = 0, 1, 2, 3, 4, 5 respectively. - Philippe Deléham, Mar 03 2012
T(n,k) = C(n+k-1,2*k) + 2*C(n+k-1,2*k-1). where C is binomial. - Yuchun Ji, May 23 2019
T(n,k) = T(n-1,k) + A207606(n,k-1). - Yuchun Ji, May 28 2019
Sum_{k=1..n} T(n, k)*x^k = { 4*(-1)^(n-1)*A016921(n-1) (x=-4), 3*(-1)^(n-1) * A130815(n-1) (x=-3), 2*(-1)^(n-1)*A010684(n-1) (x=-2), A057079(n+1) (x=-1), 0 (x=0), A001906(n) = Fibonacci(2*n) (x=1), 2*A001834(n-1) (x=2), 3*A055271(n-1) (x=3), 4*A038761(n-1) (x=4) }. - G. C. Greubel, Mar 15 2020

A135446 a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3), with a(0) = a(1) = -1 and a(2) = 3.

Original entry on oeis.org

-1, -1, 3, 10, 19, 33, 62, 125, 255, 514, 1027, 2049, 4094, 8189, 16383, 32770, 65539, 131073, 262142, 524285, 1048575, 2097154, 4194307, 8388609, 16777214, 33554429, 67108863, 134217730, 268435459, 536870913, 1073741822, 2147483645, 4294967295, 8589934594, 17179869187
Offset: 0

Views

Author

Paul Curtz, Dec 13 2007

Keywords

Comments

Sequence identical to its third differences.

Programs

  • Mathematica
    a = {-1, -1, 3}; Do[AppendTo[a, 3*a[[ -1]] - 3*a[[ -2]] + 2*a[[ -3]]], {40}]; a (* Stefan Steinerberger, Dec 22 2007 *)
    LinearRecurrence[{3, -3, 2},{-1, -1, 3},31] (* Ray Chandler, Sep 23 2015 *)

Formula

a(n+1) - 2*a(n) = hexaperiodic 1, 5, 4, -1, -5, -4, A130815.
a(n) = 2^n - 2*cos((Pi*n)/3) - (4*sqrt(3)/3)*sin((Pi*n)/3). Or, a(n) = 2^n + [ -2; -3; -1; 2; 3; 1]. - Richard Choulet, Dec 31 2007
G.f.: (1+x)*(1-3*x) / ( (2*x-1)*(x^2-x+1) ). - R. J. Mathar, Nov 07 2015

A140295 a(n) = a(n-1) + a(n-2) + 2a(n-3).

Original entry on oeis.org

1, -2, 4, 4, 4, 16, 28, 52, 112, 220, 436, 880, 1756, 3508, 7024, 14044, 28084, 56176, 112348, 224692, 449392, 898780, 1797556, 3595120, 7190236, 14380468, 28760944, 57521884, 115043764, 230087536, 460175068, 920350132, 1840700272, 3681400540
Offset: 0

Views

Author

Paul Curtz, May 25 2008

Keywords

Formula

a(n+1) - 2a(n) = period 3: repeat -4, 8, -4.
G.f.: (1-3x+5x^2)/((1-2x)(1+x+x^2)). a(n)=(4*k(n)+3*2^n)/7 where k(n) is the 3-period sequence 1,-5,4,... reminiscent to A130815. [From R. J. Mathar, Oct 30 2008]

A188124 Number of strictly increasing arrangements of 5 nonzero numbers in -(n+3)..(n+3) with sum zero.

Original entry on oeis.org

0, 4, 16, 42, 90, 172, 296, 482, 740, 1092, 1554, 2154, 2906, 3846, 4992, 6382, 8038, 10004, 12302, 14984, 18074, 21626, 25670, 30266, 35442, 41266, 47770, 55024, 63064, 71966, 81766, 92548, 104350, 117258, 131316, 146616, 163200, 181168, 200566
Offset: 0

Views

Author

R. H. Hardin, Mar 21 2011

Keywords

Comments

Row 5 of A188122.

Examples

			4*x + 16*x^2 + 42*x^3 + 90*x^4 + 172*x^5 + 296*x^6 + 482*x^7 + 740*x^8 + ...
Some solutions for n=6
.-7...-7...-6...-7...-8...-8...-4...-9...-7...-5...-6...-4...-6...-9...-7...-5
.-5...-5...-4...-6...-6...-2...-3...-5...-5...-4...-3...-3...-3...-5...-4...-3
..1....2....2....2....1...-1...-2....1...-4...-2...-2...-2....1....2...-2....1
..5....3....3....5....4....4....4....5....7....4....4....1....2....5....6....3
..6....7....5....6....9....7....5....8....9....7....7....8....6....7....7....4
		

Programs

  • PARI
    {a(n) = local(v, c, m); m = n+3; forvec( v = vector( 5, i, [-m, m]), if( 0==prod( k=1, 5, v[k]), next); if( 0==sum( k=1, 5, v[k]), c++), 2); c} /* Michael Somos, Apr 11 2011 */

Formula

Empirical: a(n)=2*a(n-1)-a(n-3)-2*a(n-5)+2*a(n-6)+a(n-8)-2*a(n-10)+a(n-11) = 269/1728 +235*n^2/144 +161*n/96 +23*n^4/288 +83*n^3/144 +(-1)^n*(1/64-3*n/32) -2*(-1)^n*A130815(n+2)/27 +A057077(n+1)/8.
Empirical: G.f. -2*x*(2+4*x+5*x^2+5*x^3+4*x^4+x^5+2*x^6) / ( (x^2+1)*(1+x+x^2)*(1+x)^2*(x-1)^5 ). - R. J. Mathar, Mar 21 2011
Showing 1-5 of 5 results.