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

A001835 a(n) = 4*a(n-1) - a(n-2), with a(0) = 1, a(1) = 1.

Original entry on oeis.org

1, 1, 3, 11, 41, 153, 571, 2131, 7953, 29681, 110771, 413403, 1542841, 5757961, 21489003, 80198051, 299303201, 1117014753, 4168755811, 15558008491, 58063278153, 216695104121, 808717138331, 3018173449203, 11263976658481, 42037733184721, 156886956080403, 585510091136891
Offset: 0

Views

Author

Keywords

Comments

See A079935 for another version.
Number of ways of packing a 3 X 2*(n-1) rectangle with dominoes. - David Singmaster.
Equivalently, number of perfect matchings of the P_3 X P_{2(n-1)} lattice graph. - Emeric Deutsch, Dec 28 2004
The terms of this sequence are the positive square roots of the indices of the octagonal numbers (A046184) - Nicholas S. Horne (nairon(AT)loa.com), Dec 13 1999
Terms are the solutions to: 3*x^2 - 2 is a square. - Benoit Cloitre, Apr 07 2002
Gives solutions x > 0 of the equation floor(x*r*floor(x/r)) == floor(x/r*floor(x*r)) where r = 1 + sqrt(3). - Benoit Cloitre, Feb 19 2004
a(n) = L(n-1,4), where L is defined as in A108299; see also A001834 for L(n,-4). - Reinhard Zumkeller, Jun 01 2005
Values x + y, where (x, y) solves for x^2 - 3*y^2 = 1, i.e., a(n) = A001075(n) + A001353(n). - Lekraj Beedassy, Jul 21 2006
Number of 01-avoiding words of length n on alphabet {0,1,2,3} which do not end in 0. (E.g., for n = 2 we have 02, 03, 11, 12, 13, 21, 22, 23, 31, 32, 33.) - Tanya Khovanova, Jan 10 2007
sqrt(3) = 2/2 + 2/3 + 2/(3*11) + 2/(11*41) + 2/(41*153) + 2/(153*571) + ... - Gary W. Adamson, Dec 18 2007
The lower principal convergents to 3^(1/2), beginning with 1/1, 5/3, 19/11, 71/41, comprise a strictly increasing sequence; numerators = A001834, denominators = A001835. - Clark Kimberling, Aug 27 2008
From Gary W. Adamson, Jun 21 2009: (Start)
A001835 and A001353 = bisection of denominators of continued fraction [1, 2, 1, 2, 1, 2, ...]; i.e., bisection of A002530.
a(n) = determinant of an n*n tridiagonal matrix with 1's in the super- and subdiagonals and (3, 4, 4, 4, ...) as the main diagonal.
Also, the product of the eigenvalues of such matrices: a(n) = Product_{k=1..(n-1)/2)} (4 + 2*cos(2*k*Pi/n).
(End)
Let M = a triangle with the even-indexed Fibonacci numbers (1, 3, 8, 21, ...) in every column, and the leftmost column shifted up one row. a(n) starting (1, 3, 11, ...) = lim_{n->oo} M^n, the left-shifted vector considered as a sequence. - Gary W. Adamson, Jul 27 2010
a(n+1) is the number of compositions of n when there are 3 types of 1 and 2 types of other natural numbers. - Milan Janjic, Aug 13 2010
For n >= 2, a(n) equals the permanent of the (2*n-2) X (2*n-2) tridiagonal matrix with sqrt(2)'s along the main diagonal, and 1's along the superdiagonal and the subdiagonal. - John M. Campbell, Jul 08 2011
Primes in the sequence are apparently those in A096147. - R. J. Mathar, May 09 2013
Except for the first term, positive values of x (or y) satisfying x^2 - 4xy + y^2 + 2 = 0. - Colin Barker, Feb 04 2014
Except for the first term, positive values of x (or y) satisfying x^2 - 14xy + y^2 + 32 = 0. - Colin Barker, Feb 10 2014
The (1,1) element of A^n where A = (1, 1, 1; 1, 2, 1; 1, 1, 2). - David Neil McGrath, Jul 23 2014
Yong Hao Ng has shown that for any n, a(n) is coprime with any member of A001834 and with any member of A001075. - René Gy, Feb 25 2018
a(n+1) is the number of spanning trees of the graph T_n, where T_n is a 2 X n grid with an additional vertex v adjacent to (1,1) and (2,1). - Kevin Long, May 04 2018
a(n)/A001353(n) is the resistance of an n-ladder graph whose edges are replaced by one-ohm resistors. The resistance in ohms is measured at two nodes at one end of the ladder. It approaches sqrt(3) - 1 for n -> oo. See A342568, A357113, and A357115 for related information. - Hugo Pfoertner, Sep 17 2022
a(n) is the number of ways to tile a 1 X (n-1) strip with three types of tiles: small isosceles right triangles (with small side length 1), 1 X 1 squares formed by joining two of those right triangles along the hypotenuse, and large isosceles right triangles (with large side length 2) formed by joining two of those right triangles along a short leg. As an example, here is one of the a(6)=571 ways to tile a 1 X 5 strip with these kinds of tiles:
| / \ |\ /| |
|/_\|\/_||. - Greg Dresden and Arjun Datta, Jun 30 2023
From Klaus Purath, May 11 2024: (Start)
For any two consecutive terms (a(n), a(n+1)) = (x,y): x^2 - 4xy + y^2 = -2 = A028872(-1). In general, the following applies to all sequences (t) satisfying t(i) = 4t(i-1) - t(i-2) with t(0) = 1 and two consecutive terms (x,y): x^2 - 4xy + y^2 = A028872(t(1)-2). This includes and interprets the Feb 04 2014 comments here and on A001075 by Colin Barker and the Dec 12 2012 comment on A001353 by Max Alekseyev. By analogy to this, for three consecutive terms (x,y,z) y^2 - xz = A028872(t(1)-2). This includes and interprets the Jul 10 2021 comment on A001353 by Bernd Mulansky.
If (t) is a sequence satisfying t(k) = 3t(k-1) + 3t(k-2) - t(k-3) or t(k) = 4t(k-1) - t(k-2) without regard to initial values and including this sequence itself, then a(n) = (t(k+2n+1) + t(k))/(t(k+n+1) + t(k+n)) always applies, as long as t(k+n+1) + t(k+n) != 0 for integer k and n >= 1. (End)
Binomial transform of 1, 0, 2, 4, 12, ... (A028860 without the initial -1) and reverse binomial transform of 1, 2, 6, 24, 108, ... (A094433 without the initial 1). - Klaus Purath, Sep 09 2024

References

  • Julio R. Bastida, Quadratic properties of a linearly recurrent sequence. Proceedings of the Tenth Southeastern Conference on Combinatorics, Graph Theory and Computing (Florida Atlantic Univ., Boca Raton, Fla., 1979), pp. 163-166, Congress. Numer., XXIII-XXIV, Utilitas Math., Winnipeg, Man., 1979. MR0561042 (81e:10009).
  • Leonhard Euler, (E388) Vollstaendige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 375.
  • F. Faase, On the number of specific spanning subgraphs of the graphs G X P_n, Ars Combin. 49 (1998), 129-154.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 329.
  • Serge Lang, Introduction to Diophantine Approximations, Addison-Wesley, New York, 1966.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics I, p. 292.

Crossrefs

Row 3 of array A099390.
Essentially the same as A079935.
First differences of A001353.
Partial sums of A052530.
Pairwise sums of A006253.
Bisection of A002530, A005246 and A048788.
First column of array A103997.
Cf. A001519, A003699, A082841, A101265, A125077, A001353, A001542, A096147 (subsequence of primes).

Programs

  • GAP
    a:=[1,1];; for n in [3..20] do a[n]:=4*a[n-1]-a[n-2]; od; a; # G. C. Greubel, Dec 23 2019
  • Haskell
    a001835 n = a001835_list !! n
    a001835_list =
       1 : 1 : zipWith (-) (map (4 *) $ tail a001835_list) a001835_list
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Magma
    [n le 2 select 1 else 4*Self(n-1)-Self(n-2): n in [1..25]]; // Vincenzo Librandi, Sep 16 2016
    
  • Maple
    f:=n->((3+sqrt(3))^(2*n-1)+(3-sqrt(3))^(2*n-1))/6^n; [seq(simplify(expand(f(n))),n=0..20)]; # N. J. A. Sloane, Nov 10 2009
  • Mathematica
    CoefficientList[Series[(1-3x)/(1-4x+x^2), {x, 0, 24}], x] (* Jean-François Alcover, Jul 25 2011, after g.f. *)
    LinearRecurrence[{4,-1},{1,1},30] (* Harvey P. Dale, Jun 08 2013 *)
    Table[Round@Fibonacci[2n-1, Sqrt[2]], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *)
    Table[(3*ChebyshevT[n, 2] - ChebyshevU[n, 2])/2, {n, 0, 20}] (* G. C. Greubel, Dec 23 2019 *)
  • PARI
    {a(n) = real( (2 + quadgen(12))^n * (1 - 1 / quadgen(12)) )} /* Michael Somos, Sep 19 2008 */
    
  • PARI
    {a(n) = subst( (polchebyshev(n) + polchebyshev(n-1)) / 3, x, 2)} /* Michael Somos, Sep 19 2008 */
    
  • Sage
    [lucas_number1(n,4,1)-lucas_number1(n-1,4,1) for n in range(25)] # Zerinvary Lajos, Apr 29 2009
    
  • Sage
    [(3*chebyshev_T(n,2) - chebyshev_U(n,2))/2 for n in (0..20)] # G. C. Greubel, Dec 23 2019
    

Formula

G.f.: (1 - 3*x)/(1 - 4*x + x^2). - Simon Plouffe in his 1992 dissertation
a(1-n) = a(n).
a(n) = ((3 + sqrt(3))^(2*n - 1) + (3 - sqrt(3))^(2*n - 1))/6^n. - Dean Hickerson, Dec 01 2002
a(n) = (8 + a(n-1)*a(n-2))/a(n-3). - Michael Somos, Aug 01 2001
a(n+1) = Sum_{k=0..n} 2^k * binomial(n + k, n - k), n >= 0. - Len Smiley, Dec 09 2001
Limit_{n->oo} a(n)/a(n-1) = 2 + sqrt(3). - Gregory V. Richardson, Oct 10 2002
a(n) = 2*A061278(n-1) + 1 for n > 0. - Bruce Corrigan (scentman(AT)myfamily.com), Nov 04 2002
Let q(n, x) = Sum_{i=0..n} x^(n-i)*binomial(2*n - i, i); then q(n, 2) = a(n+1). - Benoit Cloitre, Nov 10 2002
a(n+1) = Sum_{k=0..n} ((-1)^k)*((2*n+1)/(2*n + 1 - k))*binomial(2*n + 1 - k, k)*6^(n - k) (from standard T(n,x)/x, n >= 1, Chebyshev sum formula). The Smiley and Cloitre sum representation is that of the S(2*n, i*sqrt(2))*(-1)^n Chebyshev polynomial. - Wolfdieter Lang, Nov 29 2002
a(n) = S(n-1, 4) - S(n-2, 4) = T(2*n-1, sqrt(3/2))/sqrt(3/2) = S(2*(n-1), i*sqrt(2))*(-1)^(n - 1), with S(n, x) := U(n, x/2), resp. T(n, x), Chebyshev's polynomials of the second, resp. first, kind. See A049310 and A053120. S(-1, x) = 0, S(-2, x) = -1, S(n, 4) = A001353(n+1), T(-1, x) = x.
a(n+1) = sqrt((A001834(n)^2 + 2)/3), n >= 0 (see Cloitre comment).
Sequence satisfies -2 = f(a(n), a(n+1)) where f(u, v) = u^2 + v^2 - 4*u*v. - Michael Somos, Sep 19 2008
a(n) = (1/6)*(3*(2 - sqrt(3))^n + sqrt(3)*(2 - sqrt(3))^n + 3*(2 + sqrt(3))^n - sqrt(3)*(2 + sqrt(3))^n) (Mathematica's solution to the recurrence relation). - Sarah-Marie Belcastro, Jul 04 2009
If p[1] = 3, p[i] = 2, (i > 1), and if A is Hessenberg matrix of order n defined by: A[i,j] = p[j-i+1], (i <= j), A[i,j] = -1, (i = j+1), and A[i,j] = 0 otherwise. Then, for n >= 1, a(n+1) = det A. - Milan Janjic, Apr 29 2010
a(n) = (a(n-1)^2 + 2)/a(n-2). - Irene Sermon, Oct 28 2013
a(n) = A001353(n+1) - 3*A001353(n). - R. J. Mathar, Oct 30 2015
a(n) = a(n-1) + 2*A001353(n-1). - Kevin Long, May 04 2018
From Franck Maminirina Ramaharo, Nov 11 2018: (Start)
a(n) = (-1)^n*(A125905(n) + 3*A125905(n-1)), n > 0.
E.g.f.: exp^(2*x)*(3*cosh(sqrt(3)*x) - sqrt(3)*sinh(sqrt(3)*x))/3. (End)
From Peter Bala, Feb 12 2024: (Start)
For n in Z, a(n) = A001353(n) + A001353(1-n).
For n, j, k in Z, a(n)*a(n+j+k) - a(n+j)*a(n+k) = 2*A001353(j)*A001353(k). The case j = 1, k = 2 is given above. (End)

A002530 a(n) = 4*a(n-2) - a(n-4) for n > 1, a(n) = n for n = 0, 1.

Original entry on oeis.org

0, 1, 1, 3, 4, 11, 15, 41, 56, 153, 209, 571, 780, 2131, 2911, 7953, 10864, 29681, 40545, 110771, 151316, 413403, 564719, 1542841, 2107560, 5757961, 7865521, 21489003, 29354524, 80198051, 109552575, 299303201, 408855776, 1117014753, 1525870529, 4168755811
Offset: 0

Views

Author

Keywords

Comments

Denominators of continued fraction convergents to sqrt(3), for n >= 1.
Also denominators of continued fraction convergents to sqrt(3) - 1. See A048788 for numerators. - N. J. A. Sloane, Dec 17 2007. Convergents are 1, 2/3, 3/4, 8/11, 11/15, 30/41, 41/56, 112/153, ...
Consider the mapping f(a/b) = (a + 3*b)/(a + b). Taking a = b = 1 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the following sequence 1/1, 2/1, 5/3, 7/4, 19/11, ... converging to 3^(1/2). Sequence contains the denominators. The same mapping for N, i.e., f(a/b) = (a + Nb)/(a + b) gives fractions converging to N^(1/2). - Amarnath Murthy, Mar 22 2003
Sqrt(3) = 2/2 + 2/3 + 2/(3*11) + 2/(11*41) + 2/(41*153) + 2/(153*571), ...; the sum of the first 6 terms of this series = 1.7320490367..., while sqrt(3) = 1.7320508075... - Gary W. Adamson, Dec 15 2007
From Clark Kimberling, Aug 27 2008: (Start)
Related convergents (numerator/denominator):
lower principal convergents: A001834/A001835
upper principal convergents: A001075/A001353
intermediate convergents: A005320/A001075
principal and intermediate convergents: A143642/A140827
lower principal and intermediate convergents: A143643/A005246. (End)
Row sums of triangle A152063 = (1, 3, 4, 11, ...). - Gary W. Adamson, Nov 26 2008
From Alois P. Heinz, Apr 13 2011: (Start)
Also number of domino tilings of the 3 X (n-1) rectangle with upper left corner removed iff n is even. For n=4 the 4 domino tilings of the 3 X 3 rectangle with upper left corner removed are:
. ._. . ._. . ._. . ._.
.|__| .|__| .| | | .|___|
| |_| | | | | | ||| |_| |
||__| |||_| ||__| |_|_| (End)
This is the sequence of Lehmer numbers u_n(sqrt(R),Q) with the parameters R = 2 and Q = -1. It is a strong divisibility sequence, that is, gcd(a(n),a(m)) = a(gcd(n,m)) for all natural numbers n and m. - Peter Bala, Apr 18 2014
2^(-floor(n/2))*(1 + sqrt(3))^n = A002531(n) + a(n)*sqrt(3); integers in the real quadratic number field Q(sqrt(3)). - Wolfdieter Lang, Feb 11 2018
Let T(n) = 2^(n mod 2), U(n) = a(n), V(n) = A002531(n), x(n) = V(n)/U(n). Then T(n*m) * U(n+m) = U(n)*V(m) + U(m)*V(n), T(n*m) * V(n+m) = 3*U(n)*U(m) + V(m)*V(n), x(n+m) = (3 + x(n)*x(m))/(x(n) + x(m)). - Michael Somos, Nov 29 2022

Examples

			Convergents to sqrt(3) are: 1, 2, 5/3, 7/4, 19/11, 26/15, 71/41, 97/56, 265/153, 362/209, 989/571, 1351/780, 3691/2131, ... = A002531/A002530 for n >= 1.
1 + 1/(1 + 1/(2 + 1/(1 + 1/2))) = 19/11 so a(5) = 11.
G.f. = x + x^2 + 3*x^3 + 4*x^4 + 11*x^5 + 15*x^6 + 41*x^7 + ... - _Michael Somos_, Mar 18 2022
		

References

  • Serge Lang, Introduction to Diophantine Approximations, Addison-Wesley, New York, 1966.
  • Russell Lyons, A bird's-eye view of uniform spanning trees and forests, in Microsurveys in Discrete Probability, AMS, 1998.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 181.
  • Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. Tarn, Approximations to certain square roots and the series of numbers connected therewith, Mathematical Questions and Solutions from the Educational Times, 1 (1916), 8-12.

Crossrefs

Cf. A002531 (numerators of convergents to sqrt(3)), A048788, A003297.
Bisections: A001353 and A001835.
Cf. A152063.
Analog for sqrt(m): A000129 (m=2), A001076 (m=5), A041007 (m=6), A041009 (m=7), A041011 (m=8), A005668 (m=10), A041015 (m=11), A041017 (m=12), ..., A042935 (m=999), A042937 (m=1000).

Programs

  • Magma
    I:=[0,1,1,3]; [n le 4 select I[n] else 4*Self(n-2) - Self(n-4): n in [1..50]]; // G. C. Greubel, Feb 25 2019
    
  • Maple
    a := proc(n) option remember; if n=0 then 0 elif n=1 then 1 elif n=2 then 1 elif n=3 then 3 else 4*a(n-2)-a(n-4) fi end; [ seq(a(i),i=0..50) ];
    A002530:=-(-1-z+z**2)/(1-4*z**2+z**4); # conjectured (correctly) by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Join[{0},Table[Denominator[FromContinuedFraction[ContinuedFraction[Sqrt[3],n]]], {n,1,50}]] (* Stefan Steinerberger, Apr 01 2006 *)
    Join[{0},Denominator[Convergents[Sqrt[3],50]]] (* or *) LinearRecurrence[ {0,4,0,-1},{0,1,1,3},50] (* Harvey P. Dale, Jan 29 2013 *)
    a[ n_] := If[n<0, -(-1)^n, 1] SeriesCoefficient[ x*(1+x-x^2)/(1-4*x^2+x^4), {x, 0, Abs@n}]; (* Michael Somos, Apr 18 2019 *)
    a[ n_] := ChebyshevU[n-1, Sqrt[-1/2]]*Sqrt[2]^(Mod[n, 2]-1)/I^(n-1) //Simplify; (* Michael Somos, Nov 29 2022 *)
  • PARI
    {a(n) = if( n<0, -(-1)^n * a(-n), contfracpnqn(vector(n, i, 1 + (i>1) * (i%2)))[2, 1])}; /* Michael Somos, Jun 05 2003 */
    
  • PARI
    { for (n=0, 50, a=contfracpnqn(vector(n, i, 1+(i>1)*(i%2)))[2, 1]; write("b002530.txt", n, " ", a); ); } \\ Harry J. Smith, Jun 01 2009
    
  • PARI
    my(w=quadgen(12)); A002530(n)=real((2+w)^(n\/2)*if(bittest(n,0),1-w/3,w/3));
    apply(A002530, [0..30]) \\ M. F. Hasler, Nov 04 2019
    
  • Python
    from functools import cache
    @cache
    def a(n): return [0, 1, 1, 3][n] if n < 4 else 4*a(n-2) - a(n-4)
    print([a(n) for n in range(36)]) # Michael S. Branicky, Nov 13 2022
  • Sage
    (x*(1+x-x^2)/(1-4*x^2+x^4)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019
    

Formula

G.f.: x*(1 + x - x^2)/(1 - 4*x^2 + x^4).
a(n) = 4*a(n-2) - a(n-4). [Corrected by László Szalay, Feb 21 2014]
a(n) = -(-1)^n * a(-n) for all n in Z, would satisfy the same recurrence relation. - Michael Somos, Jun 05 2003
a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1).
From Benoit Cloitre, Dec 15 2002: (Start)
a(2*n) = ((2 + sqrt(3))^n - (2 - sqrt(3))^n)/(2*sqrt(3)).
a(2*n) = A001353(n).
a(2*n-1) = ceiling((1 + 1/sqrt(3))/2*(2 + sqrt(3))^n) = ((3 + sqrt(3))^(2*n - 1) + (3 - sqrt(3))^(2*n - 1))/6^n.
a(2*n-1) = A001835(n). (End)
a(n+1) = Sum_{k=0..floor(n/2)} binomial(n - k, k) * 2^floor((n - 2*k)/2). - Paul Barry, Jul 13 2004
a(n) = Sum_{k=0..floor(n/2)} binomial(floor(n/2) + k, floor((n - 1)/2 - k))*2^k. - Paul Barry, Jun 22 2005
G.f.: (sqrt(6) + sqrt(3))/12*Q(0), where Q(k) = 1 - a/(1 + 1/(b^(2*k) - 1 - b^(2*k)/(c + 2*a*x/(2*x - g*m^(2*k)/(1 + a/(1 - 1/(b^(2*k + 1) + 1 - b^(2*k + 1)/(h - 2*a*x/(2*x + g*m^(2*k + 1)/Q(k + 1)))))))))). - Sergei N. Gladkovskii, Jun 21 2012
a(n) = (alpha^n - beta^n)/(alpha - beta) for n odd, and a(n) = (alpha^n - beta^n)/(alpha^2 - beta^2) for n even, where alpha = 1/2*(sqrt(2) + sqrt(6)) and beta = (1/2)*(sqrt(2) - sqrt(6)). Cf. A108412. - Peter Bala, Apr 18 2014
a(n) = (-sqrt(2)*i)^n*S(n, sqrt(2)*i)*2^(-floor(n/2)) = A002605(n)*2^(-floor(n/2)), n >= 0, with i = sqrt(-1) and S the Chebyshev polynomials (A049310). - Wolfdieter Lang, Feb 10 2018
a(n+1)*a(n+2) - a(n+3)*a(n) = (-1)^n, n >= 0. - Kai Wang, Feb 06 2020
E.g.f.: sinh(sqrt(3/2)*x)*(sinh(x/sqrt(2)) + sqrt(2)*cosh(x/sqrt(2)))/sqrt(3). - Stefano Spezia, Feb 07 2020
a(n) = ((1 + sqrt(3))^n - (1 - sqrt(3))^n)/(2*2^floor(n/2))/sqrt(3) = A002605(n)/2^floor(n/2). - Robert FERREOL, Apr 13 2023

Extensions

Definition edited by M. F. Hasler, Nov 04 2019

A003500 a(n) = 4*a(n-1) - a(n-2) with a(0) = 2, a(1) = 4.

Original entry on oeis.org

2, 4, 14, 52, 194, 724, 2702, 10084, 37634, 140452, 524174, 1956244, 7300802, 27246964, 101687054, 379501252, 1416317954, 5285770564, 19726764302, 73621286644, 274758382274, 1025412242452, 3826890587534, 14282150107684, 53301709843202, 198924689265124
Offset: 0

Views

Author

Keywords

Comments

a(n) gives values of x satisfying x^2 - 3*y^2 = 4; corresponding y values are given by 2*A001353(n).
If M is any given term of the sequence, then the next one is 2*M + sqrt(3*M^2 - 12). - Lekraj Beedassy, Feb 18 2002
For n > 0, the three numbers a(n) - 1, a(n), and a(n) + 1 form a Fleenor-Heronian triangle, i.e., a Heronian triangle with consecutive sides, whose area A(n) may be obtained from the relation [4*A(n)]^2 = 3([a(2n)]^2 - 4); or A(n) = 3*A001353(2*n)/2 and whose semiperimeter is 3*a[n]/2. The sequence is symmetrical about a[0], i.e., a[-n] = a[n].
For n > 0, a(n) + 2 is the number of dimer tilings of a 2*n X 2 Klein bottle (cf. A103999).
Tsumura shows that, for prime p, a(p) is composite (contrary to a conjecture of Juricevic). - Charles R Greathouse IV, Apr 13 2010
Except for the first term, positive values of x (or y) satisfying x^2 - 4*x*y + y^2 + 12 = 0. - Colin Barker, Feb 04 2014
Except for the first term, positive values of x (or y) satisfying x^2 - 14*x*y + y^2 + 192 = 0. - Colin Barker, Feb 16 2014
A268281(n) - 1 is a member of this sequence iff A268281(n) is prime. - Frank M Jackson, Feb 27 2016
a(n) gives values of x satisfying 3*x^2 - 4*y^2 = 12; corresponding y values are given by A005320. - Sture Sjöstedt, Dec 19 2017
Middle side lengths of almost-equilateral Heronian triangles. - Wesley Ivan Hurt, May 20 2020
For all elements k of the sequence, 3*(k-2)*(k+2) is a square. - Davide Rotondo, Oct 25 2020

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 82.
  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p.91.
  • Michael P. Cohen, Generating Heronian Triangles With Consecutive Integer Sides. Journal of Recreational Mathematics, vol. 30 no. 2 1999-2000 p. 123.
  • L. E. Dickson, History of The Theory of Numbers, Vol. 2 pp. 197;198;200;201. Chelsea NY.
  • Charles R. Fleenor, Heronian Triangles with Consecutive Integer Sides, Journal of Recreational Mathematics, Volume 28, no. 2 (1996-7) 113-115.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley. Enumerative combinatorics. Vol. 2, volume 62 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1999.
  • V. D. To, "Finding All Fleenor-Heronian Triangles", Journal of Recreational Mathematics vol. 32 no.4 2003-4 pp. 298-301 Baywood NY.

Crossrefs

Cf. A011945 (areas), A334277 (perimeters).
Cf. this sequence (middle side lengths), A016064 (smallest side lengths), A335025 (largest side lengths).

Programs

  • Haskell
    a003500 n = a003500_list !! n
    a003500_list = 2 : 4 : zipWith (-)
       (map (* 4) $ tail a003500_list) a003500_list
    -- Reinhard Zumkeller, Dec 17 2011
    
  • Magma
    I:=[2,4]; [n le 2 select I[n] else 4*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 14 2018
  • Maple
    A003500 := proc(n) option remember; if n <= 1 then 2*n+2 else 4*procname(n-1)-procname(n-2); fi;
    end proc;
  • Mathematica
    a[0]=2; a[1]=4; a[n_]:= a[n]= 4a[n-1] -a[n-2]; Table[a[n], {n, 0, 23}]
    LinearRecurrence[{4,-1},{2,4},30] (* Harvey P. Dale, Aug 20 2011 *)
    Table[Round@LucasL[2n, Sqrt[2]], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *)
  • PARI
    x='x+O('x^99); Vec(-2*(-1+2*x)/(1-4*x+x^2)) \\ Altug Alkan, Apr 04 2016
    
  • Sage
    [lucas_number2(n,4,1) for n in range(0, 24)] # Zerinvary Lajos, May 14 2009
    

Formula

a(n) = ( 2 + sqrt(3) )^n + ( 2 - sqrt(3) )^n.
a(n) = 2*A001075(n).
G.f.: 2*(1 - 2*x)/(1 - 4*x + x^2). Simon Plouffe in his 1992 dissertation.
a(n) = A001835(n) + A001835(n+1).
a(n) = trace of n-th power of the 2 X 2 matrix [1 2 / 1 3]. - Gary W. Adamson, Jun 30 2003 [corrected by Joerg Arndt, Jun 18 2020]
From the addition formula, a(n+m) = a(n)*a(m) - a(m-n), it is easy to derive multiplication formulas, such as: a(2*n) = (a(n))^2 - 2, a(3*n) = (a(n))^3 - 3*(a(n)), a(4*n) = (a(n))^4 - 4*(a(n))^2 + 2, a(5*n) = (a(n))^5 - 5*(a(n))^3 + 5*(a(n)), a(6*n) = (a(n))^6 - 6*(a(n))^4 + 9*(a(n))^2 - 2, etc. The absolute values of the coefficients in the expansions are given by the triangle A034807. - John Blythe Dobson, Nov 04 2007
a(n) = 2*A001353(n+1) - 4*A001353(n). - R. J. Mathar, Nov 16 2007
From Peter Bala, Jan 06 2013: (Start)
Let F(x) = Product_{n=0..infinity} (1 + x^(4*n + 1))/(1 + x^(4*n + 3)). Let alpha = 2 - sqrt(3). This sequence gives the simple continued fraction expansion of 1 + F(alpha) = 2.24561 99455 06551 88869 ... = 2 + 1/(4 + 1/(14 + 1/(52 + ...))). Cf. A174500.
Also F(-alpha) = 0.74544 81786 39692 68884 ... has the continued fraction representation 1 - 1/(4 - 1/(14 - 1/(52 - ...))) and the simple continued fraction expansion 1/(1 + 1/((4 - 2) + 1/(1 + 1/((14 - 2) + 1/(1 + 1/((52 - 2) + 1/(1 + ...))))))).
F(alpha)*F(-alpha) has the simple continued fraction expansion 1/(1 + 1/((4^2 - 4) + 1/(1 + 1/((14^2 - 4) + 1/(1 + 1/((52^2 - 4) + 1/(1 + ...))))))).
(End)
a(2^n) = A003010(n). - John Blythe Dobson, Mar 10 2014
a(n) = [x^n] ( (1 + 4*x + sqrt(1 + 8*x + 12*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
E.g.f.: 2*exp(2*x)*cosh(sqrt(3)*x). - Ilya Gutkovskiy, Apr 27 2016
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*n*(n - k - 1)!/(k!*(n - 2*k)!)*4^(n - 2*k) for n >= 1. - Peter Luschny, May 10 2016
From Peter Bala, Oct 15 2019: (Start)
a(n) = trace(M^n), where M is the 2 X 2 matrix [0, 1; -1, 4].
Consequently the Gauss congruences hold: a(n*p^k) = a(n*p^(k-1)) ( mod p^k ) for all prime p and positive integers n and k. See Zarelua and also Stanley (Ch. 5, Ex. 5.2(a) and its solution).
2*Sum_{n >= 1} 1/( a(n) - 6/a(n) ) = 1.
6*Sum_{n >= 1} (-1)^(n+1)/( a(n) + 2/a(n) ) = 1.
8*Sum_{n >= 1} 1/( a(n) + 24/(a(n) - 12/(a(n))) ) = 1.
8*Sum_{n >= 1} (-1)^(n+1)/( a(n) + 8/(a(n) + 4/(a(n))) ) = 1.
Series acceleration formulas for sums of reciprocals:
Sum_{n >= 1} 1/a(n) = 1/2 - 6*Sum_{n >= 1} 1/(a(n)*(a(n)^2 - 6)),
Sum_{n >= 1} 1/a(n) = 1/8 + 24*Sum_{n >= 1} 1/(a(n)*(a(n)^2 + 12)),
Sum_{n >= 1} (-1)^(n+1)/a(n) = 1/6 + 2*Sum_{n >= 1} (-1)^(n+1)/(a(n)*(a(n)^2 + 2)) and
Sum_{n >= 1} (-1)^(n+1)/a(n) = 1/8 + 8*Sum_{n >= 1} (-1)^(n+1)/(a(n)*(a(n)^2 + 12)).
Sum_{n >= 1} 1/a(n) = ( theta_3(2-sqrt(3))^2 - 1 )/4 = 0.34770 07561 66992 06261 .... See Borwein and Borwein, Proposition 3.5 (i), p.91.
Sum_{n >= 1} (-1)^(n+1)/a(n) = ( 1 - theta_3(sqrt(3)-2)^2 )/4. Cf. A003499 and A153415. (End)
a(n) = tan(Pi/12)^n + tan(5*Pi/12)^n. - Greg Dresden, Oct 01 2020
From Wolfdieter Lang, Sep 06 2021: (Start)
a(n) = S(n, 4) - S(n-2, 4) = 2*T(n, 2), for n >= 0, with S and T Chebyshev polynomials, with S(-1, x) = 0 and S(-2, x) = -1. S(n, 4) = A001353(n+1), for n >= -1, and T(n, 2) = A001075(n).
a(2*k) = A067902(k), a(2*k+1) = 4*A001570(k+1), for k >= 0. (End)
a(n) = sqrt(2 + 2*A011943(n+1)) = sqrt(2 + 2*A102344(n+1)), n>0. - Ralf Steiner, Sep 23 2021
Sum_{n>=1} arctan(3/a(n)^2) = Pi/6 - arctan(1/3) = A019673 - A105531 (Ohtskua, 2024). - Amiram Eldar, Aug 29 2024

Extensions

More terms from James Sellers, May 03 2000
Additional comments from Lekraj Beedassy, Feb 14 2002

A002531 a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1); a(0) = a(1) = 1.

Original entry on oeis.org

1, 1, 2, 5, 7, 19, 26, 71, 97, 265, 362, 989, 1351, 3691, 5042, 13775, 18817, 51409, 70226, 191861, 262087, 716035, 978122, 2672279, 3650401, 9973081, 13623482, 37220045, 50843527, 138907099, 189750626, 518408351, 708158977, 1934726305
Offset: 0

Views

Author

Keywords

Comments

Numerators of continued fraction convergents to sqrt(3), for n >= 1.
For the denominators see A002530.
Consider the mapping f(a/b) = (a + 3*b)/(a + b). Taking a = b = 1 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the convergents 1/1, 2/1, 5/3, 7/4, 19/11, ... converging to sqrt(3). Sequence contains the numerators. - Amarnath Murthy, Mar 22 2003
In the Murthy comment if we take a = 0, b = 1 then the denominator of the reduced fraction is a(n+1). A083336(n)/a(n+1) converges to sqrt(3). - Mario Catalani (mario.catalani(AT)unito.it), Apr 26 2003
If signs are disregarded, all terms of A002316 appear to be elements of this sequence. - Creighton Dement, Jun 11 2007
2^(-floor(n/2))*(1 + sqrt(3))^n = a(n) + A002530(n)*sqrt(3); integers in the real quadratic number field Q(sqrt(3)). - Wolfdieter Lang, Feb 10 2018
Let T(n) = A000034(n), U(n) = A002530(n), V(n) = a(n), x(n) = U(n)/V(n). Then T(n*m) * U(n+m) = U(n)*V(m) + U(m)*V(n), T(n*m) * V(n+m) = 3*U(n)*U(m) + V(m)*V(n), x(n+m) = (x(n) + x(m))/(1 + 3*x(n)*x(m)). - Michael Somos, Nov 29 2022

Examples

			1 + 1/(1 + 1/(2 + 1/(1 + 1/2))) = 19/11 so a(5) = 19.
Convergents are 1, 2, 5/3, 7/4, 19/11, 26/15, 71/41, 97/56, 265/153, 362/209, 989/571, 1351/780, 3691/2131, ... = A002531/A002530.
G.f. = 1 + x + 2*x^2 + 5*x^3 + 7*x^4 + 19*x^5 + 26*x^6 + 71*x^7 + ... - _Michael Somos_, Mar 22 2022
		

References

  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 181.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. Tarn, Approximations to certain square roots and the series of numbers connected therewith, Mathematical Questions and Solutions from the Educational Times, 1 (1916), 8-12.

Crossrefs

Bisections are A001075 and A001834.
Cf. A002530 (denominators), A048788.
Cf. A002316.

Programs

  • GAP
    a:=[1,1,2,5];; for n in [5..40] do a[n]:=4*a[n-2]-a[n-4]; od; a; # G. C. Greubel, Nov 16 2018
  • Magma
    m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( (1 +x-2*x^2+x^3)/(1-4*x^2+x^4))); // G. C. Greubel, Nov 16 2018
    
  • Maple
    A002531 := proc(n) option remember; if n=0 then 0 elif n=1 then 1 elif n=2 then 1 elif type(n,odd) then A002531(n-1)+A002531(n-2) else 2*A002531(n-1)+A002531(n-2) fi; end; [ seq(A002531(n), n=0..50) ];
    with(numtheory): tp := cfrac (tan(Pi/3),100): seq(nthnumer(tp,i), i=-1..32 ); # Zerinvary Lajos, Feb 07 2007
    A002531:=(1+z-2*z**2+z**3)/(1-4*z**2+z**4); # Simon Plouffe; see his 1992 dissertation
  • Mathematica
    Insert[Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[3], n]]], {n, 1, 40}], 1, 1] (* Stefan Steinerberger, Apr 01 2006 *)
    Join[{1},Numerator[Convergents[Sqrt[3],40]]] (* Harvey P. Dale, Jan 23 2012 *)
    CoefficientList[Series[(1 + x - 2 x^2 + x^3)/(1 - 4 x^2 + x^4), {x, 0, 30}], x] (* Vincenzo Librandi, Nov 01 2014 *)
    LinearRecurrence[{0, 4, 0, -1}, {1, 1, 2, 5}, 35] (* Robert G. Wilson v, Feb 11 2018 *)
    a[ n_] := ChebyshevT[n, Sqrt[-1/2]]*Sqrt[2]^Mod[n,2]/I^n //Simplify; (* Michael Somos, Mar 22 2022 *)
    a[ n_] := If[n<0, (-1)^n*a[-n], SeriesCoefficient[ (1 + x - 2*x^2 + x^3) / (1 - 4*x^2 + x^4), {x, 0, n}]]; (* Michael Somos, Sep 23 2024 *)
  • PARI
    a(n)=contfracpnqn(vector(n,i,1+(i>1)*(i%2)))[1,1]
    
  • PARI
    apply( {A002531(n,w=quadgen(12))=real((2+w)^(n\/2)*if(bittest(n, 0), w-1, 1))}, [0..30]) \\ M. F. Hasler, Nov 04 2019
    
  • PARI
    {a(n) = if(n<0, (-1)^n*a(-n), polcoeff( (1 + x - 2*x^2 + x^3) / (1 - 4*x^2 + x^4) + x*O(x^n), n))}; /* Michael Somos, Sep 23 2024 */
    
  • Sage
    s=((1+x-2*x^2+x^3)/(1-4*x^2+x^4)).series(x,40); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 16 2018
    

