[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a026597 -id:a026597
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) is the number of subsequences of [ 1, ..., 2n ] in which each odd number has an even neighbor.
(Formerly M2893)
+10
49
1, 3, 11, 39, 139, 495, 1763, 6279, 22363, 79647, 283667, 1010295, 3598219, 12815247, 45642179, 162557031, 578955451, 2061980415, 7343852147, 26155517271, 93154256107, 331773802863, 1181629920803, 4208437368135
OFFSET
0,2
COMMENTS
The even neighbor must differ from the odd number by exactly one.
If we defined this sequence by the recurrence (a(n) = 3*a(n-1) + 2*a(n-2)) that it satisfies, we could prefix it with an initial 0.
a(n) equals term (1,2) in M^n, M = the 3 X 3 matrix [1,1,2; 1,0,1; 2,1,1]. - Gary W. Adamson, Mar 12 2009
a(n) equals term (2,2) in M^n, M = the 3 X 3 matrix [0,1,0; 1,3,1; 0,1,0]. - Paul Barry, Sep 18 2009
From Gary W. Adamson, Aug 06 2010: (Start)
Starting with "1" = INVERT transform of A002605: (1, 2, 6, 16, 44, ...).
Example: a(3) = 39 = (16, 6, 2, 1) dot (1, 1, 3, 11) = (16 + 6 + 6 + 11). (End)
Pisano periods: 1, 1, 4, 1, 24, 4, 48, 2, 12, 24, 30, 4, 12, 48, 24, 4,272, 12, 18, 24, ... . - R. J. Mathar, Aug 10 2012
A007482 is also the number of ways of tiling a 3 X n rectangle with 1 X 1 squares, 2 X 2 squares and 2 X 1 (vertical) dominoes. - R. K. Guy, May 20 2015
With offset 1 (a(0) = 0, a(1) = 1) this is a divisibility sequence. - Michael Somos, Jun 03 2015
Number of elements of size 2^(-n) in a fractal generated by the second-order reversible cellular automaton, rule 150R (see the reference and the link). - Yuriy Sibirmovsky, Oct 04 2016
a(n) is the number of compositions (ordered partitions) of n into parts 1 (of three kinds) and 2 (of two kinds). - Joerg Arndt, Oct 05 2016
a(n) equals the number of words of length n over {0,1,2,3,4} in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Jan 08 2017
Start with a single cell at coordinates (0, 0), then iteratively subdivide the grid into 2 X 2 cells and remove the cells that have two '1's in their modulo 3 coordinates. a(n) is the number of cells after n iterations. Cell configuration converges to a fractal with approximate dimension 1.833. - Peter Karpov, Apr 20 2017
This is the Lucas sequence U(P=3,Q=-2), and hence for n>=0, a(n+2)/a(n+1) equals the continued fraction 3 + 2/(3 + 2/(3 + 2/(3 + ... + 2/3))) with n 2's. - Greg Dresden, Oct 06 2019
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 439.
LINKS
Alexander Burstein and Opel Jones, Enumeration of Dumont permutations avoiding certain four-letter patterns, arXiv:2002.12189 [math.CO], 2020.
R. K. Guy and William O. J. Moser, Numbers of subsequences without isolated odd members, Fibonacci Quarterly, 34, No. 2, 152-155 (1996). Math. Rev. 97d:11017.
Peter Karpov, InvMem, Item 26
FORMULA
G.f.: 1/(1-3*x-2*x^2).
a(n) = 3*a(n-1) + 2*a(n-2).
a(n) = (ap^(n+1)-am^(n+1))/(ap-am), where ap = (3+sqrt(17))/2 and am = (3-sqrt(17))/2.
Let b(0) = 1, b(k) = floor(b(k-1)) + 2/b(k-1); then, for n>0, b(n) = a(n)/a(n-1). - Benoit Cloitre, Sep 09 2002
The Hankel transform of this sequence is [1,2,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)2^k*3^(n-2k). - Paul Barry, Apr 23 2005
a(n) = Sum_{k=0..n} A112906(n,k). - Philippe Deléham, Nov 21 2007
a(n) = - a(-2-n) * (-2)^(n+1) for all n in Z. - Michael Somos, Jun 03 2015
If c = (3 + sqrt(17))/2, then c^n = (A206776(n) + sqrt(17)*a(n-1)) / 2. - Michael Somos, Oct 13 2016
a(n) = 3^n*hypergeom([(1-n)/2,-n/2], [-n], -8/9) for n>=1. - Peter Luschny, Jun 28 2017
a(n) = round(((sqrt(17) + 3)/2)^(n+1)/sqrt(17)). The distance of the argument from the nearest integer is about 1/2^(n+3). - M. F. Hasler, Jun 16 2019
E.g.f.: (1/17)*exp(3*x/2)*(17*cosh(sqrt(17)*x/2) + 3*sqrt(17)*sinh(sqrt(17)*x/2)). - Stefano Spezia, Oct 07 2019
a(n) = (sqrt(2)*i)^n * ChebyshevU(n, -3*i/(2*sqrt(2))). - G. C. Greubel, Dec 24 2021
G.f.: 1/(1 - 3*x - 2*x^2) = Sum_{n >= 0} x^n * Product_{k = 1..n} (k + 2*x + 2)/(1 + k*x) (a telescoping series). Cf. A015518. - Peter Bala, May 08 2024
EXAMPLE
G.f. = 1 + 3*x + 11*x^2 + 39*x^3 + 139*x^4 + 495*x^5 + 1763*x^6 + ...
From M. F. Hasler, Jun 16 2019: (Start)
For n = 0, (1, ..., 2n) = () is the empty sequence, which is equal to its only subsequence, which satisfies the condition voidly, whence a(0) = 1.
For n = 1, (1, ..., 2n) = (1, 2); among the four subsequences {(), (1), (2), (1,2)} only (1) does not satisfy the condition, whence a(1) = 3.
For n = 2, (1, ..., 2n) = (1, 2, 3, 4); among the sixteen subsequences {(), ..., (1,2,3,4)}, the 5 subsequences (1), (3), (1,3), (2,3,4) and (1,2,3,4) do not satisfy the condition, whence a(2) = 16 - 5 = 11.
(End)
MAPLE
a := n -> `if`(n=0, 1, 3^n*hypergeom([(1-n)/2, -n/2], [-n], -8/9)):
seq(simplify(a(n)), n = 0..23); # Peter Luschny, Jun 28 2017
MATHEMATICA
a[n_]:=(MatrixPower[{{1, 4}, {1, 2}}, n].{{1}, {1}})[[2, 1]]; Table[a[n], {n, 0, 40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
LinearRecurrence[{3, 2}, {1, 3}, 30] (* Harvey P. Dale, May 25 2013 *)
a[ n_] := Module[ {m = n + 1, s = 1}, If[ m < 0, {m, s} = -{m, (-2)^m}]; s SeriesCoefficient[ x / (1 - 3 x - 2 x^2), {x, 0, m}]]; (* Michael Somos, Jun 03 2015 *)
a[ n_] := With[{m = n + 1}, If[ m < 0, (-2)^m a[ -m], Expand[((3 + Sqrt[17])/2)^m - ((3 - Sqrt[17])/2)^m ] / Sqrt[17]]]; (* Michael Somos, Oct 13 2016 *)
PROG
(Sage) [lucas_number1(n, 3, -2) for n in range(1, 25)] # Zerinvary Lajos, Apr 22 2009
(PARI) {a(n) = 2*imag(( (3 + quadgen(68)) / 2)^(n+1))}; /* Michael Somos, Jun 03 2015 */
(Haskell)
a007482 n = a007482_list !! (n-1)
a007482_list = 1 : 3 : zipWith (+)
(map (* 3) $ tail a007482_list) (map (* 2) a007482_list)
-- Reinhard Zumkeller, Oct 21 2015
(Maxima) a(n) := if n=0 then 1 elseif n=1 then 3 else 3*a(n-1)+2*a(n-2);
makelist(a(n), n, 0, 12); /* Emanuele Munarini, Jun 28 2017 */
(Magma) I:=[1, 3]; [n le 2 select I[n] else 3*Self(n-1) + 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 16 2018
CROSSREFS
Row sums of triangle A073387.
Cf. A000045, A000129, A001045, A007455, A007481, A007483, A007484, A015518, A201000 (prime subsequence), A052913 (binomial transform), A026597 (inverse binomial transform).
Cf. A206776.
KEYWORD
nonn,easy,nice
STATUS
approved
a(n) = a(n-1) + 4*a(n-2), a(0) = a(1) = 1.
(Formerly M3788)
+10
45
1, 1, 5, 9, 29, 65, 181, 441, 1165, 2929, 7589, 19305, 49661, 126881, 325525, 833049, 2135149, 5467345, 14007941, 35877321, 91909085, 235418369, 603054709, 1544728185, 3956947021, 10135859761, 25963647845, 66507086889, 170361678269
OFFSET
0,3
COMMENTS
Length-n words with letters {0,1,2,3,4} where no two consecutive letters are nonzero, see fxtbook link below. - Joerg Arndt, Apr 08 2011
Equals INVERTi transform of A063727: (1, 2, 8, 24, 80, 256, 832, ...). - Gary W. Adamson, Aug 12 2010
a(n) is equal to the permanent of the n X n Hessenberg matrix with 1's along the main diagonal, 2's along the superdiagonal and the subdiagonal, and 0's everywhere else. - John M. Campbell, Jun 09 2011
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n >= 2, 5*a(n-2) equals the number of 5-colored compositions of n with all parts >= 2, such that no adjacent parts have the same color. - Milan Janjic, Nov 26 2011
Pisano period lengths: 1, 1, 8, 1, 6, 8, 48, 2, 24, 6,120, 8, 12, 48, 24, 4,136, 24, 18, 6, ... - R. J. Mathar, Aug 10 2012
This is one of only two Lucas-type sequences whose 8th term is a square. The other one is A097705. - Michel Marcus, Dec 07 2012
Numerators of stationary probabilities for the M2/M/1 queue. In this queue, customers arrives in groups of 2. Intensity of arrival = 1. Service rate = 4. There is only one server and an infinite queue. - Igor Kleiner, Nov 02 2018
Number of 4-compositions of n+2 with 1 not allowed as a part; see Hopkins & Ouvry reference. - Brian Hopkins, Aug 17 2020
From M. Eren Kesim, May 13 2021: (Start)
a(n) is equal to the number of n-step walks from a universal vertex to another (itself or the other) on the diamond graph. It is also equal to the number of (n+1)-step walks from vertex A to vertex B on the graph below.
B--C
| /|
|/ |
A--D
(End)
From Wolfdieter Lang, Jan 03 2024: (Start)
This sequence {a(n-1)}, with a(-1) = 0, appears in the formula for powers of phi17 := (1 + sqrt(17))/2 = A222132, the fundamental (integer) algebraic number of Q(sqrt(17)): phi17^n = A052923(n) + a(n-1)*phi17, for n >= 0.
Limit_{n->oo} a(n+1)/a(n) = phi17. (End)
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Ilya Amburg, Krishna Dasaratha, Laure Flapan, Thomas Garrity, Chansoo Lee, Cornelia Mihaila, Nicholas Neumann-Chun, Sarah Peluse, and Matthew Stoffregen, Stern Sequences for a Family of Multidimensional Continued Fractions: TRIP-Stern Sequences, arXiv:1509.05239 [math.CO], 2015.
Joerg Arndt, Matters Computational (The Fxtbook), pp.317-318.
J. Borowska, L. Lacinska, Recurrence form of determinant of a heptadiagonal symmetric Toeplitz matrix", J. Appl. Math. Comp. Mech. 13 (2014) 19-16, remark 2 for tridiagonal Toeplitz matrices a=1, b=2.
A. Bremner and N. Tzanakis, Lucas sequences whose 8th term is a square, arXiv:math/0408371 [math.NT], 2004.
Brian Hopkins and Stéphane Ouvry, Combinatorics of Multicompositions, arXiv:2008.04937 [math.CO], 2020.
Milan Janjic, On Linear Recurrence Equations Arising from Compositions of Positive Integers, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.7.
Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
A. G. Shannon and J. V. Leyendekkers, The Golden Ratio family and the Binet equation, Notes on Number Theory and Discrete Mathematics, Vol. 21, No. 2, (2015), 35-42.
A. K. Whitford, Binet's formula generalized, Fib. Quart., 15 (1977), pp. 21, 24, 29.
Paul Thomas Young, p-adic congruences for generalized Fibonacci sequences, The Fibonacci Quarterly, Vol. 32, No. 1, 1994.
FORMULA
G.f.: 1/(1 - x - 4*x^2).
a(n) = (((1+sqrt(17))/2)^(n+1) - ((1-sqrt(17))/2)^(n+1))/sqrt(17).
a(n+1) = Sum_{k=0..ceiling(n/2)} 4^k*binomial(n-k, k). - Benoit Cloitre, Mar 06 2004
a(n) = Sum_{k=0..n} binomial((n+k)/2, (n-k)/2)*(1+(-1)^(n-k))*2^(n-k)/2. - Paul Barry, Aug 28 2005
a(n) = A102446(n)/2. - Zerinvary Lajos, Jul 09 2008
a(n) = Sum_{k=0..n} A109466(n,k)*(-4)^(n-k). - Philippe Deléham, Oct 26 2008
a(n) = Product_{k=1..floor((n - 1)/2)} (1 + 16*cos(k*Pi/n)^2). - Roger L. Bagula, Nov 21 2008
Limiting ratio a(n+1)/a(n) is (1 + sqrt(17))/2 = 2.561552812... - Roger L. Bagula, Nov 21 2008
The fraction b(n) = a(n)/2^n satisfies b(n) = 1/2 b(n-1) + b(n-2); g.f. 1/(1-x/2-x^2); b(n) = (( (1+sqrt(17))/4 )^(n+1) - ( (1-sqrt(17))/4 )^(n+1))*2/sqrt(17). - Franklin T. Adams-Watters, Nov 30 2009
G.f.: G(0)/(2-x), where G(k) = 1 + 1/(1 - x*(17*k-1)/(x*(17*k+16) - 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 20 2013
G.f.: Q(0)/2 , where Q(k) = 1 + 1/(1 - x*(4*k+1 + 4*x)/( x*(4*k+3 + 4*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 09 2013
G.f.: Q(0)/2 , where Q(k) = 1 + 1/(1 - x*(k+1 + 4*x)/( x*(k+3/2 + 4*x ) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 14 2013
G.f.: 1 / (1 - x / (1 - 4*x / (1 + 4*x))). - Michael Somos, Sep 15 2013
a(n) = (Sum_{1<=k<=n+1, k odd} C(n+1,k)*17^((k-1)/2))/2^n. - Vladimir Shevelev, Feb 05 2014
a(n) = 2^n*Fibonacci(n+1, 1/2) = (2/i)^n*ChebyshevU(n, i/4). - G. C. Greubel, Dec 26 2019
E.g.f.: exp(x/2)*(sqrt(17)*cosh(sqrt(17)*x/2) + sinh(sqrt(17)*x/2))/sqrt(17). - Stefano Spezia, Dec 27 2019
a(n) = A344236(n) + A344261(n). - M. Eren Kesim, May 13 2021
With an initial 0 prepended, the sequence [0, 1, 1, 5, 9, 29, 65, ...] satisfies the congruences a(n*p^k) == e*a(n*p^(k-1)) (mod p^k) for positive integers k and n and all primes p, where e = +1 for the primes p listed in A296938, e = 0 when p = 17, otherwise e = -1. - Peter Bala, Dec 28 2022
a(n) = A052923(n+2)/4. - Wolfdieter Lang, Jan 03 2024
EXAMPLE
G.f. = 1 + x + 5*x^2 + 9*x^3 + 29*x^4 + 65*x^5 + 181*x^6 + 441*x^7 + 1165*x^8 + ...
MAPLE
A006131:=-1/(-1+z+4*z**2); # conjectured by Simon Plouffe in his 1992 dissertation
seq( simplify((2/I)^n*ChebyshevU(n, I/4)), n=0..30); # G. C. Greubel, Dec 26 2019
MATHEMATICA
m = 16; f[n_] = Product[(1 + m*Cos[k*Pi/n]^2), {k, 1, Floor[(n - 1)/2]}]; Table[FullSimplify[ExpandAll[f[n]]], {n, 0, 15}]; N[%] (* Roger L. Bagula, Nov 21 2008 *)
a[n_]:=(MatrixPower[{{1, 4}, {1, 0}}, n].{{1}, {1}})[[2, 1]]; Table[a[n], {n, 0, 40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
LinearRecurrence[{1, 4}, {1, 1}, 29] (* Jean-François Alcover, Sep 25 2017 *)
Table[2^n*Fibonacci[n+1, 1/2], {n, 0, 30}] (* G. C. Greubel, Dec 26 2019 *)
PROG
(Sage) [lucas_number1(n, 1, -4) for n in range(1, 30)] # Zerinvary Lajos, Apr 22 2009
(Magma) [ n eq 1 select 1 else n eq 2 select 1 else Self(n-1)+4*Self(n-2): n in [1..40] ]; // Vincenzo Librandi, Aug 19 2011
(PARI) a(n)=([0, 1; 4, 1]^n*[1; 1])[1, 1] \\ Charles R Greathouse IV, Oct 03 2016
(PARI) vector(31, n, (2/I)^(n-1)*polchebyshev(n-1, 2, I/4) ) \\ G. C. Greubel, Dec 26 2019
(GAP) a:=[1, 1];; for n in [3..30] do a[n]:=a[n-1]+4*a[n-2]; od; a; # G. C. Greubel, Dec 26 2019
(Python)
def A006131_list(n):
list = [1, 1] + [0] * (n - 2)
for i in range(2, n):
list[i] = list[i - 1] + 4 * list[i - 2]
return list
print(A006131_list(29)) # M. Eren Kesim, Jul 19 2021
KEYWORD
nonn,easy
EXTENSIONS
More terms from Roger L. Bagula, Sep 26 2006
STATUS
approved
Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
+10
29
1, 2, 6, 14, 36, 86, 210, 500, 1194, 2822, 6660, 15638, 36642, 85604, 199626, 464630, 1079892, 2506550, 5811762, 13462484, 31159914, 72071654, 166599972, 384912086, 888906306, 2052031172, 4735527306, 10925175254, 25198866036, 58108609526, 133973643090
OFFSET
0,2
COMMENTS
a(n) represents the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the center square the bishop flies into a rage and turns into a raging elephant.
In chaturanga, the old Indian version of chess, one of the pieces was called gaja, elephant in Sanskrit. The Arabs called the game shatranj and the elephant became el fil in Arabic. In Spain chess became chess as we know it today but surprisingly in Spanish a bishop isn't a Christian bishop but a Moorish elephant and it still goes by its original name of el alfil.
On a 3 X 3 chessboard there are 2^9 = 512 ways for an elephant to fly into a rage on the central square (off the center the piece behaves like a normal bishop). The elephant is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 elephants lead to 46 different elephant sequences, see the overview of elephant sequences and the crossreferences.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the central square to A175655.
REFERENCES
Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.
David Hooper and Kenneth Whyld, The Oxford Companion to Chess, pp. 74, 366, 1992.
LINKS
Viswanathan Anand, The Indian Defense, Time, Jun 19 2008.
Johannes W. Meijer, The elephant sequences.
Vladimir Kruchinin, Composition of ordinary generating functions, arXiv:1009.2565 [math.CO], 2010.
Wikipedia, War Elephant.
FORMULA
G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=2 and a(2)=6.
a(n) = ((6+10*A)*A^(-n-1) + (6+10*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n) - A006130(n-1)*sqrt(13)).
a(n) = b(n) - b(n-1) - b(n-2), where b(n) = Sum_{k=1..n} (Sum_{j=0..k} (binomial(j,n-3*k+2*j)*(-6)^(k-j)*binomial(k,j)*3^(3*k-n-j), n>0, b(0)=1, with a(0) = b(0), a(1) = b(1) - b(0). - Vladimir Kruchinin, Aug 20 2010
a(n) = 2*A006138(n) - 2^n = 2*(A006130(n) + A006130(n-1)) - 2^n. - G. C. Greubel, Dec 08 2021
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 3*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Feb 12 2023
MAPLE
nmax:=28; m:=1; A[1]:=[0, 0, 0, 0, 1, 0, 0, 0, 1]: A[2]:=[0, 0, 0, 1, 0, 1, 0, 0, 0]: A[3]:=[0, 0, 0, 0, 1, 0, 1, 0, 0]: A[4]:=[0, 1, 0, 0, 0, 0, 0, 1, 0]: A[5]:=[0, 0, 1, 0, 0, 0, 1, 1, 1]: A[6]:=[0, 1, 0, 0, 0, 0, 0, 1, 0]: A[7]:=[0, 0, 1, 0, 1, 0, 0, 0, 0]: A[8]:=[0, 0, 0, 1, 0, 1, 0, 0, 0]: A[9]:=[1, 0, 0, 0, 1, 0, 0, 0, 0]: A:=Matrix([A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m, k], k=1..9): od: seq(a(n), n=0..nmax);
MATHEMATICA
LinearRecurrence[{3, 1, -6}, {1, 2, 6}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2012 *)
PROG
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -6, 1, 3]^n*[1; 2; 6])[1, 1] \\ Charles R Greathouse IV, Oct 03 2016
(Magma) [n le 3 select Factorial(n) else 3*Self(n-1) +Self(n-2) -6*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 08 2021
(Sage) [( (1-x-x^2)/((1-2*x)*(1-x-3*x^2)) ).series(x, n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 08 2021
CROSSREFS
Cf. Elephant sequences corner squares [decimal value A[5]]: A040000 [0], A000027 [16], A000045 [1], A094373 [2], A000079 [3], A083329 [42], A027934 [11], A172481 [7], A006138 [69], A000325 [26], A045623 [19], A000129 [21], A095121 [170], A074878 [43], A059570 [15], A175654 [71, this sequence], A026597 [325], A097813 [58], A057711 [27], 2*A094723 [23; n>=-1], A002605 [85], A175660 [171], A123203 [186], A066373 [59], A015518 [341], A134401 [187], A093833 [343].
KEYWORD
easy,nonn
AUTHOR
Johannes W. Meijer, Aug 06 2010; edited Jun 21 2013
STATUS
approved
Irregular triangular array T read by rows: T(i,0) = T(i,2i) = 1 for i >= 0; T(i,1) = T(i,2i-1) = floor(i/2) for i >= 1; and for i >= 2 and j = 2..2i-2, T(i,j) = T(i-1,j-2) + T(i-1,j-1) + T(i-1,j) if i+j is odd, and T(i,j) = T(i-1,j-2) + T(i-1,j) if i+j is even.
+10
26
1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 4, 2, 4, 1, 1, 1, 2, 5, 7, 8, 7, 5, 2, 1, 1, 2, 8, 9, 20, 14, 20, 9, 8, 2, 1, 1, 3, 9, 19, 28, 43, 40, 43, 28, 19, 9, 3, 1, 1, 3, 13, 22, 56, 62, 111, 86, 111, 62, 56, 22, 13, 3, 1, 1, 4, 14, 38, 69, 140, 167, 259, 222, 259, 167, 140, 69, 38, 14, 4, 1
OFFSET
1,7
COMMENTS
Row sums are in A026597. - Philippe Deléham, Oct 16 2006
T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i)-s(i-1)| <= 1 if s(i-1) odd, |s(i)-s(i-1)| = 1 if s(i-1) is even, for i = 1..n.
FORMULA
T(n, k) = T(n-1, k-2) + T(n-1, k) if ( (n+k) mod 2 ) = 0, otherwise T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), where T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2).
EXAMPLE
First 5 rows:
1
1 0 1
1 1 2 1 1
1 1 4 2 4 1 1
1 2 5 7 8 7 5 2 1
MATHEMATICA
z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2]; t[n_, k_] := Floor[n/2] /; k == 2 n - 1; t[n_, k_] := t[n, k] = If[EvenQ[n + k], t[n - 1, k - 2] + t[n - 1, k], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
TableForm[u] (* A026584 array *)
v = Flatten[u] (* A026584 sequence *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n//2)
else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
flatten([[T(n, k) for k in (0..2*n)] for n in (0..12)]) # G. C. Greubel, Dec 11 2021
KEYWORD
nonn,tabf
EXTENSIONS
Updated by Clark Kimberling, Aug 29 2014
STATUS
approved
a(n) = T(n,n), T given by A026584. Also a(n) is the number of integer strings s(0), ..., s(n) counted by T, such that s(n)=0.
+10
24
1, 0, 2, 2, 8, 14, 40, 86, 222, 518, 1296, 3130, 7770, 19066, 47324, 117094, 291260, 724302, 1806220, 4507230, 11266718, 28188070, 70609316, 177023466, 444231564, 1115639586, 2803975860, 7052132546, 17748069294, 44693162266
OFFSET
0,3
COMMENTS
The signed sequence 1,0,2,-2,8,-14,... is the inverse binomial transform of A026569. - Paul Barry, Sep 09 2004
Hankel transform of a(n) is 2^n. Hankel transform of a(n+1) is {0, -4, 0, 16, 0, -64, 0, 256, 0, ...} or -2^(n+1)*[x^n](x/(1+x^2)). Hankel transform of a(n+2) is 2^(n+1)*A109613(n+1). - Paul Barry, Mar 23 2011
LINKS
J. W. Layman, The Hankel Transform and Some of its Properties, J. Integer Sequences, 4 (2001), #01.1.5.
FORMULA
a(n) = A026584(n, n).
G.f.: sqrt((1-x)/(1-x-4*x^2)). - Ralf Stephan, Jan 08 2004
From Paul Barry, Jul 01 2009: (Start)
G.f.: 1/(1 -2*x^2/(1 -x -x^2/(1 -x^2/(1 -x -x^2/(1 -x^2/(1 -x -x^2/(1 - ... (continued fraction).
a(0) = 1, a(n) = Sum_{k=0..floor(n/2)} (k/(n-k))*C(n-k,k)*A000984(k). (End)
From Paul Barry, Mar 23 2011: (Start)
a(n) = Sum_{k=0..floor(n/2)} C(n-k-1,n-2*k)*A000984(k).
a(n) = Sum_{k=0..floor(n/2)} C(n-k-1,n-2*k)*C(2*k,k). (End)
D-finite with recurrence n*a(n) +2*(-n+1)*a(n-1) +(-3*n+2)*a(n-2) +2*(2*n-5)*a(n-3) = 0. - R. J. Mathar, Nov 24 2012
a(n) ~ (sqrt(17)+1)^(n-1/2) / (17^(1/4) * sqrt(Pi*n) * 2^(n-3/2)). - Vaclav Kotesovec, Feb 12 2014
MATHEMATICA
CoefficientList[Series[Sqrt[(1-x)/(1-x-4*x^2)], {x, 0, 40}], x] (* Vaclav Kotesovec, Feb 12 2014 *)
PROG
(Magma) [(&+[Binomial(n-j-1, n-2*j)*Binomial(2*j, j): j in [0..Floor(n/2)]]): n in [0..40]]; // G. C. Greubel, Dec 12 2021
(Sage) [sum(binomial(n-j-1, n-2*j)*binomial(2*j, j) for j in (0..(n//2))) for n in [0..40]] # G. C. Greubel, Dec 12 2021
KEYWORD
nonn
STATUS
approved
Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1+x-5*x^2)/(1-3*x-x^2+6*x^3).
+10
24
1, 4, 8, 22, 50, 124, 290, 694, 1628, 3838, 8978, 21004, 48962, 114022, 265004, 615262, 1426658, 3305212, 7650722, 17697430, 40911740, 94528318, 218312114, 503994220, 1163124866, 2683496134, 6189647948, 14273690782
OFFSET
0,2
COMMENTS
a(n) represents the number of n-move routes of a fairy chess piece starting in the central square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the central square the bishop turns into a raging elephant, see A175654.
For the central square the 512 elephants lead to 46 different elephant sequences, see the cross-references for examples.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the corner squares to A175654.
FORMULA
G.f.: (1+x-5*x^2)/(1-3*x-x^2+6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=4 and a(2)=8.
a(n) = ((10+8*A)*A^(-n-1) + (10+8*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n)-A006130(n-1)*sqrt(13)).
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 5*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Jan 31 2023
MAPLE
with(LinearAlgebra): nmax:=27; m:=5; A[5]:= [0, 0, 1, 0, 0, 0, 1, 1, 1]: A:=Matrix([[0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0], A[5], [0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m, k], k=1..9): od: seq(a(n), n=0..nmax);
MATHEMATICA
CoefficientList[Series[(1 + x - 5 x^2) / (1 - 3 x - x^2 + 6 x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 21 2013 *)
PROG
(Magma) I:=[1, 4, 8]; [n le 3 select I[n] else 3*Self(n-1)+Self(n-2)-6*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jul 21 2013
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -6, 1, 3]^n*[1; 4; 8])[1, 1] \\ Charles R Greathouse IV, Oct 03 2016
CROSSREFS
Cf. Elephant sequences central square [decimal value A[5]]: A000007 [0], A000012 [16], A000045 [1], A011782 [2], A000079 [3], A003945 [42], A099036 [11], A175656 [7], A105476 [69], A168604 [26], A045891 [19], A078057 [21], A151821 [170], A175657 [43], 4*A172481 [15; n>=-1], A175655 [71, this sequence], 4*A026597 [325; n>=-1], A033484 [58], A087447 [27], A175658 [23], A026150 [85], A175661 [171], A036563 [186], A098156 [59], A046717 [341], 2*A001792 [187; n>=1 with a(0)=1], A175659 [343].
KEYWORD
easy,nonn
AUTHOR
Johannes W. Meijer, Aug 06 2010, Aug 10 2010
STATUS
approved
a(n) = Sum_{j=0..2*i, i=0..n} A026584(i,j).
+10
19
1, 3, 9, 23, 61, 155, 401, 1023, 2629, 6723, 17241, 44135, 113101, 289643, 742049, 1900623, 4868821, 12471315, 31946601, 81831863, 209618269, 536945723, 1375418801, 3523201695, 9024876901, 23117683683, 59217191289, 151687926023
OFFSET
0,2
LINKS
Amir Sapir, The Tower of Hanoi with Forbidden Moves, The Computer J. 47 (1) (2004) 20, case cyclic++, sequence c(n) (offset 1).
FORMULA
G.f.: (1+x)/((1-x)*(1-x-4*x^2)). - Ralf Stephan, Feb 04 2004
From Klaus Purath, Feb 02 2021: (Start)
a(n) = 2*a(n-1) + 3*a(n-2) - 4*a(n-3).
a(n) = Sum_{j=0..n} A026597(j). (End)
a(n) = 2^n*(Fibonacci(n+2, 1/2) + Fibonacci(n+1, 1/2)) - 1/2. - G. C. Greubel, Dec 15 2021
MATHEMATICA
LinearRecurrence[{2, 3, -4}, {1, 3, 9}, 40] (* G. C. Greubel, Dec 15 2021 *)
PROG
(Magma) [n le 3 select 3^(n-1) else 2*Self(n-1) +3*Self(n-2) -4*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 15 2021
(Sage) [( (1+x)/((1-x)*(1-x-4*x^2)) ).series(x, n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 15 2021
KEYWORD
nonn,easy
STATUS
approved
a(n) = T(n, floor(n/2)), where T is given by A026584.
+10
18
1, 1, 1, 1, 5, 8, 19, 22, 69, 121, 341, 406, 1203, 2155, 6336, 7624, 22593, 40717, 121483, 147001, 438533, 792351, 2381512, 2892044, 8677763, 15703156, 47419503, 57728737, 173984792, 315180458, 954961034, 1164727748, 3522101709
OFFSET
0,5
LINKS
FORMULA
a(n) = A026584(n, floor(n/2))
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n+k], T[n-1, k-2] + T[n-1, k], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k] ]]]; (* T = A026584 *)
Table[T[n, Floor[n/2]], {n, 0, 40}] (* G. C. Greubel, Dec 13 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k): # T = A026584
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n//2)
else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
[T(n, n//2) for n in (0..40)] # G. C. Greubel, Dec 13 2021
KEYWORD
nonn
STATUS
approved
a(n) = T(n, n-2), T given by A026584. Also a(n) = number of integer strings s(0),...,s(n) counted by T, such that s(n)=2.
+10
17
1, 1, 5, 9, 28, 62, 167, 399, 1024, 2518, 6359, 15819, 39759, 99427, 249699, 626203, 1573524, 3953446, 9943905, 25019005, 62994733, 158680545, 399936573, 1008438757, 2543992514, 6420413940, 16210331727, 40943722115, 103453402718
OFFSET
2,3
LINKS
FORMULA
a(n) = A026584(n, n-2).
Conjecture: (n+2)*a(n) = (3*n+2)*a(n-1) +(3*n+2)*a(n-2) -(11*n-16)*a(n-3) -2*(n-3)*a(n-4) +4*(2*n-9)*a(n-5). - R. J. Mathar, Jun 23 2013
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n+k], T[n-1, k-2] + T[n-1, k], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k] ]]]; (* T = A026584 *)
Table[T[n, n-2], {n, 2, 40}] (* G. C. Greubel, Dec 12 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k): # T = A026584
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n//2)
else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
[T(n, n-2) for n in (2..40)] # G. C. Greubel, Dec 12 2021
KEYWORD
nonn
STATUS
approved
a(n) = T(n,n-4), T given by A026584. Also a(n) = number of integer strings s(0),...,s(n) counted by T, such that s(n)=4.
+10
17
1, 2, 9, 22, 69, 178, 497, 1294, 3452, 8964, 23430, 60556, 156663, 403214, 1037191, 2660978, 6821200, 17459732, 44657246, 114117628, 291449047, 743904326, 1897956899, 4840429962, 12340947855, 31455453822, 80158533099
OFFSET
4,2
LINKS
FORMULA
a(n) = A026584(n, n-4).
Conjecture: -(n+4)*(65*n-269)*a(n) +(-65*n^2+140*n+1933)*a(n-1) +(809*n^2-2431*n-4514)*a(n-2) +(-123*n^2+2496*n-205)*a(n-3) +2*(-726*n^2+3737*n-4395)*a(n-4) +8*(56*n-215)*(2*n-9)*a(n-5) = 0. - R. J. Mathar, Jun 23 2013
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n+k], T[n-1, k-2] + T[n-1, k], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k] ]]]; (* T = A026584 *)
Table[T[n, n-4], {n, 4, 40}] (* G. C. Greubel, Dec 12 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k): # T = A026584
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n//2)
else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
[T(n, n-4) for n in (4..40)] # G. C. Greubel, Dec 12 2021
KEYWORD
nonn
STATUS
approved

Search completed in 0.025 seconds