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)

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

Original entry on oeis.org

0, 2, 8, 30, 112, 418, 1560, 5822, 21728, 81090, 302632, 1129438, 4215120, 15731042, 58709048, 219105150, 817711552, 3051741058, 11389252680, 42505269662, 158631825968, 592022034210, 2209456310872, 8245803209278, 30773756526240
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n-1) and a(n+1) are the solutions for c if b = a(n) in (b^2 + c^2)/(b*c + 1) = 4 and there are no other pairs of solutions apart from consecutive pairs of terms in this sequence. Cf. A061167. - Henry Bottomley, Apr 18 2001
a(n)^2 for n >= 1 gives solutions to A007913(3*x+4) = A007913(x). - Benoit Cloitre, Apr 07 2002
For all terms k of the sequence, 3*k^2 + 4 is a perfect square. Limit_{n->oo} a(n)/a(n-1) = 2 + sqrt(3). - Gregory V. Richardson, Oct 06 2002
a(n) = the number of compositions of the integer 2*n into even parts, where each part 2*i comes in 2*i colors. (Dedrickson, Theorem 3.2.6) An example is given below. Cf. A052529, A095263. - Peter Bala, Sep 17 2013
Except for an initial 1, this is the p-INVERT of (1, 1, 1, 1, 1, ...) for p(S) = 1 - 2*S - 2*S^2; see A291000. - Clark Kimberling, Aug 24 2017
a(n+1) is the number of spanning trees of the graph P_n, where P_n is a 2 X n grid with two additional vertices, u and v, where u is adjacent to (1,1) and (2,1), and v is adjacent to (1,n) and (2,n). - Kevin Long, May 04 2018
a(n) is also the output of Tesler's formula for the number of perfect matchings of an m X n Mobius band where m is even and n is odd, specialized to m=2. (The twist is on the length-n side.) - Sarah-Marie Belcastro, Feb 15 2022
In general, values of x and y which satisfy (x^2 + y^2)/(x*y + 1) = k^2 are any two adjacent terms of a second-order recurrence with initial terms 0 and k and signature (k^2,-1). This can also be expressed as a first-order recurrence a(n+1) = (k^2*a(n) + sqrt((k^4-4)*a(n)^2 + 4*k^2))/2, n > 1. - Gary Detlefs, Feb 27 2024

Examples

			Colored compositions. a(2) = 8: There are two compositions of 4 into even parts, namely 4 and 2 + 2. Using primes to indicate the coloring of parts, the 8 colored compositions are 4, 4', 4'', 4''', 2 + 2, 2 + 2', 2' + 2 and 2' + 2'. - _Peter Bala_, Sep 17 2013
		

Crossrefs

