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

A038754 a(2n) = 3^n, a(2n+1) = 2*3^n.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.
Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - Gary W. Adamson, May 15 2010
The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - Johannes W. Meijer, May 29 2010
a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - Vladimir Shevelev, May 16 2012
A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - Vladimir Shevelev, May 21 2012
Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - R. J. Mathar, Aug 10 2012
Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - Eric M. Schmidt, Jul 31 2013
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, Jun 05 2014
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 1. - Sean A. Irvine, Jun 03 2025

Examples

			In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a038754 n = a038754_list !! n
    a038754_list = concat $ transpose [a000244_list, a008776_list]
    -- Reinhard Zumkeller, Oct 19 2015
    
  • Magma
    [n le 2 select n else 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 18 2016
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # Zerinvary Lajos, Mar 20 2008
    with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{0,3},{1,2},40] (* Harvey P. Dale, Jan 26 2014 *)
    CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 18 2016 *)
    Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)
    
  • PARI
    a(n)=3^(n>>1)<
    				
  • SageMath
    [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.
a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.
From Benoit Cloitre, Apr 27 2003: (Start)
a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.
a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).
a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).
a(2*n+1) = a(2*n) + a(2*n-1). (End)
G.f.: (1+2*x)/(1-3*x^2). - Paul Barry, Aug 25 2003
From Reinhard Zumkeller, Sep 11 2003: (Start)
a(n) = (1 + n mod 2) * 3^floor(n/2).
a(n) = A087503(n) - A087503(n-1). (End)
a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - Paul Barry, Sep 16 2003
From Reinhard Zumkeller, May 26 2008: (Start)
a(n) = A140740(n+2,2).
a(n+1) = a(n) + a(n - n mod 2). (End)
If p(i) = Fibonacci(i-3) and if A is the 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) = (-1)^n det A. - Milan Janjic, May 08 2010
a(n) = A182751(n) for n >= 2. - Jaroslav Krizek, Nov 27 2010
a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - Vladimir Shevelev, May 16 2012
a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - Vladimir Shevelev, May 21 2012
Sum_(n>=0) 1/a(n) = 9/4. - Alexander R. Povolotsky, Aug 24 2012
a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - Richard R. Forberg, Sep 04 2013
a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Aug 11 2014
From Reinhard Zumkeller, Oct 19 2015: (Start)
a(2*n) = A000244(n), a(2*n+1) = A008776(n).
For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)
E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - Stefano Spezia, Feb 17 2022
Sum_{n>=0} (-1)^n/a(n) = 3/4. - Amiram Eldar, Dec 02 2022

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

Original entry on oeis.org

1, 2, 6, 20, 68, 232, 792, 2704, 9232, 31520, 107616, 367424, 1254464, 4283008, 14623104, 49926400, 170459392, 581984768, 1987020288, 6784111616, 23162405888, 79081400320, 270000789504, 921840357376, 3147359850496
Offset: 0

Views

Author

Keywords