Formula

G.f.: (1 + x - 2*x^2 + x^3)/(1 - 4*x^2 + x^4).
a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1), n > 0.
a(2*n) = (1/2)*((2 + sqrt(3))^n+(2 - sqrt(3))^n); a(2*n) = A003500(n)/2; a(2*n+1) = round(1/(1 + sqrt(3))*(2 + sqrt(3))^n). - Benoit Cloitre, Dec 15 2002
a(n) = ((1 + sqrt(3))^n + (1 - sqrt(3))^n)/(2*2^floor(n/2)). - Bruno Berselli, Nov 10 2011
a(n) = A080040(n)/(2*2^floor(n/2)). - Ralf Stephan, Sep 08 2013
a(2*n) = (-1)^n*T(2*n,u) and a(2*n+1) = (-1)^n*1/u*T(2*n+1,u), where u = sqrt(-1/2) and T(n,x) denotes the Chebyshev polynomial of the first kind. - Peter Bala, May 01 2012
a(n) = (-sqrt(2)*i)^n*T(n, sqrt(2)*i/2)*2^(-floor(n/2)) = A026150(n)*2^(-floor(n/2)), n >= 0, with i = sqrt(-1) and the Chebyshev T polynomials (A053120). - Wolfdieter Lang, Feb 10 2018
From Franck Maminirina Ramaharo, Nov 14 2018: (Start)
a(n) = ((1 - sqrt(2))*(-1)^n + 1 + sqrt(2))*(((sqrt(2) - sqrt(6))/2)^n + ((sqrt(6) + sqrt(2))/2)^n)/4.
E.g.f.: cosh(sqrt(3/2)*x)*(sqrt(2)*sinh(x/sqrt(2)) + cosh(x/sqrt(2))). (End)
a(n) = (-1)^n*a(-n) for all n in Z. - Michael Somos, Mar 22 2022
a(n) = 4*a(n-2) - a(n-4). - Boštjan Gec, Sep 21 2023

