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

A254663 Numbers of n-length words on alphabet {0,1,...,7} with no subwords ii, where i is from {0,1,...,5}.

Original entry on oeis.org

1, 8, 58, 422, 3070, 22334, 162478, 1182014, 8599054, 62557406, 455099950, 3310814462, 24085901134, 175222936862, 1274732360302, 9273572395838, 67464471491470, 490798445231966, 3570518059606702, 25975223307710846, 188967599273189326, 1374723641527746974
Offset: 0

Views

Author

Milan Janjic, Feb 04 2015

Keywords

Comments

a(n) equals the number of octonary sequences of length n such that no two consecutive terms differ by 5. - David Nacin, May 31 2017

Crossrefs

Programs

  • Magma
    [n le 1 select 8^n else 7*Self(n)+2*Self(n-1): n in [0..20]];
    
  • Mathematica
    RecurrenceTable[{a[0] == 1, a[1] == 8, a[n] == 7 a[n - 1] + 2 a[n - 2]}, a[n], {n, 0, 20}]
    LinearRecurrence[{7,2},{1,8},30] (* Harvey P. Dale, Nov 28 2023 *)
  • PARI
    Vec((1 + x)/(1 - 7*x - 2*x^2) + O(x^30)) \\ Colin Barker, Jan 22 2017

Formula

G.f.: (1 + x)/(1 - 7*x - 2*x^2).
a(n) = 7*a(n-1) + 2*a(n-2) with n>1, a(0) = 1, a(1) = 8.
a(n) = 2^(-1-n)*((7-r)^n*(-9+r) + (7+r)^n*(9+r)) / r, where r=sqrt(57). - Colin Barker, Jan 22 2017