Comments

Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = 4, s(2n) = 4. - Herbert Kociemba, Jun 12 2004
a(n-1) counts permutations pi on [n] for which the pairs {i, pi(i)} with i < pi(i), considered as closed intervals [i+1,pi(i)], do not overlap; equivalently, for each i in [n] there is at most one j <= i with pi(j) > i. Counting these permutations by the position of n yields the recurrence relation. - David Callan, Sep 02 2003
a(n) is the sum of (n+1)-th row terms of triangle A140070. - Gary W. Adamson, May 04 2008
The binomial transform is in A083878, the Catalan transform in A084868. - R. J. Mathar, Nov 23 2008
Equals row sums of triangle A152252. - Gary W. Adamson, Nov 30 2008
Counts all paths of length (2*n), n >= 0, starting at the initial node on the path graph P_7, see the second Maple program. - Johannes W. Meijer, May 29 2010
From L. Edson Jeffery, Apr 04 2011: (Start)
Let U_1 and U_3 be the unit-primitive matrices (see [Jeffery])
U_1 = U_(8,1) = [(0,1,0,0); (1,0,1,0); (0,1,0,1); (0,0,2,0)] and
U_3 = U_(8,3) = [(0,0,0,1); (0,0,2,0); (0,2,0,1); (2,0,2,0)]. Then a(n) = (1/4) * Trace(U_1^(2*n)) = (1/2^(n+2)) * Trace(U_3^(2*n)). (See also A084130, A001333.) (End)
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... - R. J. Mathar, Aug 10 2012
a(n) is the first superdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
Conjecture: With offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). For example, the 4 permutations of [4] not counted by a(4) are 1324, 1423, 2314, 2413. - David Callan, Aug 27 2014
The conjecture of David Callan above is correct - with offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). - Yonah Biers-Ariel, Jun 27 2017
From Gary W. Adamson, Jul 22 2016: (Start)
A production matrix for the sequence is M =
1, 1, 0, 0, 0, 0, ...
1, 0, 3, 0, 0, 0, ...
1, 0, 0, 3, 0, 0, ...
1, 0, 0, 0, 3, 0, ...
1, 0, 0, 0, 0, 3, ...
...
Take powers of M, extracting the upper left terms; getting the sequence starting: (1, 1, 2, 6, 20, 68, ...). (End)
From Gary W. Adamson, Jul 24 2016: (Start)
The sequence is the INVERT transform of the powers of 3 prefaced with a "1": (1, 1, 3, 9, 27, ...) and is N=3 in an infinite of analogous sequences starting:
N=1 (A000079): 1, 2, 4, 8, 16, 32, ...
N=2 (A001519): 1, 2, 5, 13, 34, 89, ...
N=3 (A006012): 1, 2, 6, 20, 68, 232, ...
N=4 (A052961): 1, 2, 7, 29, 124, 533, ...
N=5 (A154626): 1, 2, 8, 40, 208, 1088, ...
N=6: 1, 2, 9, 53, 326, 2017, ...
... (End)
Number of permutations of length n > 0 avoiding the partially ordered pattern (POP) {1>2, 1>3, 4>2, 4>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first and fourth elements are larger than the second and third elements. - Sergey Kitaev, Dec 08 2020
a(n-1) is the number of permutations of [n] that can be obtained by placing n points on an X-shape (two crossing lines with slopes 1 and -1), labeling them 1,2,...,n by increasing y-coordinate, and then reading the labels by increasing x-coordinate. - Sergi Elizalde, Sep 27 2021
Consider a stack of pancakes of height n, where the only allowed operation is reversing the top portion of the stack. First, perform a series of reversals of decreasing sizes, followed by a series of reversals of increasing sizes. The number of distinct permutations of the initial stack that can be reached through these operations is a(n). - Thomas Baruchel, May 12 2025
Number of permutations of [n] that are correctly sorted after performing one left-to-right pass and one right-to-left pass of the cocktail sort. - Thomas Baruchel, May 16 2025

References

  • D. H. Greene and D. E. Knuth, Mathematics for the Analysis of Algorithms. Birkhäuser, Boston, 3rd edition, 1990, p. 86.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 5.4.8 Answer to Exer. 8.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006012 n = a006012_list !! n
    a006012_list = 1 : 2 : zipWith (-) (tail $ map (* 4) a006012_list)
    (map (* 2) a006012_list)
    -- Reinhard Zumkeller, Oct 03 2011
    
  • Magma
    [n le 2 select n else 4*Self(n-1)- 2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Apr 05 2011
    
  • Maple
    A006012:=-(-1+2*z)/(1-4*z+2*z**2); # Simon Plouffe in his 1992 dissertation
    with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=24; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..7); od: seq(a(2*n),n=0..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{4,-2},{1,2},50] (* or *) With[{c=Sqrt[2]}, Simplify[ Table[((2+c)^n+(3+2c)(2-c)^n)/(2(2+c)),{n,50}]]] (* Harvey P. Dale, Aug 29 2011 *)
  • PARI
    {a(n) = real(((2 + quadgen(8))^n))}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    {a(n) = if( n<0, 2^n, 1) * polsym(x^2 - 4*x + 2, abs(n))[abs(n)+1] / 2}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    Vec((1-2*x)/(1-4*x+2*x^2) + O(x^100)) \\ Altug Alkan, Dec 05 2015
    
  • Python
    l = [1, 2]
    for n in range(2, 101): l.append(4 * l[n - 1] - 2 * l[n - 2])
    print(l)  # Indranil Ghosh, Jul 02 2017
    
  • SageMath
    A006012=BinaryRecurrenceSequence(4,-2,1,2)
    print([A006012(n) for n in range(41)]) # G. C. Greubel, Aug 27 2025

Formula

G.f.: (1-2*x)/(1 - 4*x + 2*x^2).
a(n) = 2*A007052(n-1) = A056236(n)/2.
Limit_{n -> oo} a(n)/a(n-1) = 2 + sqrt(2). - Zak Seidov, Oct 12 2002
From Paul Barry, May 08 2003: (Start)
Binomial transform of A001333.
E.g.f.: exp(2*x)*cosh(sqrt(2)*x). (End)
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*2^(n-k) = Sum_{k=0..n} binomial(n, k)*2^(n-k/2)(1+(-1)^k)/2. - Paul Barry, Nov 22 2003 (typo corrected by Manfred Scheucher, Jan 17 2023)
a(n) = ((2+sqrt(2))^n + (2-sqrt(2))^n)/2.
a(n) = Sum_{k=0..n} 2^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n) = A007070(n) - 2*A007070(n-1). - R. J. Mathar, Nov 16 2007
a(n) = Sum_{k=0..n} A147703(n,k). - Philippe Deléham, Nov 29 2008
a(n) = Sum_{k=0..n} A201730(n,k). - Philippe Deléham, Dec 05 2011
G.f.: G(0) where G(k)= 1 + 2*x/((1-2*x) - 2*x*(1-2*x)/(2*x + (1-2*x)*2/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 10 2012
G.f.: G(0)*(1-2*x)/2, where G(k) = 1 + 1/(1 - 2*x*(4*k+2-x)/( 2*x*(4*k+4-x) + 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 27 2014
a(-n) = a(n) / 2^n for all n in Z. - Michael Somos, Aug 24 2014
a(n) = A265185(n) / 4, connecting this sequence to the simple Lie algebra B_4. - Tom Copeland, Dec 04 2015
From G. C. Greubel, Aug 27 2025: (Start)
a(n) = 2^((n-2)/2)*( (n+1 mod 2)*A002203(n) + 2*sqrt(2)*(n mod 2)*A000129(n) ).
a(n) = 2^(n/2)*ChebyshevT(n, sqrt(2)). (End)

A028495 Expansion of g.f. (1-x^2)/(1-x-2*x^2+x^3).

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 19, 33, 61, 108, 197, 352, 638, 1145, 2069, 3721, 6714, 12087, 21794, 39254, 70755, 127469, 229725, 413908, 745889, 1343980, 2421850, 4363921, 7863641, 14169633, 25532994, 46008619, 82904974, 149389218, 269190547, 485064009, 874055885
Offset: 0

Views

Author

Keywords

Comments

Form the graph with matrix A = [0,1,1; 1,0,0; 1,0,1] (P_3 with a loop at an extremity). Then A028495 counts closed walks of length n at the degree 3 vertex. - Paul Barry, Oct 02 2004
Equals INVERT transform of (1, 1, 0, 1, 0, 1, 0, 1, ...). - Gary W. Adamson, Apr 28 2009
From Johannes W. Meijer, May 29 2010: (Start)
a(n) is the number of ways White can force checkmate in exactly (n+1) moves, n>=0, ignoring the fifty-move and the triple repetition rules, in the following chess position: White Ka1, Ra8, Bc1, Nb8, pawns a6, a7, b2, c6, d2, f6 and h6; Black Kc8, pawns b3, c7, d3, f7 and h7. (After Noam D. Elkies, see link; diagram 5).
Counts all paths of length n, n>=0, starting at the initial node on the path graph P_6, see the second Maple program. (End)
a(n) is the number of length n-1 binary words such that each maximal block of 1's has odd length. a(4) = 6 because we have: 000, 001, 010, 100, 101, 111. - Geoffrey Critzer, Nov 17 2012
a(n) is the number of compositions of n where increments can only appear at every second position, starting with the second and third part, see example. Also, a(n) is the number of compositions of n where there is no fall between every second pair of parts, starting with the first and second part; see example. - Joerg Arndt, May 21 2013
a(n) is the top left entry of the n-th power of the 3 X 3 matrix [1, 1, 0; 1, 0, 1; 0, 1, 0] or of the 3 X 3 matrix [1, 0, 1; 0, 0, 1; 1, 1, 0]. - R. J. Mathar, Feb 03 2014
Range of row n of the circular Pascal array of order 7. - Shaun V. Ault, Jun 05 2014
a(n) is the number of compositions of n into parts from {1,2,4,6,8,10,...}. Example: a(4)= 6 because we have 4, 22, 211, 121, 112, and 1111. - Emeric Deutsch, Aug 17 2016
In general, a(n,m) = (2^n/(m+1))*Sum_{r=1..m} (1-(-1)^r)*cos(Pi*r/(m+1))^n*(1+cos(Pi*r/(m+1))) gives the number of paths of length n starting at the initial node on the path graph P_m. Here we have m=6. - Herbert Kociemba, Sep 15 2020
a(n-1) is the number of triangular dcc-polyominoes having area n (see Baril et al. at page 11). - Stefano Spezia, Oct 14 2023
a(n) is the number of permutations p of [n] with p(j)Alois P. Heinz, Mar 29 2024

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 19*x^6 + 33*x^7 + 61*x^8 + ...
From _Joerg Arndt_, May 21 2013: (Start)
There are a(6)=19 compositions of 6 where increments can only appear at every second position:
  01:  [ 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 2 ]
  03:  [ 1 1 2 1 1 ]
  04:  [ 1 1 2 2 ]
  05:  [ 1 1 3 1 ]
  06:  [ 1 1 4 ]
  07:  [ 2 1 1 1 1 ]
  08:  [ 2 1 2 1 ]
  09:  [ 2 1 3 ]
  10:  [ 2 2 1 1 ]
  11:  [ 2 2 2 ]
  12:  [ 3 1 1 1 ]
  13:  [ 3 1 2 ]
  14:  [ 3 2 1 ]
  15:  [ 3 3 ]
  16:  [ 4 1 1 ]
  17:  [ 4 2 ]
  18:  [ 5 1 ]
  19:  [ 6 ]
There are a(6)=19 compositions of 6 where there is no fall between every second pair of parts, starting with the first and second part:
  01:  [ 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 2 ]
  03:  [ 1 1 1 2 1 ]
  04:  [ 1 1 1 3 ]
  05:  [ 1 1 2 2 ]
  06:  [ 1 1 4 ]
  07:  [ 1 2 1 1 1 ]
  08:  [ 1 2 1 2 ]
  09:  [ 1 2 3 ]
  10:  [ 1 3 1 1 ]
  11:  [ 1 3 2 ]
  12:  [ 1 4 1 ]
  13:  [ 1 5 ]
  14:  [ 2 2 1 1 ]
  15:  [ 2 2 2 ]
  16:  [ 2 3 1 ]
  17:  [ 2 4 ]
  18:  [ 3 3 ]
  19:  [ 6 ]
(End)
19 = (1, 0, 1, 0, 1, 1) dot (1, 1, 2, 3, 6, 10) = (1 + 0 + 2 + 0 + 6 + 10). Cf. comment of Apr 28 2009. - _Gary W. Adamson_, Aug 10 2016
		

Crossrefs

Programs

  • Maple
    spec := [S,{S=Sequence(Union(Prod(Sequence(Prod(Z,Z)),Z,Z),Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    with(GraphTheory): P:=6: G:= PathGraph(P): A:=AdjacencyMatrix(G): nmax:=34; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k], k=1..P) od: seq(a(n), n=0..nmax); # Johannes W. Meijer, May 29 2010
    a := (-1)^(3/7) - (-1)^(4/7):
    b := (-1)^(5/7) - (-1)^(2/7):
    c := (-1)^(1/7) - (-1)^(6/7):
    f := n -> (a^n * (2 + a) + b^n * (2 + b) + c^n * (2 + c))/7:
    seq(simplify(f(n)), n=0..36); # Peter Luschny, Sep 16 2020
  • Mathematica
    LinearRecurrence[{1, 2, -1}, {1, 1, 2}, 60] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
    CoefficientList[Series[(1-x^2)/(1-x-2x^2+x^3),{x,0,40}],x] (* Harvey P. Dale, Dec 23 2018 *)
    a[n_,m_]:= 2^(n+1)/(m+1) Module[{x=(Pi r)/(m+1)},Sum[Cos[x]^n (1+Cos[x]),{r,1,m,2}]]
    Table[a[n,6],{n,0,40}]//Round (* Herbert Kociemba, Sep 15 2020 *) (* Herbert Kociemba, Sep 14 2020 *)
  • PARI
    {a(n) = if( n<0, n = -1-n; polcoeff( (1 - x^2) / (1 - 2*x - x^2 + x^3) + x * O(x^n), n), polcoeff( (1 - x^2) / (1 - x - 2*x^2 + x^3) + x * O(x^n), n))} /* Michael Somos, Apr 05 2012 */
    
  • PARI
    a(n)=([0,1,0;0,0,1;-1,2,1]^n*[1;1;2])[1,1] \\ Charles R Greathouse IV, Aug 25 2016

Formula

Recurrence: {a(0)=1, a(1)=1, a(2)=2, a(n)-2*a(n+1)-a(n+2)+a(n+3)=0}.
a(n) = Sum_(1/7*(1+2*_alpha)*_alpha^(-1-n), _alpha=RootOf(_Z^3-2*_Z^2-_Z+1)).
a(n) = A094718(6, n). - N. J. A. Sloane, Jun 12 2004
a(n) = a(n-1) + Sum_{k=1..floor(n/2)} a(n-2*k). - Floor van Lamoen, Oct 29 2005
a(n) = 5*a(n-2) - 6*a(n-4) + a(n-6). - Floor van Lamoen, Nov 02 2005
a(n) = A006053(n+2) - A006053(n). - R. J. Mathar, Nov 16 2007
a(2*n) = A052975(n), a(2*n+1) = A060557(n). - Johannes W. Meijer, May 29 2010
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x))))). - Michael Somos, Apr 05 2012
a(-1 - n) = A052534(n). - Michael Somos, Apr 05 2012
a(n) = (2^n/7)*Sum_{r=1..6} (1-(-1)^r)*cos(Pi*r/7)^n*(1+cos(Pi*r/7)). - Herbert Kociemba, Sep 15 2020

Extensions

More terms from James Sellers, Jun 05 2000

A059169 Number of partitions of n into 3 parts which form the sides of a nondegenerate isosceles triangle.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 7, 8, 8, 9, 8, 9, 9, 10, 9, 10, 10, 11, 10, 11, 11, 12, 11, 12, 12, 13, 12, 13, 13, 14, 13, 14, 14, 15, 14, 15, 15, 16, 15, 16, 16, 17, 16, 17, 17, 18, 17, 18, 18, 19, 18, 19, 19, 20, 19, 20, 20
Offset: 1

Views

Author

Floor van Lamoen, Jan 13 2001

Keywords

Comments

Also number of 0's in n-th row of triangle in A071026. - Hans Havermann, May 26 2002
Exponent of 2 in factorization of A030436(n-1) and A026655(n-1). First differences of A001971. - Ralf Stephan, Mar 21 2004
Conjecture: this is 0 followed by A026922. - R. J. Mathar, Oct 05 2008 [See the g.f. given there by Michael Somos and the one given below for the proof. - Wolfdieter Lang, May 10 2017]
a(n+1) is for n >= 0 the number of integers k in the left-sided open interval ((n+1)/4, floor(n/2)]. This is needed for the number of zeros of Chebyshev S polynomials in the open interval (-sqrt(2), sqrt(2)) given in A285869. - Wolfdieter Lang, May 10 2017

Examples

			Consider the number 13. The following partitions give a nondegenerate triangle: 4 4 5; 3 5 5; 1 6 6; 2 5 6; 3 4 6. Since the first three partitions represent isosceles triangles, we have A059169(13) = 3.
G.f. = x^3 + x^5 + x^6 + 2*x^7 + x^8 + 2*x^9 + 2*x^10 + 3*x^11 + 2*x^12 + ...
		

Crossrefs

Essentially the same as A008624.
Cf. A178804.

Programs

  • Haskell
    a059169 n = a059169_list !! (n-1)
    a059169_list = map abs $ zipWith (-) (tail a178804_list) a178804_list
    -- Reinhard Zumkeller, Nov 15 2014
    
  • Magma
    [Floor((n-1)/2) - Floor(n/4): n in [1..80]]; // G. C. Greubel, Mar 08 2018
  • Maple
    a[1] := 0: a[2] := 0: a[3] := 1: a[4] := 0: a[5] := 1: for n from 6 to 300 do a[n] := a[n-1] + a[n-4] - a[n-5]: end do: seq(a[n], n=1..82);
    a := n -> A005044(n) - A005044(n-6): A005044 := n-> floor((1/48)*(n^2 + 3*n + 21 + (-1)^(n-1)*3*n)): seq(a(n), n = 1..82); # Johannes W. Meijer, Oct 10 2013
  • Mathematica
    CoefficientList[Series[x^2 (1 - x + x^2)/(1 - x - x^4 + x^5), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 15 2013 *)
    LinearRecurrence[{1,0,0,1,-1},{0,0,1,0,1},100] (* Harvey P. Dale, Feb 09 2015 *)
    a[ n_] := Quotient[ n - 1, 2] - Quotient[ n, 4]; (* Michael Somos, May 05 2015 *)
  • PARI
    {a(n) = (n - 1) \ 2 - (n \ 4)}; /* Michael Somos, Oct 14 2008 */
    
  • PARI
    {a(n) = if( n<1, -a(3 - n), polcoeff( x^3 * (1 - x + x^2) / (1 - x - x^4 + x^5) + x * O(x^n), n))}; /* Michael Somos, Oct 14 2008 */
    

Formula

a(2*n + 2) = a(2*n - 1) = A004526(n).
a(n) = A005044(n) - A005044(n-6).
From Vladeta Jovovic, Dec 29 2001: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: x^3*(1 - x + x^2)/(1 - x - x^4 + x^5). (End)
The g.f. can also be written as x^3 * (1 + x^3) / ((1 - x^2) * (1 - x^4)). - Michael Somos, May 05 2015
Euler transform of length 6 sequence [0, 1, 1, 1, 0, -1]. - Michael Somos, Oct 14 2008
a(n) = -a(3 - n) for all n in Z. - Michael Somos. Oct 14 2008
a(n) = abs(floor((n-1)*(-1)^n/4)). - Wesley Ivan Hurt, Oct 22 2013
a(n) = abs(A178804(n+1) - A178804(n)). - Reinhard Zumkeller, Nov 15 2014
a(n) = floor(n/2) - floor(n/4) - (1 if n even). - David Pasino, Jun 17 2016
E.g.f.: (4 - sin(x) - cos(x) + x*sinh(x) + (x - 3)*cosh(x))/4. - Ilya Gutkovskiy, Jun 21 2016
a(n) = floor((n-1)/2) - floor(n/4), n >= 0 (from the preceding a(n) formula). - Wolfdieter Lang, May 08 2017
a(n) = (2*n - 3 - 2*cos(n*Pi/2) - 3*cos(n*Pi) - 2*sin(n*Pi/2))/8. - Wesley Ivan Hurt, Oct 01 2017
a(n) = Sum_{i=1..floor((n-1)/2)} (n-i-1) mod 2. - Wesley Ivan Hurt, Nov 17 2017

Extensions

More terms from Sascha Kurz, Mar 25 2002

A178381 Number of paths of length n starting at initial node of the path graph P_9.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 70, 125, 250, 450, 900, 1625, 3250, 5875, 11750, 21250, 42500, 76875, 153750, 278125, 556250, 1006250, 2012500, 3640625, 7281250, 13171875, 26343750, 47656250, 95312500, 172421875, 344843750
Offset: 0

Views

Author

Johannes W. Meijer, May 27 2010, May 29 2010

Keywords

Comments

Counts all paths of length n, n>=0, starting at initial node on the path graph P_9, see the Maple program.
The a(n) represent the number of possible chess games, ignoring the fifty-move and the triple repetition rules, after n moves by White in the following position: White Ka1, Nh1, pawns a2, b6, c2, d6, f2, g3 and g4; Black Ka8, Bc8, pawns a3, b7, c3, d7, f3 and g5.
The path graphs P_(2*p) have as limit(a(n+1)/a(n), n =infinity) = 2 resp. hypergeom([(p-1)/(2*p+1),(p+2)/(2*p+1)],[1/2],3/4) and the path graphs P_(2*p+1) have as limit(a(n+1)/a(n), n =infinity) = 1+cos(Pi/(p+1)), p>=1; see the crossrefs. - Johannes W. Meijer, Jul 01 2010

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 70*x^8 + ...
		

Crossrefs

This is row 9 of A094718.
a(2*n) = A147748(n) and a(2*n+1) = A081567(n).
a(4*n+2) = A109106(n) and a(4*n+3) = A179135(n).
Cf. A000007 (P_1), A000012 (P_2), A016116 (P_3), A000045 (P_4), A038754 (P_5), A028495 (P_6), A030436 (P_7), A061551 (P_8), this sequence (P_9), A336675 (P_10), A336678 (P_11), and A001405 (P_infinity).
Cf. A216212 (P_9 starting in the middle).

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4))); // G. C. Greubel, Sep 18 2018
  • Maple
    with(GraphTheory): P:=9: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=36; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P); od: seq(a(n),n=0..nmax);
    r := j -> (-1)^(j/10) - (-1)^(1-j/10):
    a := k -> add((2 + r(j))*r(j)^k, j in [1, 3, 5, 7, 9])/10:
    seq(simplify(a(n)), n=0..30); # Peter Luschny, Sep 18 2020
  • Mathematica
    CoefficientList[Series[(1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4), {x,0,50}], x] (* G. C. Greubel, Sep 18 2018 *)
  • PARI
    x='x+O('x^50); Vec((1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4)) \\ G. C. Greubel, Sep 18 2018
    