Extensions

Name edited (as by discussion in A002530) by M. F. Hasler, Nov 04 2019

A321119 a(n) = ((1 - sqrt(3))^n + (1 + sqrt(3))^n)/2^floor((n - 1)/2); n-th row common denominator of A321118.

Original entry on oeis.org

4, 2, 8, 10, 28, 38, 104, 142, 388, 530, 1448, 1978, 5404, 7382, 20168, 27550, 75268, 102818, 280904, 383722, 1048348, 1432070, 3912488, 5344558, 14601604, 19946162, 54493928, 74440090, 203374108, 277814198, 759002504, 1036816702, 2832635908, 3869452610
Offset: 0

Views

Author

Keywords

Examples

			a(0) = ((1 - sqrt(3))^0 + (1 + sqrt(3))^0)/2^floor((0 - 1)/2) = 2*(1 + 1) = 4.
		

References

  • Harold J. Ahlberg, Edwin N. Nilson and Joseph L. Walsh, The Theory of Splines and Their Applications, Academic Press, 1967. See p. 47, Table 2.5.2.

Crossrefs

Cf. A002176 (common denominators of Cotesian numbers).

Programs

  • Mathematica
    LinearRecurrence[{0, 4, 0, -1}, {4, 2, 8, 10}, 50]
  • Maxima
    a(n) := ((1 - sqrt(3))^n + (1 + sqrt(3))^n)/2^floor((n - 1)/2)$
    makelist(ratsimp(a(n)), n, 0, 50);