Programs

  • Haskell
    a052530 n = a052530_list !! n
    a052530_list =
       0 : 2 : zipWith (-) (map (* 4) $ tail a052530_list) a052530_list
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Magma
    I:=[0,2]; [n le 2 select I[n] else 4*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Feb 25 2019
    
  • Maple
    spec := [S,{S=Sequence(Prod(Union(Z,Z),Sequence(Z),Sequence(Z)))},unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
    s := sqrt(3): a := n -> ((2-s)^n-(s+2)^n)/(s*(s-2)*(s+2)):
    seq(simplify(a(n)), n=0..24); # Peter Luschny, Apr 28 2020
  • Mathematica
    p=1; c=2; a[0]=0; a[1]=c; a[n_]:=a[n]=p*c^2*a[n-1]-a[n-2]; Table[a[n], {n, 0, 20}]
    NestList[2 # + Sqrt[4 + 3 #^2]&, 0, 200] (* Zak Seidov, Mar 31 2011 *)
    LinearRecurrence[{4, -1}, {0, 2}, 25] (* T. D. Noe, Jan 09 2012 *)
    CoefficientList[Series[2x/(1-4x+x^2),{x,0,30}],x] (* Harvey P. Dale, May 31 2023 *)
  • PARI
    { polya002(p,c,m) = local(v,w,j,a); w=0; print1(w,", "); v=c; print1(v,", "); j=1; while(j<=m,a=p*c^2*v-w; print1(a,", "); w=v; v=a; j++) };
    polya002(1,2,25)
    
  • PARI
    my(x='x+O('x^30)); concat([0], Vec(2*x/(1-4*x+x^2))) \\ G. C. Greubel, Feb 25 2019
    
  • PARI
    first(n) = n = max(n, 2); my(res = vector(n)); res[1] = 0; res[2] = 2; for(i = 3, n, res[i] = 4 * res[i-1] - res[i-2]); res \\ David A. Corneth, Apr 28 2020
    
  • Sage
    (2*x/(1-4*x+x^2)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019

Formula

G.f.: 2*x/(1 - 4*x + x^2).
Invert transform of even numbers: a(n) = 2*Sum_{k=1..n} k*a(n-k). - Vladeta Jovovic, Apr 27 2001
From Gregory V. Richardson, Oct 06 2002: (Start)
a(n) = Sum_{alpha} -(1/3)*(-1 + 2*alpha)*alpha^(-1 - n), alpha = root of (1 - 4*Z + Z^2).
a(n) = (((2+sqrt(3))^(n+1) - (2-sqrt(3))^(n+1)) - ((2+sqrt(3))^n - (2-sqrt(3))^n) + ((2+sqrt(3))^(n-1) - (2-sqrt(3))^(n-1)))/(3*sqrt(3)). (End)
a(n) = A071954(n) - 2. - N. J. A. Sloane, Feb 20 2005
a(n) = (2*sinh(2n*arcsinh(1/sqrt(2))))/sqrt(3). - Herbert Kociemba, Apr 24 2008
a(n) = 2*A001353(n). - R. J. Mathar, Oct 26 2009
a(n) = ((3 - 2*sqrt(3))/3)*(2 - sqrt(3))^(n - 1) + ((3 + 2*sqrt(3))/3)*(2 + sqrt(3))^(n - 1). - Vincenzo Librandi, Nov 20 2010
a(n) = floor((2 + sqrt(3))^n/sqrt(3)). - Zak Seidov, Mar 31 2011
a(n) = ((2 + sqrt(3))^n - (2 - sqrt(3))^n)/sqrt(3). (See Horadam for construction.) - Johannes Boot, Jan 08 2012
a(n) = A217233(n) + A217233(n-1) with A217233(-1) = -1. - Bruno Berselli, Oct 01 2012
a(n) = A001835(n+1) - A001835(n). - Kevin Long, May 04 2018
E.g.f.: (exp((2 + sqrt(3))*x) - exp((2 - sqrt(3))*x))/sqrt(3). - Franck Maminirina Ramaharo, Nov 12 2018
a(n+1) = 2*a(n) + sqrt(3*a(n)^2 + 4), n > 1. - Gary Detlefs, Feb 27 2024

Extensions

More terms from James Sellers, Jun 06 2000
Edited by N. J. A. Sloane, Nov 11 2006
a(0) changed to 0 and entry revised accordingly by Max Alekseyev, Nov 15 2007
Signs in definition corrected by John W. Layman, Nov 20 2007

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

Original entry on oeis.org

2, 4, 10, 32, 114, 420, 1562, 5824, 21730, 81092, 302634, 1129440, 4215122, 15731044, 58709050, 219105152, 817711554, 3051741060, 11389252682, 42505269664, 158631825970, 592022034212, 2209456310874, 8245803209280, 30773756526242, 114849222895684
Offset: 0

Views

Author

Lekraj Beedassy, Jun 25 2002

Keywords

Comments

a(n) gives the side of a cube having a square number of cubes in its two outermost layers, i.e., solutions p to the equation p^3 - (p - 4)^3 = q^2. The corresponding q is given by 4*A001075(n).

Examples

			G.f. = 2 + 4*x + 10*x^2 + 32*x^3 + 114*x^4 + 420*x^5 + 1562*x^6 + ...
		

References

  • M. E. Larsen, "Four Cubes" in Puzzler's Tribute, Ed. D. Wolfe & T. Rodgers, pp. 69-70, A. K. Peters, MA, 2002

Crossrefs

Equals A052530(n) + 2, n > 0.

Programs

  • GAP
    a:=[2,4,10];; for n in [4..30] do a[n]:=5*a[n-1]-5*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Feb 25 2019
  • Haskell
    a071954 n = a071954_list !! n
    a071954_list = 2 : 4 : zipWith (-)
                   (map ((4 *) . pred) (tail a071954_list)) a071954_list
    -- Reinhard Zumkeller, Aug 11 2011
    
  • Magma
    I:=[2,4,10]; [n le 3 select I[n] else 5*Self(n-1) -5*Self(n-2) + Self(n-3): n in [1..30]]; // G. C. Greubel, Feb 25 2019
    
  • Mathematica
    a[n_]:= a[n] = 4*a[n-1] -a[n-2] -4; a[0]=2; a[1]=4; Table[a[n], {n,0,30}]
    LinearRecurrence[{5,-5,1},{2,4,10},30] (* Harvey P. Dale, May 05 2011 *)
  • PARI
    Vec((2-6*x)/(1-5*x+5*x^2-x^3)+O(x^30)) \\ Charles R Greathouse IV, Feb 09 2012
    
  • PARI
    {a(n) = my(w=quadgen(12)); simplify( 2 + ((2+w)^n - (2-w)^n) / w)}; /* Michael Somos, Nov 03 2016 */
    
  • Sage
    (2*(1-3*x)/((1-x)*(1-4*x+x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019
    

Formula

a(n) = 5*a(n-1) - 5*a(n-2) + a(n-3) for n > 2, with a(0) = 2, a(1) = 4, a(2) = 10.
G.f.: 2*(1 - 3*x)/((1-x)*(1 -4*x +x^2)). - Harvey P. Dale, May 05 2011
a(n) = (2 + (-(2 - sqrt(3))^n + (2 + sqrt(3))^n)/sqrt(3)). - Colin Barker, Nov 03 2016
A263942(n) = -a(-1-n) for all n in Z. - Michael Somos, Nov 03 2016
E.g.f.: (2/3)*(3*exp(x) + sqrt(3)*exp(2*x)*sinh(sqrt(3)*x)). - Franck Maminirina Ramaharo, Nov 14 2018
From G. C. Greubel, Feb 25 2019: (Start)
a(n) = 2*A072110(n).
a(n) = 2*(1 - (-i)^(n+1)*F(n, 4*i)), where i=sqrt(-1) and F(n,x) is the Fibonacci polynomial. (End)

Extensions

Edited by Robert G. Wilson v, Jun 27 2002

A359855 Array read by antidiagonals: T(n,k) is the number of Hamiltonian cycles in the stacked prism graph P_n X C_k, n >= 1, k >= 2.

Original entry on oeis.org

1, 1, 4, 1, 3, 4, 1, 6, 6, 4, 1, 5, 22, 12, 4, 1, 8, 30, 82, 24, 4, 1, 7, 86, 160, 306, 48, 4, 1, 10, 126, 776, 850, 1142, 96, 4, 1, 9, 318, 1484, 7010, 4520, 4262, 192, 4, 1, 12, 510, 6114, 18452, 63674, 24040, 15906, 384, 4, 1, 11, 1182, 12348, 126426, 229698, 578090, 127860, 59362, 768, 4
Offset: 1

Views

Author

Andrew Howroyd, Feb 18 2025

Keywords

Comments

The case for P_n X C_2 is determined using a double edge for C_2.

Examples

			Array begins:
=========================================================
n\k | 2   3     4      5       6        7          8 ...
----+---------------------------------------------------
  1 | 1   1     1      1       1        1          1 ...
  2 | 4   3     6      5       8        7         10 ...
  3 | 4   6    22     30      86      126        318 ...
  4 | 4  12    82    160     776     1484       6114 ...
  5 | 4  24   306    850    7010    18452     126426 ...
  6 | 4  48  1142   4520   63674   229698    2588218 ...
  7 | 4  96  4262  24040  578090  2861964   53055038 ...
  8 | 4 192 15906 127860 5247824 35663964 1087362018 ...
   ...
		

Crossrefs

Rows 1..2 are A000012, A103889(n+1).
Cf. A222196 (order of recurrences), A222197 (main diagonal), A270273, A321172.

A180582 Number of Hamiltonian cycles in C_6 X P_n.

Original entry on oeis.org

1, 8, 86, 776, 7010, 63674, 578090, 5247824, 47640092, 432480632, 3926091512, 35641352528, 323554871864, 2937255393440, 26664624744320, 242063463190976, 2197470272854016, 19948799940346880, 181096701955896896, 1644009442040416928, 14924441010395894048, 135485194778650515104
Offset: 1

Views

Author

Artem M. Karavaev, Sep 10 2010

Keywords

Crossrefs

Programs

  • PARI
    a(n) = if(n<1, 0, if(n<=8, [1, 8, 86, 776, 7010, 63674, 578090, 5247824][n], -12*a(n-7) - 32*a(n-6) - 36*a(n-5) - 28*a(n-4) + 10*a(n-3) + 9*a(n-1) ) );
    /* Joerg Arndt, Sep 02 2012 */
    
  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A180582(n):
        universe = make_CnXPk(6, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles(is_hamilton=True)
        return cycles.len()
    print([A180582(n) for n in range(1, 30)])  # Seiichi Manyama, Nov 25 2020

Formula

a(n) = -12*a(n-7) - 32*a(n-6) - 36*a(n-5) - 28*a(n-4) + 10*a(n-3) + 9*a(n-1) for n > 8.
G.f.: x*(x +1)*(6*x^6 -14*x^5 -2*x^4 -24*x^3 +16*x^2 -2*x +1)/(12*x^7 +32*x^6 +36*x^5 +28*x^4 -10*x^3 -9*x +1). - Colin Barker, Sep 01 2012

A120893 a(n) = 3*a(n-1) + 3*a(n-2) - a(n-3); a(0)=1, a(1)=1, a(2)=5.

Original entry on oeis.org

1, 1, 5, 17, 65, 241, 901, 3361, 12545, 46817, 174725, 652081, 2433601, 9082321, 33895685, 126500417, 472105985, 1761923521, 6575588101, 24540428881, 91586127425, 341804080817, 1275630195845, 4760716702561, 17767236614401
Offset: 0

Views

Author

Lekraj Beedassy, Jul 14 2006

Keywords

Comments

For n>1, hypotenuse of primitive Pythagorean triangles having an angle nearing Pi/3 for larger values of sides. Complete triple (X,Y,Z),XA120892(n),Y=A001353(n),Z=a(n) with recurrence relations X(i+1)=2*{a(i)-(-1)^i}-X(i-1) ; Y(i+1)=2*T(i)-T(i-1)-(-1)^i, where T(i)=Y(i)+a(i)] a(n)=2*A120892(n)-(-1)^n.

Programs

  • Magma
    [Floor(((-1)^n+(2-Sqrt(3))^n+(2+Sqrt(3))^n)/3): n in [0..40]]; // Vincenzo Librandi, Jul 09 2012
  • Maple
    a[0]:=1: a[1]:=1: a[2]:=5: for n from 3 to 40 do a[n]:=3*a[n-1]+3*a[n-2]-a[n-3] od: seq(a[n],n=0..30); # Emeric Deutsch, Jul 24 2006
  • Mathematica
    Transpose[NestList[Flatten[{Rest[#],3Last[#]+3#[[2]]- First[#]}]&, {1,1,5},25]][[1]] (* or *)
    CoefficientList[Series[(1-2 x-x^2)/(1-3 x-3 x^2+x^3),{x,0,25}],x]  (* Harvey P. Dale, Mar 27 2011 *)

Formula

Union of A103772 and A103974. a(n)=2*{2*a(n-1) + (-1)^n} - a(n-2) ; a(0)=1,a(1)=1.
a(n) = [(-1)^n+(2-sqrt(3))^n+(2+sqrt(3))^n]/3. - Emeric Deutsch, Jul 24 2006
O.g.f: -(-1+2*x+x^2)/((1+x)*(x^2-4*x+1)). - R. J. Mathar, Dec 02 2007
a(n)+a(n+1) = A003699(n+1), n>0. - R. J. Mathar, Oct 15 2013

Extensions

More terms from Emeric Deutsch, Jul 24 2006

A339137 Number of (undirected) cycles in the graph C_4 X P_n.

Original entry on oeis.org

1, 28, 225, 1540, 10217, 67388, 444017, 2925140, 19270105, 126946444, 836290209, 5509263332, 36293601737, 239092863324, 1575081964113, 10376232739316, 68355938510649, 450311249502892, 2966534083948417, 19542759549039748, 128742647137776169, 848123272992954492
Offset: 1

Views

Author

Seiichi Manyama, Nov 25 2020

Keywords

Crossrefs

Cf. A003699 (Hamiltonian cycles), A288637, A339075, A339136, A339140, A339142, A339143.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339137(n):
        universe = make_CnXPk(4, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A339137(n) for n in range(1, 20)])

Formula

Empirical g.f.: -x*(6*x^3+29*x^2-18*x-1) / ((x-1)^2 * (2*x^3+9*x^2-8*x+1)). - Vaclav Kotesovec, Dec 09 2020

A180583 Number of Hamiltonian cycles in C_7 X P_n.

Original entry on oeis.org

1, 7, 126, 1484, 18452, 229698, 2861964, 35663964, 444486280, 5539931796, 69048910000, 860620499760, 10726732430288, 133697577587000, 1666401898058352, 20769976722986288, 258876295158900832, 3226625529605854320, 40216553455854426560, 501257787787122948736
Offset: 1

Views

Author

Artem M. Karavaev, Sep 10 2010

Keywords

Crossrefs

Formula

a(n) = -16a(n-12) + 128a(n-11) + 496a(n-10) + 2040a(n-9) + 3724a(n-8) + 2064a(n-7) - 196a(n-6) - 772a(n-5) - 440a(n-4) - 112a(n-3) + 18a(n-2) + 12a(n-1) for n > 13.
G.f.: x*(16*x^12 -16*x^11 +8*x^10 -192*x^9 +588*x^8 +1996*x^7 +700*x^6 -474*x^5 -400*x^4 -42*x^3 +24*x^2 -5*x +1)/(16*x^12 -128*x^11 -496*x^10 -2040*x^9 -3724*x^8 -2064*x^7 +196*x^6 +772*x^5 +440*x^4 +112*x^3 -18*x^2 -12*x +1). - Colin Barker, Sep 01 2012

Extensions

a(18) onwards from Andrew Howroyd, Feb 18 2025

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

Original entry on oeis.org

1, 1, 7, 23, 89, 329, 1231, 4591, 17137, 63953, 238679, 890759, 3324361, 12406681, 46302367, 172802783, 644908769, 2406832289, 8982420391, 33522849271, 125108976697, 466913057513, 1742543253359, 6503259955919, 24270496570321, 90578726325361
Offset: 0

Views

Author

Bruno Berselli, Sep 28 2012

Keywords

Comments

Numbers with the property a(n)^2+a(n-1)^2 = 2*(a(n)-a(n-1)-(-1)^n)^2.

Examples

			a(3)=23, a(2)=7: 23^2+7^2 = 2*(23-7-(-1)^3)^2 = 578;
a(6)=1231, a(5)=329: 1231^2+329^2 = 2*(1231-329-(-1)^6)^2 = 1623602.
		

Crossrefs

Cf. A109437 (1/(1-3*x-3*x^2+x^3)), A006253 ((1-x)/(1-3*x-3*x^2+x^3)).

Programs

  • Magma
    m:=26; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-2*x+x^2)/(1-3*x-3*x^2+x^3)));
    
  • Mathematica
    CoefficientList[Series[(1 - 2 x + x^2)/(1 - 3 x - 3 x^2 + x^3), {x, 0, 25}], x]
  • Maxima
    makelist(coeff(taylor((1-2*x+x^2)/(1-3*x-3*x^2+x^3), x, 0, n), x, n), n, 0, 25);
  • PARI
    Vec((1-2*x+x^2)/(1-3*x-3*x^2+x^3)+O(x^26))
    

Formula

G.f.: (1-x)^2/((1+x)*(1-4*x+x^2)).
a(n) = (4*(-2)^n+(1-sqrt(3))^(2*n+1)+(1+sqrt(3))^(2*n+1))/(6*2^n).
a(n) = -a(-n-1) = 3*a(n-1)+3*a(n-2)-a(n-3) = 4*a(n-1)-a(n-2)+4*(-1)^n.
a(n)+a(n-1) = A052530(n) with a(-1)=-1.
a(n)-a(n-2) = A003699(n) with n>1.
Sum(a(i), i=0..n) = A006253(n).

A363348 Turn sequence of a non-Eulerian path for drawing an infinite aperiodic tiling based on the "hat" monotile. See the comments section for details.

Original entry on oeis.org

3, -2, 3, -2, 3, 2, 0, 2, -3, 2, 3, 2, -3, 2, 3, -2, 3, -2, 3, -2, 0, 2, -3, 2, 3, 2, -3, 2, 3, -2, 3, -2, 3, 2, 0, 2, -3, 2, 3, -2, 0, 2, -3, 2, 3, 2, -3, 2, 3, -2, 3, -2, 3, 2, 0, 2, -3, 2, 3, -2, 0, 2, -3, 2, 3, 2, -3, 2, 3, -2, 3, -2, 3, 2, 0, 2, -3, 2, 3, 2, -3, -2, 3, 2, -3, 2, 3, -2, 3, -2
Offset: 1

Views

Author

Thomas Scheuerle, May 28 2023

Keywords

Comments

The curve can be drawn using turtle graphics rules. Each term of the sequence encodes an angle of rotation in units of (1/6)*Pi. For example, a(k) = 3 would mean a turn of 90 degrees to the left, a(k) = -2 a turn of 60 degrees to the right. To draw the tiling we draw a line of length l and then take a term of the sequence to determine the direction of further drawing by rotation relative to the current drawing orientation. The length of the line segments between terms of the sequence is either sqrt(3) or 1 units. We start by drawing with sqrt(3) units of length; every time we reach a term with 3 or -3 in the sequence we toggle the selected line length from sqrt(3) to 1, or back again from 1 to sqrt(3).
The drawing process works by recursion into the H8 metatile and its supertiles; this means a(1..14) draws a single "hat" monotile. Then the terms a(1..140) draw the H8 metatile and a(1..1588) and so forth (see formula section) draw the next larger supertile of the H8 metatile. (For details regarding H8 see page 18 in arXiv:2303.10798.) The number of "hat" tiles visible after k recursions is Fibonacci(4*k + 2) (A033890); however, tiles and line segments will be overdrawn multiple times in this process.

Examples

			We start by drawing a line of length sqrt(3):
___
We take then the first term of the sequence a(1) = 3 this means
we turn our drawing turtle 90 degrees to the left and also switch to a length unit of 1.
___|
We take the second term from the sequence a(2) = -2 this means
we turn our drawing turtle 60 degrees to the right, and we keep the selected line length of 1 unit.
    /
___|
(In this ASCII representation, angles and length units are only symbolically represented and do not match the exact values in the description.)
		

Crossrefs

Cf. A363445 describes a curve around the perimeter of this tiling.

Programs

  • MATLAB
    % See Scheuerle link.
    
  • PARI
    L(k) = { my(v = [0, 14, 140, 1588]); if(k > 3, return(12*L(k-1) - 7*L(k-2) + L(k-3)), return(v[k+1])) }
    r1(k) = if(k > 1, return(r5(k-1) + r1(k-1) + r7(k-1)), return(6))
    r2(k) = if(k > 1, return(r2(k-1) + r7(k-1)), return(6))
    r3(k) = if(k > 1, return(2*r5(k-1) + r3(k-1) + r5(k) + r7(k-1)), return(6))
    r5(k) = if(k > 1, return(r5(k-1) + r3(k-1)), return(2))
    r7(k) = if(k > 1, return(r5(k-1) + 2*r3(k-1)), return(4))
    r8(k) = if(k > 1, return(r12(k-1) + r8(k-1) + r14(k-1)), return(1))
    r9(k) = if(k > 1, return(r9(k-1) + r14(k-1)), return(1))
    r10(k) = if(k > 1, return(2*r13(k-1) + r10(k-1) + r11(k-1) + r14(k-1)), return(1))
    r11(k) = if(k > 1, return(2*r13(k-1) + 3*r10(k-1) + r11(k-1)), return(1))
    r12(k) = if(k > 1, return(r13(k-1) + r10(k-1)), return(1))
    r13(k) = if(k > 1, return(r12(k-1) + r13(k-1) + r14(k-1)), return(1))
    r14(k) = if(k > 1, return(r13(k-1) + 2*r10(k-1)), return(1))
    c1(k) = r2(k) + sum(m=1, k-1, r9(k+1-m)*L(m))
    c2(k) = c1(k) - sum(m=1, k-1, L(m))
    c3(k) = r2(k) + r3(k) + sum(m=1, k-1, (r9(k+1-m) + r10(k+1-m) - 1)*L(m))
    c4(k) = r2(k) + r5(k+1) + sum(m=1, k-1, (r9(k+1-m) + r11(k+1-m) - 1)*L(m))
    c5(k) = r2(k) + r7(k) + sum(m=1, k-1, (r9(k+1-m) + r14(k+1-m) - 2)*L(m))
    c6(k) = c4(k) - sum(m=1, k-1, L(m))
    a(NumIter) = { my(a = [3, -2, 3, -2, 3, 2, 0, 2, -3, 2, 3, 2, -3, 2]); for(k = 1, NumIter, a = concat([a, a[1..(c1(k)-1)], -a[c1(k)], a[(c2(k)+1)..L(k)], a[1..(c3(k)-1)], -a[c3(k)], a[(c2(k)+1)..L(k)], a[1..(c3(k)-1)], -a[c3(k)], a[(c2(k)+1)..L(k)], a[1..(c4(k)-1)], -a[c4(k)], a[(c5(k)+1)..L(k)], a[1..(c3(k)-1)], -a[c3(k)], a[(c2(k)+1)..L(k)], a[1..(c3(k)-1)], -a[c3(k)],  a[(c2(k)+1)..L(k)], a[1..(c4(k)-1)], -a[c4(k)], a[(c6(k)+1)..L(k)]]) ); return(a) }
    draw(NumIter) = {my(p = [0, sqrt(3)]); my(dl = [1]); my(s = a(NumIter)); for(j=2, length(s), dl = concat(dl, ((dl[j-1]+(abs(s[j-1])==3))%2)); p = concat(p, p[j]+sqrt(1+2*dl[j])*exp(I*Pi*vecsum(s[1..j-1])*(1/6)) )); plothraw(apply(real, p), apply(imag, p), 1); }

Formula

a(1..14) = {3,-2, 3,-2, 3, 2, 0, 2, -3, 2, 3, 2,-3, 2} = a(1..L(1)) and for k > 0:
a(1..L(k+1)) = {a(1..L(k)), a(1..c1(k)-1), -a(c1(k)), a(c2(k)+1..L(k)), a(1..c3(k)-1), -a(c3(k)), a(c2(k)+1..L(k)), a(1..c3(k)-1), -a(c3(k)), a(c2(k)+1..L(k)), a(1..c4(k)-1), -a(c4(k)), a(c5(k)+1..L(k)), a(1..c3(k)-1), -a(c3(k)), a(c2(k)+1..L(k)), a(1..c3(k)-1), -a(c3(k)), a(c2(k)+1..L(k)), a(1..c4(k)-1), -a(c4(k)), a(c6(k)+1..L(k))}. With:
L(k) = 12*L(k-1) - 7*L(k-2) + L(k-3) for k > 3 with L(1..3) = {14, 140, 1588}.
r1(k) = r5(k-1) + r1(k-1) + r7(k-1), with r1(1) = 6.
r2(k) = r2(k-1) + r7(k-1), with r2(1) = 6.
r3(k) = 2*r6(k-1) + r3(k-1) + r4(k-1) + r7(k-1), with r3(1) = 6 (A003699).
r4(k) = r5(k+1) = 2*r5(k-1) + 3*r3(k-1) + r4(k-1), with r4(1) = 8 (A052530).
r5(k) = r5(k-1) + r3(k-1), with r5(1) = 2. r4, r5, r6 are in the case of this tiling accidentally essentially the same recurrence.
r6(k) = r5(k) = r5(k-1) + r6(k-1) + r7(k-1), with r6(1) = 2 (A052530).
r7(k) = r6(k-1) + 2*r3(k-1), with r7(1) = 4 (A003500).
r8(k) = r12(k-1) + r8(k-1) + r14(k-1), with r8(1) = 1
r9(k) = r9(k-1) + r14(k-1), with r9(1) = 1.
r10(k) = 2*r13(k-1) + r10(k-1) + r11(k-1) + r14(k-1), with r10(1) = 1 (A061278).
r11(k) = 2*r13(k-1) + 3*r10(k-1) + r11(k-1), with r11(1) = 1.
r12(k) = r13(k-1) + r10(k-1), with r12(1) = 1.
r13(k) = r12(k-1) + r13(k-1) + r14(k-1), with r13(1) = 1.
r14(k) = r13(k-1) + 2*r10(k-1), with r14(1) = 1 (A108946 unsigned).
c1(k) = r2(k) + Sum_{m=1..k-1} (r9(k+1-m)*L(m)) = {6, 38, 374, 4204, ...}.
c2(k) = c1(k) - Sum_{m=1..k-1} L(m) = {6, 24, 220, 2462, ...}.
c3(k) = r2(k) + r3(k) + Sum_{m=1..k-1} ((r9(k+1-m) + r10(k+1-m) - 1)*L(m)) = {12, 116, 1282, 14572, ...}.
c4(k) = r2(k) + r4(k) + Sum_{m=1..k-1} ((r9(k+1-m) + r11(k+1-m) - 1)*L(m)) = {14, 138, 1550, 17630, ...}.
c5(k) = r2(k) + r7(k) + Sum_{m=1..k-1} ((r9(k+1-m) + r14(k+1-m) - 2)*L(m)) = {10, 66, 720, 8170, ...}.
c6(k) = c4(k) - Sum_{m=1..k-1} L(m) = {14, 124, 1396, 15888, ...}.
Description of curve position:
OrientationAngle(n) = Sum_{k = 1..n-1} a(k)*Pi*(1/6).
Xcoordinate(n) = Sum_{k = 1..n} cos(OrientationAngle(n))*sqrt(1 + 2*((1 + Sum_{k = 1..n-1} [abs(a(k)) = 3]) mod 2)).
Ycoordinate(n) = Sum_{k = 1..n} sin(OrientationAngle(n))*sqrt(1 + 2*((1 + Sum_{k = 1..n-1} [abs(a(k)) = 3]) mod 2)). [] is the Iverson bracket here.
Showing 1-10 of 12 results. Next