Formula

G.f.: (1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4).
a(n) = 5*a(n-2) - 5*a(n-4) for n>=5 with a(0)=1, a(1)=1, a(2)=2, a(3)=3 and a(4)=6.
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x / (1 - x / (1 + x / (1 + x)))))))). - Michael Somos, Feb 08 2015

A094718 Array T read by antidiagonals: T(n,k) is the number of involutions avoiding 132 and 12...k.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 4, 1, 0, 1, 2, 3, 5, 4, 1, 0, 1, 2, 3, 6, 8, 8, 1, 0, 1, 2, 3, 6, 9, 13, 8, 1, 0, 1, 2, 3, 6, 10, 18, 21, 16, 1, 0, 1, 2, 3, 6, 10, 19, 27, 34, 16, 1, 0, 1, 2, 3, 6, 10, 20, 33, 54, 55, 32, 1, 0, 1, 2, 3, 6, 10, 20, 34, 61, 81, 89, 32, 1
Offset: 1

Views

Author

Ralf Stephan, May 23 2004

Keywords

Comments

Also, number of paths along a corridor with width k, starting from one side (from H. Bottomley's comment in A061551).
Rows converge to binomial(n,floor(n/2)) (A001405).
Note that the rows and columns start at 1, which for example obscures the fact that the first row refers to A000007 and not to A000004. A better choice is the indexing 0 <= k and 0 <= n. The Maple program below uses this indexing and builds only on the roots of -1. - Peter Luschny, Sep 17 2020

Examples

			Array begins
  0   0   0   0   0   0   0   0   0   0 ...
  1   1   1   1   1   1   1   1   1   1 ...
  1   2   2   4   4   8   8  16  16  32 ...
  1   2   3   5   8  13  21  34  55  89 ...
  1   2   3   6   9  18  27  54  81 162 ...
  1   2   3   6  10  19  33  61 108 197 ...
  1   2   3   6  10  20  34  68 116 232 ...
  1   2   3   6  10  20  35  69 124 241 ...
  1   2   3   6  10  20  35  70 125 250 ...
  1   2   3   6  10  20  35  70 126 251 ...
  ...
		

Crossrefs

Main diagonal is A014495, antidiagonal sums are in A094719.
Cf. A080934 (permutations).

Programs

  • Maple
    X := (j, n) -> (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)):
    R := n -> select(k -> type(k, odd), [$(1..n)]):
    T := (n, k) -> add((2 + X(j,n))*X(j,n)^k, j in R(n))/(n+1):
    seq(lprint([n], seq(simplify(T(n, k)), k=0..10)), n=0..9); # Peter Luschny, Sep 17 2020
  • Mathematica
    U = ChebyshevU;
    m = maxExponent = 14;
    row[1] = Array[0&, m];
    row[k_] := 1/(x U[k, 1/(2x)])*Sum[U[j, 1/(2x)], {j, 0, k-1}] + O[x]^m // CoefficientList[#, x]& // Rest;
    T = Table[row[n], {n, 1, m}];
    Table[T[[n-k+1, k]], {n, 1, m-1}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 17 2018 *)