Formula

a(n) = (((sqrt(2) - sqrt(6))/2)^n + ((sqrt(6) + sqrt(2))/2)^n)*((2 - sqrt(2))*(-1)^n + 2 + sqrt(2))/2.
a(-n) = (-1)^n*a(n).
a(n) = 2*A000034(n+1)*A002531(n).
a(2*n) = 2*A001834(n).
a(2*n+1) = 2*A003500(n).
a(n) = 4*a(n-2) - a(n-4) with a(0) = 4, a(1) = 2, a(2) = 8, a(3) = 10.
a(2*n+3) = a(2*n+1) + a(2*n+2).
a(2*n+2) = a(2*n) + 2*a(2*n+1).
G.f.: 2*(1 - x)*(2 + 3*x - x^2)/(1 - 4*x^2 + x^4).
E.g.f.: (1 + exp(-sqrt(6)*x))*((2 - sqrt(2))*exp(sqrt(2 - sqrt(3))*x) + (2 + sqrt(2))*exp(sqrt(2 + sqrt(3))*x))/2.
Lim_{n->infinity} a(2*n+1)/a(2*n) = (1 + sqrt(3))/2.

A142879 a(n) = 5*a(n-3) - a(n-6) with terms 1..6 as 0, 1, 2, 5, 7, 9.

