Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a057960 -id:a057960
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of strings over a 5 symbol alphabet with adjacent symbols differing by three or less.
+10
58
1, 5, 23, 107, 497, 2309, 10727, 49835, 231521, 1075589, 4996919, 23214443, 107848529, 501037445, 2327695367, 10813893803, 50238661313, 233396326661, 1084301290583, 5037394142315, 23402480441009, 108722104190981, 505095858086951, 2346549744920747
OFFSET
0,2
COMMENTS
[Empirical] a(base,n) = a(base-1,n) + 7^(n-1) for base >= 3n-2; a(base,n) = a(base-1,n) + 7^(n-1)-2 when base = 3n-3.
From Johannes W. Meijer, Aug 01 2010: (Start)
The a(n) represent the number of n-move routes of a fairy chess piece starting in a given side square (m = 2, 4, 6 or 8) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the central square the king goes crazy and turns into a red king, see A179596.
For the side squares the 512 red kings lead to 47 different red king sequences, see the cross-references for some examples.
The sequence above corresponds to four A[5] vectors with the decimal [binary] values 367 [1,0,1,1,0,1,1,1,1], 463 [1,1,1,0,0,1,1,1,1], 487 [1,1,1,1,0,0,1,1,1] and 493 [1,1,1,1,0,1,1,0,1]. These vectors lead for the corner squares to A179596 and for the central square to A179597.
This sequence belongs to a family of sequences with g.f. (1+x)/(1-4*x-k*x^2). Red king sequences that are members of this family are A003947 (k=0), A015448 (k=1), A123347 (k=2), A126473 (k=3; this sequence) and A086347 (k=4). Other members of this family are A000351 (k=5), A001834 (k=-1), A111567 (k=-2), A048473 (k=-3) and A053220 (k=-4)
Inverse binomial transform of A154244.
(End)
Equals the INVERT transform of A055099: (1, 4, 14, 50, 178, ...). - Gary W. Adamson, Aug 14 2010
Number of one-sided n-step walks taking steps from {E, W, N, NE, NW}. - Shanzhen Gao, May 10 2011
For n>=1, a(n) equals the numbers of words of length n-1 on alphabet {0,1,2,3,4} containing no subwords 00 and 11. - Milan Janjic, Jan 31 2015
LINKS
Shanzhen Gao and Keh-Hsun Chen, Tackling Sequences From Prudent Self-Avoiding Walks, FCS'14, The 2014 International Conference on Foundations of Computer Science.
S. Gao and H. Niederhausen, Sequences Arising From Prudent Self-Avoiding Walks, 2010.
FORMULA
From Johannes W. Meijer, Aug 01 2010: (Start)
G.f.: (1+x)/(1-4*x-3*x^2).
a(n) = 4*a(n-1) + 3*a(n-2) with a(0) = 1 and a(1) = 5.
a(n) = ((1+3/sqrt(7))/2)*(A)^(-n) + ((1-3/sqrt(7))/2)*(B)^(-n) with A = (-2 + sqrt(7))/3 and B = (-2-sqrt(7))/3.
Lim_{k->oo} a(n+k)/a(k) = (-1)^(n+1)*A000244(n)/(A015530(n)*sqrt(7)-A108851(n))
(End)
a(n) = A015330(n)+A015330(n+1). - R. J. Mathar, May 09 2023
MAPLE
with(LinearAlgebra): nmax:=19; m:=2; A[5]:= [1, 0, 1, 1, 0, 1, 1, 1, 1]: A:=Matrix([[0, 1, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 1, 1, 1, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0], [1, 1, 0, 0, 1, 0, 1, 1, 0], A[5], [0, 1, 1, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 0, 0, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0, 1], [0, 0, 0, 0, 1, 1, 0, 1, 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); # Johannes W. Meijer, Aug 01 2010
# second Maple program:
a:= n-> (M-> M[1, 2]+M[2, 2])(<<0|1>, <3|4>>^n):
seq(a(n), n=0..24); # Alois P. Heinz, Jun 28 2021
PROG
(S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-2](($[i]`-$[i+1]`>3)+($[i+1]`-$[i]`>3))
(PARI) a(n)=([0, 1; 3, 4]^n*[1; 5])[1, 1] \\ Charles R Greathouse IV, May 10 2016
CROSSREFS
Cf. 5 symbol differing by two or less A126392, one or less A057960.
Cf. Red king sequences side squares [numerical value A[5]]: A086347 [495], A179598 [239], A126473 [367], A123347 [335], A179602 [95], A154964 [31], A015448 [327], A152187 [27], A003947 [325], A108981 [11], A007483 [2]. - Johannes W. Meijer, Aug 01 2010
Cf. A055099.
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Dec 27 2006
EXTENSIONS
Edited by Johannes W. Meijer, Aug 10 2010
STATUS
approved
Power ceiling-floor sequence of (golden ratio)^4.
+10
20
7, 47, 323, 2213, 15169, 103969, 712615, 4884335, 33477731, 229459781, 1572740737, 10779725377, 73885336903, 506417632943, 3471038093699, 23790849022949, 163064905066945, 1117663486445665, 7660579500052711
OFFSET
0,1
COMMENTS
Let f = floor and c = ceiling. For x > 1, define four sequences as functions of x, as follows:
p1(0) = f(x), p1(n) = f(x*p1(n-1));
p2(0) = f(x), p2(n) = c(x*p2(n-1)) if n is odd and p2(n) = f(x*p1(n-1)) if n is even;
p3(0) = c(x), p3(n) = f(x*p3(n-1)) if n is odd and p3(n) = c(x*p3(n-1)) if n is even;
p4(0) = c(x), p4(n) = c(x*p4(n-1)).
The present sequence is given by a(n) = p3(n).
Following the terminology at A214986, call the four sequences power floor, power floor-ceiling, power ceiling-floor, and power ceiling sequences. In the table below, a sequence is identified with an A-numbered sequence if they appear to agree except possibly for initial terms. Notation: S(t)=sqrt(t), r = (1+S(5))/2 = golden ratio, and Limit = limit of p3(n)/p2(n).
x ......p1..... p2..... p3..... p4.......Limit
r^2.....A001519 A001654 A061646 A001906..-1+S(5)
r^3.....A024551 A001076 A015448 A049652..-1+S(5)
r^4.....A049685 A157335 A214992 A004187..-19+9*S(5)
r^5.....A214993 A049666 A015457 A214994...(-9+5*S(5))/2
r^6.....A007805 A156085 A214995 A049660..-151+68*S(5)
2+S(2)..A007052 A214996 A214997 A007070..(1+S(2))/2
1+S(3)..A057960 A002605 A028859 A077846..(1+S(3))/2
2+S(3)..A001835 A109437 A214998 A001353..-4+3*S(3)
S(5)....A214999 A215091 A218982 A218983..1.26879683...
2+S(5)..A024551 A001076 A015448 A049652..-1+S(5)
2+S(6)..A218984 A090017 A123347 A218985..S(3/2)
2+S(7)..A218986 A015530 A126473 A218987..(1+S(7))/3
2+S(8)..A218988 A057087 A086347 A218989..(1+S(2))/2
3+S(8)..A001653 A084158 A218990 A001109..-13+10*S(2)
3+S(10).A218991 A005668 A015451 A218992..-2+S(10)
...
Properties of p1, p2, p3, p4:
(1) If x > 2, the terms of p2 and p3 interlace: p2(0) < p3(0) < p2(1) < p3(1) < p2(2) < p3(2)... Also, p1(n) <= p2(n) <= p3(n) <= p4(n) <= p1(n+1) for all x>0 and n>=0.
(2) If x > 2, the limits L(x) = limit(p/x^n) exist for the four functions p(x), and L1(x) <= L2(x) <= L3(x) <= L4 (x). See the Mathematica programs for plots of the four functions; one of them also occurs in the Odlyzko and Wilf article, along with a discussion of the special case x = 3/2.
(3) Suppose that x = u + sqrt(v) where v is a nonsquare positive integer. If u = f(x) or u = c(x), then p1, p2, p3, p4 are linear recurrence sequences. Is this true for sequences p1, p2, p3, p4 obtained from x = (u + sqrt(v))^q for every positive integer q?
(4) Suppose that x is a Pisot-Vijayaraghavan number. Must p1, p2, p3, p4 then be linearly recurrent? If x is also a quadratic irrational b + c*sqrt(d), must the four limits L(x) be in the field Q(sqrt(d))?
(5) The Odlyzko and Wilf article (page 239) raises three interesting questions about the power ceiling function; it appears that they remain open.
FORMULA
a(n) = floor(r*a(n-1) if n is odd and a(n) = ceiling(r*a(n-1) if n is even, where a(0) = ceiling(r), r = (golden ratio)^4 = (7 + sqrt(5))/2.
a(n) = 6*a(n-1) + 6*a(n-2) - a(n-3).
G.f.: (7 + 5*x - x^2)/(1 - 6*x - 6*x^2 + x^3).
a(n) = (10*(-2)^n+(10+3*sqrt(5))*(7-3*sqrt(5))^(n+2)+(10-3*sqrt(5))*(7+3*sqrt(5))^(n+2))/(90*2^n). - Bruno Berselli, Nov 14 2012
a(n) = 7*A157335(n) + 5*A157335(n-1) - A157335(n-2). - R. J. Mathar, Feb 05 2020
EXAMPLE
a(0) = ceiling(r) = 7, where r = (1+sqrt(5))/2)^4 = 6.8...; a(1) = floor(7*r) = 47; a(2) = ceiling(47) = 323.
MATHEMATICA
(* Program 1. A214992 and related sequences *)
x = GoldenRatio^4; z = 30; (* z = # terms in sequences *)
z1 = 100; (* z1 = # digits in approximations *)
f[x_] := Floor[x]; c[x_] := Ceiling[x];
p1[0] = f[x]; p2[0] = f[x]; p3[0] = c[x]; p4[0] = c[x];
p1[n_] := f[x*p1[n - 1]]
p2[n_] := If[Mod[n, 2] == 1, c[x*p2[n - 1]], f[x*p2[n - 1]]]
p3[n_] := If[Mod[n, 2] == 1, f[x*p3[n - 1]], c[x*p3[n - 1]]]
p4[n_] := c[x*p4[n - 1]]
Table[p1[n], {n, 0, z}] (* A049685 *)
Table[p2[n], {n, 0, z}] (* A157335 *)
Table[p3[n], {n, 0, z}] (* A214992 *)
Table[p4[n], {n, 0, z}] (* A004187 *)
Table[p4[n] - p1[n], {n, 0, z}] (* A004187 *)
Table[p3[n] - p2[n], {n, 0, z}] (* A098305 *)
(* Program 2. Plot of power floor and power ceiling functions, p1(x) and p4(x) *)
f[x_] := f[x] = Floor[x]; c[x_] := c[x] = Ceiling[x];
p1[x_, 0] := f[x]; p1[x_, n_] := f[x*p1[x, n - 1]];
p4[x_, 0] := c[x]; p4[x_, n_] := c[x*p4[x, n - 1]];
Plot[Evaluate[{p1[x, 10]/x^10, p4[x, 10]/x^10}], {x, 2, 3}, PlotRange -> {0, 4}]
(* Program 3. Plot of power floor-ceiling and power ceiling-floor functions, p2(x) and p3(x) *)
f[x_] := f[x] = Floor[x]; c[x_] := c[x] = Ceiling[x];
p2[x_, 0] := f[x]; p3[x_, 0] := c[x];
p2[x_, n_] := If[Mod[n, 2] == 1, c[x*p2[x, n - 1]], f[x*p2[x, n - 1]]]
p3[x_, n_] := If[Mod[n, 2] == 1, f[x*p3[x, n - 1]], c[x*p3[x, n - 1]]]
Plot[Evaluate[{p2[x, 10]/x^10, p3[x, 10]/x^10}], {x, 2, 3}, PlotRange -> {0, 4}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 08 2012, Jan 24 2013
STATUS
approved
Number of three-choice paths along a corridor of height 5, starting from the lower side.
+10
15
1, 2, 5, 13, 35, 96, 266, 741, 2070, 5791, 16213, 45409, 127206, 356384, 998509, 2797678, 7838801, 21963661, 61540563, 172432468, 483144522, 1353740121, 3793094450, 10628012915, 29779028189, 83438979561, 233790820762, 655067316176, 1835457822857, 5142838522138, 14409913303805
OFFSET
1,2
COMMENTS
From Svjetlan Feretic, Jun 01 2013: (Start)
A three-choice path is a path whose steps lie in the set {(1,1), (1,0), (1,-1)}.
The paths under consideration "live" in a corridor like 0<=y<=5. Thus, the ordinate of a vertex of a path can take six values (0,1,2,3,4,5), but the height of the corridor is five.
a(1)=1 is the number of paths with zero steps, a(2)=2 is the number of paths with one step, a(3)=5 is the number of paths with two steps, ...
Narrower corridors produce A000012, A000079, A000129, A001519, A057960. An infinitely wide corridor would produce A005773.
(End)
Diagonal sums of A114164. - Paul Barry, Nov 15 2005
C(n):= a(n)*(-1)^n appears in the following formula for the nonpositive powers of rho*sigma, where rho:=2*cos(Pi/7) and sigma:=sin(3*Pi/7)/sin(Pi/7) = rho^2-1 are the ratios of the smaller and larger diagonal length to the side length in a regular 7-gon (heptagon). See the Steinbach reference where the basis <1,rho,sigma> is used in an extension of the rational field. (rho*sigma)^(-n) = C(n) + B(n)*rho + A(n)*sigma,n>=0, with B(n)= A181880(n-2)*(-1)^n, and A(n)= A116423(n+1)*(-1)^(n+1). For the nonnegative powers see A120757(n), |A122600(n-1)| and A181879(n), respectively. See also a comment under A052547.
a(n) is also the number of bi-wall directed polygons with n cells. (The definition of bi-wall directed polygons is given in the article on A122737.)
LINKS
Svjetlan Feretic, Generating functions for bi-wall directed polygons, in: Proc. of the Seventh Int. Conf. on Lattice Path Combinatorics and Applications (eds. S. Rinaldi and S. G. Mohanty), Siena, 2010, 147-151.
Peter Steinbach, Golden fields: a case for the heptagon, Math. Mag. 70 (1997), p. 22-31 (formula 5).
Roman Witula, Damian Slota and Adam Warzynski, Quasi-Fibonacci Numbers of the Seventh Order, J. Integer Seq., 9 (2006), Article 06.4.3.
FORMULA
a(n) = 4*a(n-1) - 3*a(n-2) - a(n-3).
From Paul Barry, Nov 15 2005: (Start)
G.f.: (1-2*x)/(1-4*x+3*x^2+x^3).
a(n) = Sum_{k=0..floor(n/2)} (Sum_{j=0..n-k} C(n-k, j)*C(j+k, 2k));
a(n) = Sum_{k=0..floor(n/2)} (Sum_{j=0..n-k} C(n-k, k+j)*C(k, k-j)*2^(n-2k-j));
a(n) = Sum_{k=0..floor(n/2)} (Sum_{j=0..n-2*k} C(n-j, n-2*k-j)*C(k, j)(-1)^j*2^(n-2*k-j)). (End)
a(n-1) = -B(n;-1) = (1/7)*((c(4)-c(1))*(1-c(1))^n + (c(1)-c(2))*(1-c(2))^n + (c(2)-c(4))*(1-c(4))^n), where a(-1):=0, c(j):=2*cos(2*Pi*j/7). Moreover, B(n;d), n in N, d in C, denotes the respective quasi-Fibonacci number defined in comments to A121449 or in Witula-Slota-Warzynski's paper (see also A077998, A006054, A052975, A094789, A121442). - Roman Witula, Aug 09 2012
MATHEMATICA
LinearRecurrence[{4, -3, -1}, {1, 2, 5}, 50] (* Roman Witula, Aug 09 2012 *)
CoefficientList[Series[(1 - 2 x)/(1 - 4 x + 3 x^2 + x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 18 2015 *)
PROG
(Magma) I:=[1, 2, 5]; [n le 3 select I[n] else 4*Self(n-1)-3*Self(n-2)-Self(n-3): n in [1..35]]; // Vincenzo Librandi, Sep 18 2015
(PARI) x='x+O('x^30); Vec((1-2*x)/(1-4*x+3*x^2+x^3)) \\ G. C. Greubel, Apr 19 2018
KEYWORD
easy,nonn
AUTHOR
Philippe Deléham, Jul 25 2003
EXTENSIONS
Name corrected and clarified, and offset 1 from Svjetlan Feretic, Jun 01 2013
STATUS
approved
T(n,k) is the number of n X k binary arrays without the pattern 0 1 diagonally, vertically or antidiagonally.
+10
13
2, 4, 3, 8, 7, 4, 16, 17, 10, 5, 32, 41, 26, 13, 6, 64, 99, 68, 35, 16, 7, 128, 239, 178, 95, 44, 19, 8, 256, 577, 466, 259, 122, 53, 22, 9, 512, 1393, 1220, 707, 340, 149, 62, 25, 10, 1024, 3363, 3194, 1931, 950, 421, 176, 71, 28, 11, 2048, 8119, 8362, 5275, 2658, 1193, 502, 203, 80, 31, 12
OFFSET
1,1
COMMENTS
Number of 0..n strings of length k and adjacent elements differing by one or less. (See link for bijection.) Equivalently, number of base (n+1) k digit numbers with adjacent digits differing by one or less. - Andrew Howroyd, Mar 30 2017
All rows are linear recurrences with constant coefficients. See PARI script to obtain generating functions. - Andrew Howroyd, Apr 15 2017
Equivalently, the number of walks of length k-1 on the path graph P_{n+1} with a loop added at each vertex. - Pontus von Brömssen, Sep 08 2021
LINKS
Arnold Knopfmacher, Toufik Mansour, Augustine Munagi and Helmut Prodinger, Smooth words and Chebyshev polynomials, arXiv:0809.0551v1 [math.CO], 2008.
FORMULA
Empirical: T(n,1) = n + 1.
Empirical: T(n,2) = 3*n + 1.
Empirical: T(n,3) = 9*n - 1.
Empirical: T(n,4) = 27*n - 13 for n > 1.
Empirical: T(n,5) = 81*n - 65 for n > 2.
Empirical: T(n,6) = 243*n - 265 for n > 3.
Empirical: T(n,7) = 729*n - 987 for n > 4.
Empirical: T(n,8) = 2187*n - 3495 for n > 5.
Empirical: T(1,k) = 2*T(1,k-1).
Empirical: T(2,k) = 2*T(2,k-1) + T(2,k-2).
Empirical: T(3,k) = 3*T(3,k-1) - T(3,k-2).
Empirical: T(4,k) = 3*T(4,k-1) - 2*T(4,k-3).
Empirical: T(5,k) = 4*T(5,k-1) - 3*T(5,k-2) - T(5,k-3).
Empirical: T(6,k) = 4*T(6,k-1) - 2*T(6,k-2) - 4*T(6,k-3) + T(6,k-4).
Empirical: T(7,k) = 5*T(7,k-1) - 6*T(7,k-2) - T(7,k-3) + 2*T(7,k-4).
Empirical: T(8,k) = 5*T(8,k-1) - 5*T(8,k-2) - 5*T(8,k-3) + 5*T(8,k-4) + T(8,k-5).
EXAMPLE
Table starts:
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
3 7 17 41 99 239 577 1393 3363 8119 19601 47321 114243 275807
4 10 26 68 178 466 1220 3194 8362 21892 57314 150050 392836 1028458
5 13 35 95 259 707 1931 5275 14411 39371 107563 293867 802859 2193451
6 16 44 122 340 950 2658 7442 20844 58392 163594 458356 1284250 3598338
7 19 53 149 421 1193 3387 9627 27383 77923 221805 631469 1797957 5119593
8 22 62 176 502 1436 4116 11814 33942 97582 280676 807574 2324116 6689624
9 25 71 203 583 1679 4845 14001 40503 117263 339699 984515 2854281 8277153
10 28 80 230 664 1922 5574 16188 47064 136946 398746 1161634 3385486 9869934
11 31 89 257 745 2165 6303 18375 53625 156629 457795 1338779 3916897 11463989
Some solutions for 5 X 3:
1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1
1 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
MATHEMATICA
rows = 11; rowGf[n_, x_] = 1 + (x*(n - (3*n + 2)*x) + (2*x^2)*(1 + ChebyshevU[n-1, (1-x)/(2*x)])/ChebyshevU[n, (1-x)/(2*x)])/(1-3*x)^2;
row[n_] := rowGf[n+1, x] + O[x]^(rows+1) // CoefficientList[#, x]& // Rest; T = Array[row, rows]; Table[T[[n-k+1, k]], {n, 1, rows}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 07 2017, after Andrew Howroyd *)
PROG
(PARI) \\ from Knopfmacher et al.
RowGf(k, x='x) = my(z=(1-x)/(2*x)); 1 + (x*(k-(3*k+2)*x) + (2*x^2)*(1+polchebyshev(k-1, 2, z))/polchebyshev(k, 2, z))/(1-3*x)^2;
T(n, k) = {polcoef(RowGf(n+1) + O(x*x^k), k)}
for(n=1, 10, print(Vec(RowGf(n+1) + O(x^11)))) \\ Andrew Howroyd, Apr 15 2017 [updated Mar 13 2021]
CROSSREFS
Columns 2..8 are A016777, A017257(n-1), A188861-A188865.
Rows 2..31 are A001333(n+1), A126358, A057960(n+1), A126360, A002714, A126362-A126386.
Main diagonal is A188860.
KEYWORD
nonn,tabl
AUTHOR
R. H. Hardin, Apr 12 2011
STATUS
approved
a(0) = 1; thereafter a(2*n + 1) = 3^n, a(2*n + 2) = 2 * 3^n.
+10
9
1, 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,3
COMMENTS
Row sums of triangle in A123149. - Philippe Deléham, May 04 2012
This is simply the classic sequence A038754 prefixed by a 1. - N. J. A. Sloane, Nov 23 2017
Binomial transform is A057960.
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, May 30 2014
a(n) is also the number of achiral color patterns in a row or cycle of length n using three or fewer colors. Two color patterns are the same if we permute the colors, so ABCAB=BACBA. For a cycle, we can rotate the colors, so ABCAB=CABAB. A row is achiral if it is the same as some color permutation of its reverse. Thus the reversal of ABCAB is BACBA, which is equivalent to ABCAB when we permute A and B. A cycle is achiral if it is the same as some rotation of some color permutation of its reverse. Thus CABAB reversed is BABAC. We can permute A and B to get ABABC and then rotate to get CABAB, so CABAB is achiral. It is interesting that the number of achiral color patterns is the same for rows and cycles. - Robert A. Russell, Mar 10 2018
LINKS
Shaun V. Ault and Charles Kicey, Counting paths in corridors using circular Pascal arrays, arXiv:1407.2197 [math.CO], 2014.
Shaun V. Ault and Charles Kicey, Counting paths in corridors using circular Pascal arrays, Discrete Mathematics, Volume 332, October 2014, Pages 45-54.
Daniel Birmajer, Juan B. Gil, Jordan O. Tirrell, and Michael D. Weiner, Pattern-avoiding stabilized-interval-free permutations, arXiv:2306.03155 [math.CO], 2023.
Johann Cigler, Some remarks and conjectures related to lattice paths in strips along the x-axis, arXiv:1501.04750 [math.CO], 2015-2016.
FORMULA
G.f.: (1 + x - x^2) / (1 - 3*x^2).
Expansion of 1 / (1 - x / (1 - x / (1 + x / (1 + x)))) in powers of x.
a(n+1) = A038754(n).
a(n) = Sum_{k=0..n} A123149(n,k). - Philippe Deléham, May 04 2012
a(n) = (3-(1+(-1)^n)*(3-2*sqrt(3))/2)*sqrt(3)^(n-3) for n>0, a(0)=1. - Bruno Berselli, Mar 19 2013
a(0) = 1, a(1) = 1, a(n) = a(n-1) + a(n-2) if n is odd, and a(n) = a(n-1) + a(n-2) + a(n-3) if n is even. - Jon Perry, Mar 19 2013
For odd n = 2m-1, a(2m-1) = T(m,1)+T(m,2)+T(m,3) for triangle T(m,k) of A140735; for even n = 2m, a(2m) = T(m,1)+T(m,2)+T(m,3) for triangle T(m,k) of A293181. - Robert A. Russell, Mar 10 2018
From Robert A. Russell, Oct 21 2018: (Start)
a(2m) = S2(m+3,3) - 4*S2(m+2,3) + 5*S2(m+1,3) - 2*S2(m,3).
a(2m-1) = S2(m+2,3) - 3*S2(m+1,3) + 2*S2(m,3), where S2(n,k) is the Stirling subset number A008277.
a(n) = 2*A001998(n-1) - A124302(n) = A124302(n) - 2*A107767(n-1) = A001998(n-1) - A107767(n-1).
a(n) = 2*A056353(n) - A002076(n) = A002076(n) - 2*A320743(n) = A056353(n) - A320743(n).
a(n) = A057427(n) + A052551(n-2) + A304973(n). (End)
EXAMPLE
G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 9*x^5 + 18*x^6 + 27*x^7 + 54*x^8 + ...
From Robert A. Russell, Mar 10 2018: (Start)
For a(4) = 6, the achiral color patterns for rows are AAAA, AABB, ABAB, ABBA, ABBC, and ABCA. Note that for cycles AABB=ABBA and ABBC=ABCA. The achiral patterns for cycles are AAAA, AAAB, AABB, ABAB, ABAC, and ABBC. Note that AAAB and ABAC are not achiral rows.
For a(5) = 9, the achiral color patterns (for both rows and cycles) are AAAAA, AABAA, ABABA, ABBBA, AABCC, ABACA, ABBBC, ABCAB, and ABCBA. (End)
MATHEMATICA
Join[{1}, RecurrenceTable[{a[1]==1, a[2]==2, a[n]==3 a[n-2]}, a, {n, 40}]] (* Bruno Berselli, Mar 19 2013 *)
CoefficientList[Series[(1+x-x^2)/(1-3*x^2), {x, 0, 50}], x] (* G. C. Greubel, Apr 14 2017 *)
Table[If[EvenQ[n], StirlingS2[(n+6)/2, 3] - 4 StirlingS2[(n+4)/2, 3] + 5 StirlingS2[(n+2)/2, 3] - 2 StirlingS2[n/2, 3], StirlingS2[(n+5)/2, 3] - 3 StirlingS2[(n+3)/2, 3] + 2 StirlingS2[(n+1)/2, 3]], {n, 0, 40}] (* Robert A. Russell, Oct 21 2018 *)
Join[{1}, Table[If[EvenQ[n], 2 3^((n-2)/2), 3^((n-1)/2)], {n, 40}]] (* Robert A. Russell, Oct 28 2018 *)
PROG
(PARI) {a(n) = if( n<1, n==0, n--; (n%2 + 1) * 3^(n \ 2))}
(Magma) I:=[1, 1, 2]; [n le 3 select I[n] else 3*Self(n-2): n in [1..40]]; // Bruno Berselli, Mar 19 2013
(Maxima) makelist(if n=0 then 1 else (1+mod(n-1, 2))*3^floor((n-1)/2), n, 0, 40); /* Bruno Berselli, Mar 19 2013 */
(PARI) my(x='x+O('x^50)); Vec((1+x-x^2)/(1-3*x^2)) \\ G. C. Greubel, Apr 14 2017
(SageMath)
def A182522(n): return (3 -(3-2*sqrt(3))*((n+1)%2))*3^((n-3)/2) + int(n==0)/3
[A182522(n) for n in range(41)] # G. C. Greubel, Jul 17 2023
CROSSREFS
Cf. A038754 (essentially the same sequence).
Also row sums of triangle in A169623.
Column 3 of A305749.
Cf. A124302 (oriented), A001998 (unoriented), A107767 (chiral), for rows, varying offsets.
Cf. A002076 (oriented), A056353 (unoriented), A320743 (chiral), for cycles.
KEYWORD
nonn,easy
AUTHOR
Michael Somos, May 03 2012
EXTENSIONS
Edited by Bruno Berselli, Mar 19 2013
Definition simplified by N. J. A. Sloane, Nov 23 2017
STATUS
approved
Triangle read by rows: Riordan array (1/(1 - x), x*(1 + x)/(1 - x - x^2)).
+10
7
1, 1, 1, 1, 3, 1, 1, 6, 5, 1, 1, 11, 15, 7, 1, 1, 19, 37, 28, 9, 1, 1, 32, 82, 87, 45, 11, 1, 1, 53, 170, 234, 169, 66, 13, 1, 1, 87, 337, 573, 535, 291, 91, 15, 1, 1, 142, 647, 1314, 1511, 1061, 461, 120, 17, 1, 1, 231, 1213, 2871, 3933, 3398, 1904, 687, 153, 19, 1
OFFSET
0,5
FORMULA
T(n,k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k) + T(n-2,k-1), T(n,0) = 1, T(n,k) = 0 if k > n.
Sum_{k = 0..n} T(n,k)* x^k = A000012(n), A057960(n), A196472(n+1), A218988(n-1) for x = 0, 1, 2, 3 respectively.
EXAMPLE
Triangle T(n,k) begins:
k=0 1 2 3 4 5 6
n=0: 1;
n=1: 1, 1;
n=2: 1, 3, 1;
n=3: 1, 6, 5, 1;
n=4: 1, 11, 15, 7, 1;
n=5: 1, 19, 37, 28, 9, 1;
n=6: 1, 32, 82, 87, 45, 11, 1;
...
87 = 28 + 37 + 7 + 15.
CROSSREFS
Cf. A000012 (column k=0), A000384, A001911, A005408.
Cf. A057960 (row sums), A196472, A218988.
KEYWORD
nonn,tabl,easy
AUTHOR
Philippe Deléham, Feb 29 2024
STATUS
approved
Expansion of g.f. 1/(1 - 3*x + 2*x^3).
+10
6
1, 3, 9, 25, 69, 189, 517, 1413, 3861, 10549, 28821, 78741, 215125, 587733, 1605717, 4386901, 11985237, 32744277, 89459029, 244406613, 667731285, 1824275797, 4984014165, 13616579925, 37201188181, 101635536213, 277673448789, 758617970005, 2072582837589, 5662401615189
OFFSET
0,2
COMMENTS
Number of (s(0), s(1), ..., s(n+2)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| <= 1 for i = 1..n+2, s(0) = 1, s(n+2) = 3. - Herbert Kociemba, Jun 17 2004
A Whitney transform of 2^n (see Benoit Cloitre formula and A004070). The Whitney transform maps the sequence with g.f. g(x) to that with g.f. (1/(1-x))g(x(1+x)). - Paul Barry, Feb 16 2005
LINKS
Fan Chung and R. L. Graham, Primitive juggling sequences, Am. Math. Monthly 115 (3) (2008) 185-194.
William J. Keith, Partitions into parts simultaneously regular, distinct, and/or flat, Proceedings of CANT 2016; arXiv:1911.04755 [math.CO], 2019. Mentions this sequence.
FORMULA
a(n) = 3*a(n-1) - 2*a(n-3) = 2*A057960(n) - 1 = round(2*A028859(n)/sqrt(3) - 1/3) = Sum_{i} b(n, i), where b(n, 0) = b(n, 6) = 0, b(0, 3) = 1, b(0, i) = 0 if i <> 3 and b(n+1, i) = b(n, i-1) + b(n, i) + b(n, i+1) if 0 < i < 6 (i.e., the number of three-choice paths along a corridor width 5, starting from the middle). - Henry Bottomley, Mar 06 2003
Binomial transform of A068911. a(n) = (1+sqrt(3))^n*(2+sqrt(3))/3 + (1-sqrt(3))^n*(2-sqrt(3))/3 - 1/3. - Paul Barry, Feb 17 2004
a(0)=1; for n >= 1, a(n) = ceiling((1+sqrt(3))*a(n-1)). - Benoit Cloitre, Jun 19 2004
a(n) = Sum_{i=0..n} Sum_{j=0..n} 2^j*binomial(j, i-j). - Benoit Cloitre, Oct 23 2004
a(n) = 2*(a(n-1) + a(n-2)) + 1, n > 1. - Gary Detlefs, Jun 20 2010
a(n) = (2*A052945(n+1) - 1)/3. - R. J. Mathar, Mar 31 2011
a(n) = floor((1+sqrt(3))^(n+2)/6). - Bruno Berselli, Feb 05 2013
a(n) = (-2 + (1-sqrt(3))^(n+2) + (1+sqrt(3))^(n+2))/6. - Alexander R. Povolotsky, Feb 13 2016
E.g.f.: exp(x)*(4*cosh(sqrt(3)*x) + 2*sqrt(3)*sinh(sqrt(3)*x) - 1)/3. - Stefano Spezia, Mar 02 2024
MATHEMATICA
CoefficientList[Series[1 / (1 - 3 x + 2 x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2013 *)
LinearRecurrence[{3, 0, -2}, {1, 3, 9}, 40] (* Harvey P. Dale, Apr 27 2014 *)
PROG
(PARI) a(n)=sum(i=0, n, sum(j=0, n, 2^j*binomial(j, i-j)))
(PARI) Vec(1/(1-3*x+2*x^3) + O(x^100)) \\ Altug Alkan, Mar 24 2016
CROSSREFS
First differences are in A002605.
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
EXTENSIONS
Name changed by Arkadiusz Wesolowski, Dec 06 2011
STATUS
approved
Odd numbers m such that the sequence defined by b(1) = m; for k>1, b(k) = floor((1+sqrt(3))*b(k-1)) contains only odd numbers.
+10
4
5, 7, 13, 19, 21, 27, 29, 35, 37, 43, 49, 51, 57, 59, 65, 67, 71, 73, 79, 81, 87, 89, 95, 97, 101, 103, 109, 111, 117, 119, 125, 131, 133, 139, 141, 147, 149, 155, 161, 163, 169, 171, 177, 179, 183, 185, 191, 193, 199, 201, 207, 213, 215, 221, 223, 229, 231, 237
OFFSET
1,1
COMMENTS
Conjecture: let r(z)= (1/2) *(z+sqrt(z^2+4*z)), for any integral z>=1. Then the sequence a(n)-4n (where a(n) is the sequence of odd numbers m such that the sequence defined by b(1) = m; for k>1, b(k) = floor(r(z)*b(k-1)) contains only odd numbers) becomes ultimately periodic. Benoit Cloitre, Aug 10 2003
FORMULA
Observation: a(n+1)-a(n) = 2, 4 or 6 for every n, a(n)=4n+O(1) and more precisely it seems that abs(a(n)-4n)<=9. Is the sequence a(n)-4n ultimately periodic ? Benoit Cloitre, Aug 10 2003
EXAMPLE
For m = 5 we get 5, 13, 35, 95, 259, 707, 1931, 5275, 14411, 39371, ... (cf. A057960).
CROSSREFS
Cf. A086843.
KEYWORD
nonn
AUTHOR
Philippe Deléham, Aug 09 2003
STATUS
approved
Expansion of (1-3x+x^2)/((1-2x)(1-4x+x^2)).
+10
4
1, 3, 10, 35, 126, 461, 1702, 6315, 23494, 87533, 326382, 1217483, 4542526, 16950573, 63255670, 236063915, 880983606, 3287837741, 12270301822, 45793238475, 170902389934, 637815796973, 2380359749382, 8883621103403
OFFSET
0,2
COMMENTS
Binomial transform of A057960.
FORMULA
a(0)=1, a(1)=3, a(2)=10, a(n)=6a(n-1)-9a(n-2)+2a(n-3), n>2.
a(n) = 2^n/3+(2+sqrt(3))(2+sqrt(3))^n/6+(2-sqrt(3))(2-sqrt(3))^n/6.
a(n) = A087944(n+1)/2.
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Sep 16 2003
STATUS
approved
Number of base 5 n-digit numbers with adjacent digits differing by two or less.
+10
3
1, 5, 19, 75, 295, 1161, 4569, 17981, 70763, 278483, 1095951, 4313041, 16973681, 66798773, 262882051, 1034554523, 4071419319, 16022795225, 63056626377, 248155086189, 976597549531, 3843333571747, 15125179200799, 59524119253665
OFFSET
0,2
COMMENTS
a(base,n)=a(base-1,n)+5^(n-1) for base>=2n-1; a(base,n)=a(base-1,n)+5^(n-1)-2 when base=2n-2.
FORMULA
a(n) = 4*a(n-1)-a(n-3). G.f.: -(x^2-x-1)/(x^3-4*x+1). [Colin Barker, Nov 25 2012]
MATHEMATICA
LinearRecurrence[{4, 0, -1}, {1, 5, 19}, 30] (* Harvey P. Dale, Apr 27 2018 *)
PROG
(S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-2](($[i]`-$[i+1]`>2)+($[i+1]`-$[i]`>2))
CROSSREFS
Cf. Base 5 differing by one or less A057960.
KEYWORD
nonn,base
AUTHOR
R. H. Hardin, Dec 28 2006
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 05 2010
STATUS
approved

Search completed in 0.014 seconds