Formula

G.f. for k-th row: 1/(x*U(k, 1/(2*x))) * Sum_{j=0..k-1} U(j, 1/(2*x)), with U(k, x) the Chebyshev polynomials of second kind. [Clarified by Jean-François Alcover, Nov 17 2018]
T(n, k) = (1/(n+1))*Sum_{j=1..n, j odd} (2 + [j, n]) * [j, n]^k where [j, n] := (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)). - Peter Luschny, Sep 17 2020

A061551 Number of paths along a corridor width 8, starting from one side.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 69, 124, 241, 440, 846, 1560, 2977, 5525, 10490, 19551, 36994, 69142, 130532, 244419, 460737, 863788, 1626629, 3052100, 5743674, 10782928, 20283121, 38092457, 71632290, 134560491, 252989326, 475313762
Offset: 0

Views

Author

Henry Bottomley, May 16 2001

Keywords

Comments

Counts all paths of length n starting at initial node on the path graph P_8. - Paul Barry, May 11 2004
The a(n) represent the number of possible chess games, ignoring the fifty-move and the triple repetition rules, after n moves by White in the following position: White Ka1, pawns a2, b6, d2, d6 and g2; Black Ka8, Bc8, pawns a3, b7, d3, d7 and g3. - Johannes W. Meijer, May 29 2010
Define the 4 X 4 tridiagonal unit-primitive matrix (see [Jeffery]) M = A_{9,1} = [0,1,0,0; 1,0,1,0; 0,1,0,1; 0,0,1,1]; then a(n)=[M^n](4,4). - _L. Edson Jeffery, Mar 18 2011
a(n) is the length of n-th word derived by certain iterated substitutions on four letters {1,2,3,4} as follows. Define the substitution rules 1 -> {2}, 2 -> {1,3}, 3 -> {2,4}, 4 -> {3,4}, in which "," denotes concatenation, so 1 -> 2, 2 -> 13, 3 -> 24, 4 -> 34. Let w(k) be the k-th word formed by applying the substitution rules to each letter (digit) in word w(k-1), k>0, putting w(0) = 1. Then, for n=0,1,..., {w(n)} = {1, 2, 13, 224, 131334, 2242242434, 13133413133413342434, ...} in which {length(w(n))} = {1,1,2,3,6,10,...} = A061551. The maps 1 -> 2, etc., are given by the above matrix A_{9,1} by taking i -> {j : [A_{9,1}](i,j) <> 0}, i, j in {1,2,3,4}. Moreover, the entry in row 1 and column j of [A{9,1}]^n gives the relative frequency of the letter j in the n-th word w(n). Finally, the sum of the first-row entries of [A_{9,1}]^n again gives a(n), so obviously a(n) = sum of relative frequencies of each j in word w(n). - L. Edson Jeffery, Feb 06 2012
Range of row n of the circular Pascal array of order 9. - Shaun V. Ault, Jun 05 2014
In general, a(n,m) = (2^n/(m+1))*Sum_{r=1..m} (1-(-1)^r)*cos(Pi*r/(m+1))^n*(1+cos(Pi*r/(m+1))) gives the number of paths of length n starting at the initial node on the path graph P_m. Here we have m=8. - Herbert Kociemba, Sep 17 2020

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 69*x^8 + ....
		