Original entry on oeis.org

0, 1, 2, 5, 7, 9, 25, 34, 43, 120, 163, 206, 575, 781, 987, 2755, 3742, 4729, 13200, 17929, 22658, 63245, 85903, 108561, 303025, 411586, 520147, 1451880, 1972027, 2492174, 6956375, 9448549, 11940723, 33329995, 45270718, 57211441, 159693600
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 28 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Clear[a, n]; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[Mod[n, 3] == 0, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 1, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]]; b = Table[a[n], {n, 0, 50}]
    LinearRecurrence[{0,0,5,0,0,-1},{0,1,2,5,7,9},40] (* Harvey P. Dale, Apr 06 2016 *)
  • PARI
    a=vector(20); a[1]=1; a[2]=2; for(n=3, #a, if(n%3==0, a[n]=2*a[n-1]+a[n-2], if(n%3==1, a[n]=a[n-1]+a[n-2], a[n]=2*a[n-1]-a[n-2]))); concat(0, a) \\ Colin Barker, Jan 30 2016
    
  • PARI
    concat(0, Vec(x^2*(1+2*x+5*x^2+2*x^3-x^4)/(1-5*x^3+x^6) + O(x^50))) \\ Colin Barker, Jan 30 2016

Formula

a(n) = 2*a(n - 1) + a(n - 2) if 3 | n, a(n) = a(n - 1) + a(n - 2) if n = 1 mod 3, and a(n) = 2*a(n - 1) - a(n - 2) if n = 2 mod 3.
G.f.: x^2*(1+2*x+5*x^2+2*x^3-x^4) / (1-5*x^3+x^6). - Colin Barker, Jan 08 2013

Extensions

New name from Colin Barker and Charles R Greathouse IV, Jan 08 2013

A142881 a(0) = 0, a(1) = 1, after which, if n=3k: a(n) = 2*a(n-1) - a(n-2), if n=3k+1: a(n) = a(n-1) + a(n-2), if n=3k+2: a(n) = 2*a(n-1) + a(n-2).

Original entry on oeis.org

0, 1, 2, 3, 5, 13, 21, 34, 89, 144, 233, 610, 987, 1597, 4181, 6765, 10946, 28657, 46368, 75025, 196418, 317811, 514229, 1346269, 2178309, 3524578, 9227465, 14930352, 24157817, 63245986, 102334155, 165580141, 433494437, 701408733, 1134903170
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 28 2008

Keywords

Comments

The original name of the sequence was: A modulo three switched recursion (third kind): a(n)=If[Mod[n, 3] ==2, 2*a(n - 1) + a(n - 2), If[Mod[n, 3] == 1, a(n - 1) + a(n - 2), 2*a(n - 1) - a(n - 2)]].
How is this related to A000045 ? - Antti Karttunen, Jan 29 2016

Crossrefs

Programs

  • Mathematica
    Clear[a, n]; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[Mod[n, 3] == 2, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 1, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]]; b = Table[a[n], {n, 0, 50}]
  • PARI
    a=vector(100); a[1]=1; a[2]=2; for(n=3, #a, if(n%3==0, a[n]=2*a[n-1]-a[n-2], if(n%3==1, a[n]=a[n-1]+a[n-2], a[n]=2*a[n-1]+a[n-2]))); concat(0, a) \\ Colin Barker, Jan 30 2016

Formula

a(n) = If[Mod[n, 3] == 2, 2*a(n - 1) + a(n - 2), If[Mod[n, 3] == 1, a(n - 1) + a(n - 2), 2*a(n - 1) - a(n - 2)]].
a(n) = 7*a(n-3)-a(n-6). G.f.: -x^2*(x^4+2*x^3-3*x^2-2*x-1) / (x^6-7*x^3+1). [Colin Barker, Jan 08 2013]
a(0) = 0, a(1) = 1, after which, if n is a multiple of 3, a(n) = 2*a(n-1) - a(n-2), else, if n is of the form 3k+1, a(n) = a(n-1) + a(n-2), and otherwise [when n is of the form 3k+2], a(n) = 2*a(n-1) + a(n-2). - Antti Karttunen, Jan 29 2016, after the original name of the sequence.

Extensions

Offset corrected and sequence edited by Antti Karttunen, Jan 29 2016

A157126 Expansion of (1-2x-3x^2+x^3-x^5)/(1+4x^3+x^6).

Original entry on oeis.org

1, -2, -3, -3, 8, 11, 11, -30, -41, -41, 112, 153, 153, -418, -571, -571, 1560, 2131, 2131, -5822, -7953, -7953, 21728, 29681, 29681, -81090, -110771, -110771, 302632, 413403, 413403, -1129438, -1542841, -1542841, 4215120, 5757961, 5757961
Offset: 0

Views

Author

Paul Barry, Feb 23 2009

Keywords

Comments

Hankel transform of A157125.

Crossrefs

Cf. A048788.

Programs

  • Mathematica
    CoefficientList[Series[(1-2x-3x^2+x^3-x^5)/(1+4x^3+x^6),{x,0,40}],x] (* or *) LinearRecurrence[{0,0,-4,0,0,-1},{1,-2,-3,-3,8,11},40] (* Harvey P. Dale, Jan 16 2013 *)

Formula

a(0)=1, a(1)=-2, a(2)=-3, a(3)=-3, a(4)=8, a(5)=11, a(n)=-4*a(n-3)-a(n-6). - Harvey P. Dale, Jan 16 2013

A363165 The number of spanning trees of the ladder graph L_n up to automorphisms of L_n.

Original entry on oeis.org

1, 1, 6, 17, 59, 204, 750, 2746, 10215, 37936, 141468, 527283, 1967449, 7340090, 27392124, 102219380, 381482477, 1423676862, 5313214098, 19829053909, 74002960983, 276182321224, 1030726172586, 3846720619566, 14356155740947, 53577895814828, 199955425410792
Offset: 1

Views

Author

Mithra Karamchedu and Lucas Bang, Jul 06 2023

Keywords

Comments

The ladder graph L_n is the 2 X n grid graph.
L_n has two automorphisms when n = 1, eight automorphisms when n = 2, and four automorphisms when n >= 3.
When n = 1, Aut(L_n) = D_2; when n = 2, Aut(L_n) = D_8 (D_n is the dihedral group of order n). When n >= 3, Aut(L_n) = {e, h, v, r}, consisting of the identity (e), horizontal flip (h), vertical flip (v), and rotation (r = hv). For n >= 3, Aut(L_n) is isomorphic to the Klein four-group.

Examples

			For n = 3, the a(3) = 6 nonequivalent spanning trees are:
+   +   +---+   +---+   +   +   +   +   +---+
|   |   |       |       |   |   |   |   |
+---+   +---+   +---+   +---+   +   +   +   +
    |   |           |   |   |   |   |   |   |
+---+   +---+   +---+   +   +   +---+   +---+
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1 || n == 2, 1, FullSimplify[n/4 + ((2 + Sqrt[3])^n - (2 -Sqrt[3])^n)/(8*Sqrt[3]) + If [OddQ[n], ((2 + Sqrt[3])^(n/2) + (2 - Sqrt[3])^(n/2))/(2*Sqrt[6]), ((2 + Sqrt[3])^(n/2) - (2 - Sqrt[3])^(n/2))/(4*Sqrt[3])]]]

