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

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

Original entry on oeis.org

1, 1, 3, 5, 7, 13, 23, 37, 63, 109, 183, 309, 527, 893, 1511, 2565, 4351, 7373, 12503, 21205, 35951, 60957, 103367, 175269, 297183, 503917, 854455, 1448821, 2456655, 4165565, 7063207, 11976517, 20307647, 34434061, 58387095, 99002389
Offset: 0

Views

Author

Keywords

Comments

Equals eigensequence of an infinite lower triangular matrix with 1's in the main diagonal, 0's in the subdiagonal and 2's in the subsubdiagonal (the triangle in the lower section of A155761). - Gary W. Adamson, Jan 28 2009
The operation in the comment of Jan 28 2009 is equivalent to the INVERT transform of (1, 0, 2, 0, 0, 0, ...). - Gary W. Adamson, Jan 21 2017
For n>=1, a(n) equals the number of ternary words of length n-1 having at least 2 zeros between every two successive nonzero letters. - Milan Janjic, Mar 09 2015

References

  • D. E. Daykin and S. J. Tucker, Introduction to Dragon Curves. Unpublished, 1976. See links below for an earlier version.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A077949, A077974. First differences of A003479. Partial sums of A052537. Equals |A077906(n)|+|A077906(n+1)|.

Programs

  • Haskell
    a003229 n = a003229_list !! n
    a003229_list = 1 : 1 : 3 : zipWith (+)
                               (map (* 2) a003229_list) (drop 2 a003229_list)
    -- Reinhard Zumkeller, Jan 01 2014
  • Magma
    I:=[1, 1, 3]; [n le 3 select I[n] else Self(n-1)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 12 2012
    
  • Maple
    seq(add(binomial(n-2*k,k)*2^k,k=0..floor(n/3)),n=1..38); # Zerinvary Lajos, Apr 03 2007
    with(combstruct): SeqSeqSeqL := [T, {T=Sequence(S), S=Sequence(U, card >= 1), U=Sequence(Z, card >=3)}, unlabeled]: seq(count(SeqSeqSeqL, size=n+4), n=0..35); # Zerinvary Lajos, Apr 04 2009
    a := n -> `if`(n<3,[1,1,3][n+1], hypergeom([-n/3, -(1+n)/3, (1-n)/3], [-n/2, -(1+n)/2], -27/2)); seq(simplify(a(n)),n=0..35); # Peter Luschny, Mar 09 2015
  • Mathematica
    LinearRecurrence[{1,0, 2},{1,1,3},40] (* Vincenzo Librandi, Jun 12 2012 *)

Formula

G.f.: (1+2*z^2)/(1-z-2*z^3). - Simon Plouffe in his 1992 dissertation
a(n) = A077949(n+1) = |A077974(n+1)|.
a(n) = u(n+1) - 3*u(n) + 2*u(n-1) where u(i) = A003230(i) [Daykin and Tucker]. - N. J. A. Sloane, Jul 08 2014
a(n) = hypergeom([-n/3,-(1+n)/3,(1-n)/3],[-n/2,-(1+n)/2],-27/2) for n>=3. - Peter Luschny, Mar 09 2015

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

Original entry on oeis.org

1, 1, 1, 3, 5, 7, 13, 23, 37, 63, 109, 183, 309, 527, 893, 1511, 2565, 4351, 7373, 12503, 21205, 35951, 60957, 103367, 175269, 297183, 503917, 854455, 1448821, 2456655, 4165565, 7063207, 11976517, 20307647, 34434061, 58387095, 99002389, 167870511, 284644701
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Row sums of the Riordan array (1, x*(1+2*x^2)). - Paul Barry, Jan 12 2006
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=3, 3*a(n-3) equals the number of 3-colored compositions of n with all parts >=3, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
Number of compositions of n into parts 1 and two sorts of parts 2. - Joerg Arndt, Aug 29 2013
a(n+2) equals the number of words of length n on alphabet {0,1,2}, having at least two zeros between every two successive nonzero letters. - Milan Janjic, Feb 07 2015
Number of pairs of rabbits when there are 2 pairs per litter and offspring reach parenthood after 3 gestation periods; a(n) = a(n-1) + 2*a(n-3), with a(0) = a(1) = a(2) = 1. - Robert FERREOL, Oct 27 2018

Crossrefs

Unsigned version of A077974. Cf. A003229.

Programs

  • GAP
    a:=[1,1,1];; for n in [4..30] do a[n]:=a[n-1]+2*a[n-3]; od; a; # G. C. Greubel, Jun 22 2019
  • Magma
    [n le 3 select 1 else Self(n-1)+2*Self(n-3): n in [1..50]]; // Vincenzo Librandi, Mar 13 2014
    
  • Maple
    a:= n-> (<<1|1|0>, <0|0|1>, <2|0|0>>^n)[1, 1]:
    seq(a(n), n=0..40);  # Alois P. Heinz, Aug 16 2008
  • Mathematica
    CoefficientList[Series[1/(1-x-2*x^3), {x, 0, 50}], x] (* Jean-François Alcover, Mar 11 2014 *)
    LinearRecurrence[{1, 0, 2}, {1, 1, 1}, 50] (* Robert G. Wilson v, Jul 12 2014 *)
  • PARI
    Vec(1/(1-x-2*x^3)+O(x^50)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • Sage
    (1/(1-x-2*x^3)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 22 2019
    

Formula

a(n) = Sum_{k=0..floor(n/2)} C(n-2k, k)*2^k. - Paul Barry, Nov 18 2003
a(n) = Sum_{k=0..n} C(k, floor((n-k)/2))*2^((n-k)/2)*(1+(-1)^(n-k))/2. - Paul Barry, Jan 12 2006
a(n) = term (1,1) in the 3x3 matrix [1,1,0; 0,0,1; 2,0,0]^n. - Alois P. Heinz, Aug 16 2008
G.f.: Q(0)/2, where Q(k) = 1 + 1/(1 - x*(2*k+1 + 2*x^2)/( x*(2*k+2 + 2*x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 29 2013

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

Original entry on oeis.org

1, -2, 2, -4, 8, -12, 20, -36, 60, -100, 172, -292, 492, -836, 1420, -2404, 4076, -6916, 11724, -19876, 33708, -57156, 96908, -164324, 278636, -472452, 801100, -1358372, 2303276, -3905476, 6622220, -11228772, 19039724, -32284164, 54741708, -92821156, 157389484, -266872900
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Crossrefs

Equals 4 * (-1)^n * A003476(n-2), n>2.
First differences of A077974.

Programs

Showing 1-3 of 3 results.