Crossrefs

Narrower corridors effectively produce A000007, A000012, A016116, A000045, A038754, A028495, A030436, A061551, A178381, A336675, A336678.
An infinitely wide corridor (i.e., just one wall) would produce A001405.
Equivalently, the above mentioned corridor numbers are exactly the ranges of the circular Pascal array of order d = 2, 3, 4, 5, 6, 7, 8, respectively, and this is true for any natural number d greater than or equal to 2.
a(n) = A094718(8, n).
Cf. A030436 and A178381.

Programs

  • Maple
    a[0]:=1: a[1]:=1: a[2]:=2: a[3]:=3: a[4]:=6: a[5]:=10: a[6]:=20: a[7]:=35: for n from 8 to 33 do a[n]:=7*a[n-2]-15*a[n-4]+10*a[n-6]-a[n-8] od: seq(a[n],n=0..33); # Emeric Deutsch, Aug 14 2006
    with(GraphTheory): P:=8: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=33; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P); od: seq(a(n),n=0..nmax); # Johannes W. Meijer, May 29 2010
    X := j -> (-1)^(j/9) - (-1)^(1-j/9):
    a := k -> add((2 + X(j))*X(j)^k, j in [1, 3, 5, 7])/9:
    seq(simplify(a(n)), n=0..30); # Peter Luschny, Sep 17 2020
  • Mathematica
    LinearRecurrence[{1,3,-2,-1},{1,1,2,3},40] (* Harvey P. Dale, Dec 19 2011 *)
    a[n_,m_]:=2^(n+1)/(m+1) Module[{x=(Pi r)/(m+1)},Sum[Cos[x]^n (1+Cos[x]),{r,1,m,2}]]
    Table[a[n,8],{n,0,40}]//Round (* Herbert Kociemba, Sep 17 2020 *)

