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-3 of 3 results.

A126473 Number of strings over a 5 symbol alphabet with adjacent symbols differing by three or less.

Original entry on oeis.org

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

Views

Author

R. H. Hardin, Dec 27 2006

Keywords

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

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.

Programs

  • 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
  • Mathematica
    LinearRecurrence[{4, 3}, {1, 5}, 24] (* Jean-François Alcover, Dec 10 2024 *)
  • PARI
    a(n)=([0,1; 3,4]^n*[1;5])[1,1] \\ Charles R Greathouse IV, May 10 2016

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

Extensions

Edited by Johannes W. Meijer, Aug 10 2010

A201042 T(n,k)=Number of -k..k arrays of n elements with adjacent element differences also in -k..k.

Original entry on oeis.org

3, 5, 7, 7, 19, 17, 9, 37, 75, 41, 11, 61, 203, 295, 99, 13, 91, 429, 1111, 1161, 239, 15, 127, 781, 3011, 6083, 4569, 577, 17, 169, 1287, 6691, 21141, 33305, 17981, 1393, 19, 217, 1975, 13021, 57343, 148433, 182349, 70763, 3363, 21, 271, 2873, 23045, 131781
Offset: 1

Views

Author

R. H. Hardin Nov 26 2011

Keywords

Comments

Table starts
....3.......5........7.........9.........11..........13..........15
....7......19.......37........61.........91.........127.........169
...17......75......203.......429........781........1287........1975
...41.....295.....1111......3011.......6691.......13021.......23045
...99....1161.....6083.....21141......57343......131781......268983
..239....4569....33305....148433.....491429.....1333683.....3139529
..577...17981...182349...1042167....4211559....13497523....36644243
.1393...70763...998383...7317185...36093157...136601483...427707523
.3363..278483..5466269..51374875..309319197..1382473365..4992154799
.8119.1095951.29928491.360709449.2650872719.13991301963.58267877227

Examples

			Some solutions for n=4 k=7
.-5...-1....2....2...-3....4...-4....4....5....2...-6...-1....1....4....2....0
.-3....0....3....1....2....4...-3....4....2...-5....1....6....5....7....4....0
.-5...-5...-4...-3....2...-2....1....5....7...-7....0....2....4....1....1....2
.-7...-1....2...-6....1...-1...-5....7....0...-1...-5....6...-3....5...-1....2
		

Crossrefs

Column 1 is A001333(n+1)
Column 2 is A126392
Column 3 is A126475
Column 4 is A126504
Column 5 is A126532
Row 1 is A004273(n+1)
Row 2 is A003215
Row 3 is A063494(n+1)

Formula

Empirical for columns:
k=1: a(n) = 2*a(n-1) +a(n-2)
k=2: a(n) = 4*a(n-1) -a(n-3)
k=3: a(n) = 5*a(n-1) +3*a(n-2) -2*a(n-3) -a(n-4)
k=4: a(n) = 7*a(n-1) +a(n-2) -6*a(n-3) +a(n-5)
k=5: a(n) = 8*a(n-1) +6*a(n-2) -9*a(n-3) -5*a(n-4) +2*a(n-5) +a(n-6)
k=6: a(n) = 10*a(n-1) +3*a(n-2) -18*a(n-3) -a(n-4) +8*a(n-5) -a(n-7)
k=7: a(n) = 11*a(n-1) +10*a(n-2) -24*a(n-3) -15*a(n-4) +13*a(n-5) +7*a(n-6) -2*a(n-7) -a(n-8)
Empirical for rows:
n=1: a(k) = 2*k + 1
n=2: a(k) = 3*k^2 + 3*k + 1
n=3: a(k) = (14/3)*k^3 + 7*k^2 + (13/3)*k + 1
n=4: a(k) = (29/4)*k^4 + (29/2)*k^3 + (51/4)*k^2 + (11/2)*k + 1
n=5: a(k) = (169/15)*k^5 + (169/6)*k^4 + 32*k^3 + (119/6)*k^2 + (101/15)*k + 1
n=6: a(k) = (2101/120)*k^6 + (2101/40)*k^5 + (1753/24)*k^4 + (1405/24)*k^3 + (569/20)*k^2 + (119/15)*k + 1
n=7: a(k) = (17141/630)*k^7 + (17141/180)*k^6 + (28177/180)*k^5 + (2759/18)*k^4 + (17299/180)*k^3 + (6929/180)*k^2 + (1921/210)*k + 1

A285266 Array read by antidiagonals: T(m,n) = number of m-ary words of length n with adjacent elements differing by 2 or less.

Original entry on oeis.org

1, 3, 1, 9, 4, 1, 27, 14, 5, 1, 81, 50, 19, 6, 1, 243, 178, 75, 24, 7, 1, 729, 634, 295, 100, 29, 8, 1, 2187, 2258, 1161, 418, 125, 34, 9, 1, 6561, 8042, 4569, 1748, 543, 150, 39, 10, 1, 19683, 28642, 17981, 7310, 2363, 668, 175, 44, 11, 1
Offset: 3

Views

Author

Andrew Howroyd, Apr 15 2017

Keywords

Comments

All rows are linear recurrences with constant coefficients. See PARI script to obtain generating functions.

Examples

			Array starts (m>=3, n>=0):
1  3  9  27  81  243   729  2187   6561 ...
1  4 14  50 178  634  2258  8042  28642 ...
1  5 19  75 295 1161  4569 17981  70763 ...
1  6 24 100 418 1748  7310 30570 127842 ...
1  7 29 125 543 2363 10287 44787 194995 ...
1  8 34 150 668 2986 13362 59816 267802 ...
1  9 39 175 793 3611 16475 75229 343633 ...
1 10 44 200 918 4236 19598 90790 420870 ...
		

Crossrefs

Rows 4-32 are A055099, A126392-A126419.

Programs

  • Mathematica
    diff = 2; m0 = 3; mmax = 12;
    TransferGf[m_, u_, t_, v_, z_] := Array[u, m].LinearSolve[IdentityMatrix[m] - z*Array[t, {m, m}], Array[v, m]]
    RowGf[d_, m_, z_] := 1+z*TransferGf[m, 1&, Boole[Abs[#1-#2] <= d]&, 1&, z];
    row[m_] := row[m] = CoefficientList[RowGf[diff, m, x] + O[x]^mmax, x];
    T[m_ /; m >= m0, n_ /; n >= 0] := row[m][[n + 1]];
    Table[T[m - n , n], {m, m0, mmax}, {n, m - m0, 0, -1}] // Flatten (* Jean-François Alcover, Jun 17 2017, adapted from PARI *)
  • PARI
    TransferGf(m,u,t,v,z)=vector(m,i,u(i))*matsolve(matid(m)-z*matrix(m,m,i,j,t(i,j)),vectorv(m,i,v(i)));
    RowGf(d,m,z)=1+z*TransferGf(m, i->1, (i,j)->abs(i-j)<=d, j->1, z);
    for(m=3, 10, print(RowGf(2,m,x)));
    for(m=3, 10, v=Vec(RowGf(2,m,x) + O(x^9)); for(n=1, length(v), print1( v[n], ", ") ); print(); );
Showing 1-3 of 3 results.