Formula

a(1) = 1, a(2) = 1, for n >= 3:
a(n) = A001353(n)/4 + A048788(n)/2 + n/4, for n odd, and
a(n) = A001353(n)/4 + A001353(n/2)/2 + n/4, for n even.
For n >= 3, a closed form is:
a(n) = ((2 + sqrt(3))^n - (2 - sqrt(3))^n)/(8*sqrt(3)) + ((2 + sqrt(3))^(n/2) + (2 - sqrt(3))^(n/2))/(2*sqrt(6)) + n/4, for n odd, and
a(n) = ((2 + sqrt(3))^n - (2 - sqrt(3))^n)/(8*sqrt(3)) + ((2 + sqrt(3))^(n/2) - (2 - sqrt(3))^(n/2))/(4*sqrt(3)) + n/4, for n even.
a(n) = 6*a(n-1) - 6*a(n-2) - 18*a(n-3) + 38*a(n-4) - 18*a(n-5) - 6*a(n-6) + 6*a(n-7) - a(n-8) for n > 10. - Peter Kagey, Jul 08 2023
G.f.: x*(1 - 5*x + 6*x^2 + 5*x^3 - 27*x^4 + 40*x^5 - 18*x^6 - 6*x^7 + 6*x^8 - x^9)/((1 - x)^2*(1 - 4*x + x^2)*(1 - 4*x^2 + x^4)). - Stefano Spezia, Jul 09 2023