Formula

a(n) = sum(b(n,i)) where b(n,0) = b(n,9) = 0, b(0,1)=1, b(0, n)=0 if n!=1 and b(n,i) = b(n-1,i) + b(n+1,i) if 0 < n < 9.
From Emeric Deutsch, Aug 14 2006: (Start)
G.f.: (1-2*x^2)/((1-x)*(1-3*x^2-x^3)).
a(n) = 7*a(n-2) - 15*a(n-4) + 10*a(n-6) - a(n-8). (End)
a(2*n) = A094854(n) and a(2*n+1) = A094855(n). - Johannes W. Meijer, May 29 2010
a(n) = a(n-1) + 3*a(n-2) - 2*a(n-3) - a(n-4), for n > 3, with {a(k)}={1,1,2,3}, k=0,1,2,3. - L. Edson Jeffery, Mar 18 2011
a(n) = A187498(3*n + 2). - L. Edson Jeffery, Mar 18 2011
a(n) = A205573(3,n). - L. Edson Jeffery, Feb 06 2012
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x / (1 - x / (1 + x))))))). - Michael Somos, Feb 08 2015
a(n) = 2^n/9*Sum_{r=1..8} (1-(-1)^r)cos(Pi*r/9)^n*(1+cos(Pi*r/9)). - Herbert Kociemba, Sep 17 2020