A189800 a(n) = 6*a(n-1) + 8*a(n-2), with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 6, 44, 312, 2224, 15840, 112832, 803712, 5724928, 40779264, 290475008, 2069084160, 14738305024, 104982503424, 747801460736, 5326668791808, 37942424436736, 270267896954880, 1925146777223168, 13713023838978048, 97679317251653632, 695780094221746176
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[0,1]; [n le 2 select I[n] else 6*Self(n-1)+8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 14 2011
    
  • Mathematica
    LinearRecurrence[{6, 8}, {0, 1}, 50]
    CoefficientList[Series[-(x/(-1+6 x+8 x^2)),{x,0,50}],x] (* Harvey P. Dale, Jul 26 2011 *)
  • PARI
    a(n)=([0,1; 8,6]^n*[0;1])[1,1] \\ Charles R Greathouse IV, Oct 03 2016

Formula

G.f.: x/(1 - 2*x*(3+4*x)). - Harvey P. Dale, Jul 26 2011

A015544 Lucas sequence U(5,-8): a(n+1) = 5*a(n) + 8*a(n-1), a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 5, 33, 205, 1289, 8085, 50737, 318365, 1997721, 12535525, 78659393, 493581165, 3097180969, 19434554165, 121950218577, 765227526205, 4801739379641, 30130517107845, 189066500576353, 1186376639744525, 7444415203333449, 46713089134623445
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n le 2 select n-1 else 5*Self(n-1) + 8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 13 2012
    
  • Mathematica
    a[n_]:=(MatrixPower[{{1,2},{1,-6}},n].{{1},{1}})[[2,1]]; Table[Abs[a[n]],{n,-1,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
    LinearRecurrence[{5, 8}, {0, 1}, 30] (* Vincenzo Librandi, Nov 13 2012 *)
  • PARI
    A015544(n)=imag((2+quadgen(57))^n) \\ M. F. Hasler, Mar 06 2009
    
  • PARI
    x='x+O('x^30); concat([0], Vec(x/(1 - 5*x - 8*x^2))) \\ G. C. Greubel, Jan 01 2018
  • Sage
    [lucas_number1(n,5,-8) for n in range(0, 21)] # Zerinvary Lajos, Apr 24 2009
    

Formula

a(n) = 5*a(n-1) + 8*a(n-2).
G.f.: x/(1 - 5*x - 8*x^2). - M. F. Hasler, Mar 06 2009

Extensions

More precise definition by M. F. Hasler, Mar 06 2009

A180030 Number of n-move paths on a 3 X 3 chessboard of a queen starting or ending in a corner or side square.

Original entry on oeis.org

1, 6, 38, 238, 1494, 9374, 58822, 369102, 2316086, 14533246, 91194918, 572240558, 3590762134, 22531735134, 141384772742, 887177744782, 5566966905846, 34932256487486, 219197017684198, 1375443140320878, 8630791843077974
Offset: 0

Views

Author

Johannes W. Meijer, Aug 09 2010

Keywords

Comments

The a(n) represent the number of n-move paths of a chess queen starting or ending in a given corner or side square (m = 1, 3, 7, 9; 2, 4, 6, 8) on a 3 X 3 chessboard. The central square leads to A180031.
To determine the a(n) we can either sum the components of the column vector A^n[k,m], with A the adjacency matrix of the queen's graph, or we can sum the components of the row vector A^n[m,k], see the Maple program.
Closely related with this sequence are the red queen sequences, see A180028 and A180032.
Inverse binomial transform of A015555 (without the leading 0).

Programs

  • Magma
    I:=[1,6]; [n le 2 select I[n] else 5*Self(n-1)+8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 15 2011
  • Maple
    with(LinearAlgebra): nmax:=20; m:=1; A[5]:= [1,1,1,1,0,1,1,1,1]: A:=Matrix([[0,1,1,1,1,0,1,0,1], [1,0,1,1,1,1,0,1,0], [1,1,0,0,1,1,1,0,1], [1,1,0,0,1,1,1,1,0], A[5], [0,1,1,1,1,0,0,1,1], [1,0,1,1,1,0,0,1,1], [0,1,0,1,1,1,1,0,1], [1,0,1,0,1,1,1,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);
  • Mathematica
    LinearRecurrence[{5,8},{1,6},201] (* Vincenzo Librandi, Nov 15 2011 *)

Formula

G.f.: (1+x)/(1 - 5*x - 8*x^2).
a(n) = 5*a(n-1) + 8*a(n-2) with a(0) = 1 and a(1) = 6.
a(n) = ((7+11*A)*A^(-n-1) + (7+11*B)*B^(-n-1))/57 with A = (-5+sqrt(57))/16 and B = (-5-sqrt(57))/16.

A225879 Number of n-length words w over ternary alphabet {1,2,3} such that for every prefix z of w we have 0<=#(z,1)-#(z,2)<=2 and 0<=#(z,2)-#(z,3)<=2 and #(z,x) gives the number of occurrences of letter x in z.

Original entry on oeis.org

1, 1, 2, 3, 7, 14, 23, 51, 102, 167, 371, 742, 1215, 2699, 5398, 8839, 19635, 39270, 64303, 142843, 285686, 467799, 1039171, 2078342, 3403199, 7559883, 15119766, 24757991, 54997523, 109995046, 180112335, 400102427, 800204854, 1310302327, 2910712035, 5821424070
Offset: 0

Views

Author

Jon Perry, May 19 2013

Keywords

Examples

			For n=6 the 23 words are: 112121, 112123, 112132, 112211, 112213, 112231, 112233, 112312, 112321, 112323, 121121, 121123, 121132, 121211, 121213, 121231, 121233, 121312, 121321, 121323, 123112, 123121 and 123123.
		

Crossrefs

Cf. A015555 (trisection)

Programs

  • JavaScript
    function countOK(arr) {
    var i,c=[0,0,0];
    for (i=0;i=c[1] && c[0]-c[1]<=2 && c[1]>=c[2] && c[1]-c[2]<=2) return true; else return false;
    }
    x=new Array();
    x[0]=new Array();
    x[0][0]=[1];
    document.write(x[0].length+", ");
    for (i=1;i<21;i++) {
    x[i]=new Array();
    xc=0;
    for (j=0;j
    				
  • Maple
    a:= n-> (<<0|1>, <2|7>>^iquo(n, 3, 'r').
            [<<1, 3>>, <<1, 7>>, <<2, 14>>][r+1])[1, 1]:
    seq(a(n), n=0..50); # Alois P. Heinz, May 20 2013
  • Mathematica
    LinearRecurrence[{0,0,7,0,0,2},{1,1,2,3,7,14},40] (* Harvey P. Dale, Mar 06 2015 *)

Formula

a(3n+2) = 2*a(3n+1).
From Alois P. Heinz, May 20 2013: (Start)
G.f.: (x-1)*(4*x^2+2*x+1) / (2*x^6+7*x^3-1).
a(n) = 7*a(n-3) + 2*a(n-6) for n>5. (End)
Showing 1-5 of 5 results.