A121720 a(n) = 4*a(n-2) - 2*a(n-4).

Original entry on oeis.org

0, 1, 1, 3, 4, 10, 14, 34, 48, 116, 164, 396, 560, 1352, 1912, 4616, 6528, 15760, 22288, 53808, 76096, 183712, 259808, 627232, 887040, 2141504, 3028544, 7311552, 10340096, 24963200, 35303296, 85229696, 120532992, 290992384, 411525376, 993510144, 1405035520
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 07 2006

Keywords

Comments

For n>1, number of walks of length n-2 on the 5-vertex graph with edges {{0,1}, {1,2}, {2,3}, {2,4}} starting at vertex 3. - Sean A. Irvine, Jun 03 2025

Crossrefs

Essentially the same as A007068.

Programs

  • Mathematica
    LinearRecurrence[{0,4,0,-2},{0,1,1,3},30] (* Harvey P. Dale, May 21 2014 *)

Formula

a(n) = A007068(n-2), n>2.
G.f.: -x^2*(-1-x+x^2)/(1-4*x^2+2*x^4). [Oct 14 2009]

Extensions

Definition replaced by recurrence - The Assoc. Editors of the OEIS, Oct 14 2009
More terms from Harvey P. Dale, May 21 2014
Showing 1-10 of 12 results. Next