A024175 Expansion of g.f. (x^3 - 6*x^2 + 5*x - 1)/((2*x - 1)*(2*x^2 - 4*x + 1)).

Original entry on oeis.org

1, 1, 2, 5, 14, 42, 132, 428, 1416, 4744, 16016, 54320, 184736, 629280, 2145600, 7319744, 24979584, 85262464, 291057920, 993641216, 3392317952, 11581727232, 39541748736, 135002491904, 460924372992, 1573688313856, 5372896120832, 18344191078400, 62630938517504
Offset: 0

Views

Author

Keywords

Comments

Number of (s(0), s(1), ..., s(2*n)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1, 2, ..., 2*n, s(0) = 1, s(2*n) = 1. - Herbert Kociemba, Jun 11 2004
Counts all paths of length (2*n), n >= 0, starting and ending at the initial node on the path graph P_7, see the Maple program. - Johannes W. Meijer, May 29 2010

Examples

			1 + x + 2*x^2 + 5*x^3 + 14*x^4 + 42*x^5 + 132*x^6 + 428*x^7 + ...
		

Crossrefs

Programs

  • Maple
    with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=26; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=B(n)[1,1]; od: seq(a(2*n),n=0..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    CoefficientList[Series[(x^3-6*x^2+5*x-1)/((2*x-1)*(2*x^2-4*x+1)),{x,0,30}],x] (* Vincenzo Librandi, May 10 2012 *)
  • PARI
    {a(n) = local(A); A = 1; for( i=1, 6, A = 1 / (1 - x*A)); polcoeff( A + x * O(x^n), n)} /* Michael Somos, May 12 2012 */

Formula

From Herbert Kociemba, Jun 11 2004: (Start)
a(n) = (1/4)*Sum_{r=1..7} sin(r*Pi/8)^2*(2*cos(r*Pi/8))^(2n), n >= 1.
a(n) = 6*a(n-1) - 10*a(n-2) + 4*a(n-3), n >= 4. (End)
a(n) = (1/4)*((2 + sqrt(2))^(n - 1) + (2 - sqrt(2))^(n - 1) + 2^n) for n >= 1. - Richard Choulet, Apr 19 2010
a(n) = 2^(n - 2) + A006012(n-1)/2, n > 0. - R. J. Mathar, Mar 14 2011
G.f.: 1 / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x)))))). - Michael Somos, May 12 2012
E.g.f.: (1 + exp(2*x)*(1 + 2*cosh(sqrt(2)*x) - sqrt(2)*sinh(sqrt(2)*x)))/4. - Stefano Spezia, Jun 14 2023

A068914 Square array read by antidiagonals of number of k step walks (each step +-1 starting from 0) which are never more than n or less than 0.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 1, 4, 3, 2, 1, 1, 0, 1, 4, 5, 3, 2, 1, 1, 0, 1, 8, 8, 6, 3, 2, 1, 1, 0, 1, 8, 13, 9, 6, 3, 2, 1, 1, 0, 1, 16, 21, 18, 10, 6, 3, 2, 1, 1, 0, 1, 16, 34, 27, 19, 10, 6, 3, 2, 1, 1, 0, 1, 32, 55, 54, 33, 20, 10, 6, 3, 2, 1, 1, 0, 1, 32, 89
Offset: 0

Views

Author

Henry Bottomley, Mar 06 2002

Keywords

Comments

The (n,k)-entry of the square array is p(n,k) in the R. Kemp reference (see Table 1 on p. 160 and Theorem 2 on p. 159). - Emeric Deutsch, Jun 16 2011

Examples

			Rows start:
1,0,0,0,0,...;
1,1,1,1,1,...;
1,1,2,2,4,...;
1,1,2,3,5,...;
etc.
		

Crossrefs

Rows include effectively A000007, A000012, A016116, A000045, A038754, A028495, A030436, A061551. Central and lower diagonals are A001405. Cf. A068913 for starting in the middle rather than an edge.
Reflected version of A094718.

Programs

  • Maple
    v := ((1-sqrt(1-4*z^2))*1/2)/z: G := proc (k) options operator, arrow: (1+v^2)*(1-v^(k+1))/((1-v)*(1+v^(k+2))) end proc: a := proc (n, k) options operator, arrow: coeff(series(G(k), z = 0, 80), z, n) end proc: for n from 0 to 15 do seq(a(n, k), k = 0 .. 15) end do; # yields the first 16 entries of the first 16 rows of the square array
    v := ((1-sqrt(1-4*z^2))*1/2)/z: G := proc (k) options operator, arrow: (1+v^2)*(1-v^(k+1))/((1-v)*(1+v^(k+2))) end proc: a := proc (n, k) options operator, arrow: coeff(series(G(k), z = 0, 80), z, n) end proc: for n from 0 to 13 do seq(a(n-i, i), i = 0 .. n) end do; # yields the first 14 antidiagonals of the square array in triangular form
  • Mathematica
    v = (1-Sqrt[1-4z^2])/(2z); f[k_] = (1+v^2)*(1-v^(k+1))/((1-v)*(1+v^(k+2))) ; m = 14; a = Table[ PadRight[ CoefficientList[ Series[f[k], {z, 0, m}], z], m], {k, 0, m}]; Flatten[Table[a[[n+1-k, k]], {n, m}, {k, n, 1, -1}]][[;; 95]] (* Jean-François Alcover, Jul 13 2011, after Emeric Deutsch *)
  • PARI
    T(n,k) = sum(j=floor(-n/(k+2)), ceil(n/(k+2)), (-1)^j*binomial(n,floor((n+(k+2)*j)/2))); \\ Stefano Spezia, May 08 2020

Formula

An explicit expression for the (n,k)-entry of the square array can be found in the R. Kemp reference (Theorem 2 on p. 159). - Emeric Deutsch, Jun 16 2011
The g.f. of column k is (1 + v^2)*(1 - v^(k+1))/((1 - v)*(1 + v^(k+2))), where v = (1 - sqrt(1-4*z^2))/(2*z) (see p. 159 of the R. Kemp reference). - Emeric Deutsch, Jun 16 2011

A094803 Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = 1, s(2n) = 3.

Original entry on oeis.org

1, 3, 9, 28, 90, 296, 988, 3328, 11272, 38304, 130416, 444544, 1516320, 5174144, 17659840, 60282880, 205795456, 702583296, 2398676736, 8189409280, 27960021504, 95460743168, 325921881088, 1112763940864, 3799207806976, 12971294957568, 44286747439104, 151204366286848
Offset: 1

Views

Author

Herbert Kociemba, Jun 11 2004

Keywords

Comments

In general, a(n) = (2/m)*Sum_{r=1..m-1} sin(r*j*Pi/m)*sin(r*k*Pi/m)*(2*cos(r*Pi/m))^(2n)) counts (s(0), s(1), ..., s(2n)) such that 0 < s(i) < m and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = j, s(2n) = k.
Counts all paths of length (2*n+1), n >= 0, starting and ending at the initial node and ending at the nodes 1, 2, 3, 4 and 5 on the path graph P_7, see the Maple program. - Johannes W. Meijer, May 29 2010

Crossrefs

Programs

  • Maple
    with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=25; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..5); od: seq(a(2*n+1),n=0..nmax-1); # Johannes W. Meijer, May 29 2010
  • Mathematica
    f[n_] := FullSimplify[ TrigToExp[(1/4)Sum[ Sin[Pi*k/8]Sin[3Pi*k/8](2Cos[Pi*k/8])^(2n), {k, 1, 7}]]]; Table[ f[n], {n, 25}] (* Robert G. Wilson v, Jun 18 2004 *)
    Rest@ CoefficientList[Series[-x (1 - 3 x + x^2)/((2 x - 1)*(2 x^2 - 4 x + 1)), {x, 0, 25}], x] (* Michael De Vlieger, Aug 04 2021 *)

Formula

a(n) = (1/4)*Sum_{k=1..7} sin(Pi*k/8)*sin(3*Pi*k/8)*(2*cos(Pi*k/8))^(2n).
a(n) = 6*a(n-1) - 10*a(n-2) + 4*a(n-3).
G.f.: -x*(1 - 3*x + x^2)/((2*x - 1)*(2*x^2 - 4*x + 1)).
E.g.f.: (2*sinh(x)^2 + sinh(2*x) + sqrt(2)*exp(2*x)*sinh(sqrt(2)*x))/4. - Stefano Spezia, Jun 14 2023
Showing 1-10 of 14 results. Next