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.

Previous Showing 11-20 of 36 results. Next

A180028 Eight white queens and one red queen on a 3 X 3 chessboard. G.f.: (1 + 3*x)/(1 - 6*x - 3*x^2).

Original entry on oeis.org

1, 9, 57, 369, 2385, 15417, 99657, 644193, 4164129, 26917353, 173996505, 1124731089, 7270376049, 46996449561, 303789825513, 1963728301761, 12693739287105, 82053620627913, 530402941628793, 3428578511656497
Offset: 0

Views

Author

Johannes W. Meijer, Aug 09 2010; edited Jun 21 2013

Keywords

Comments

The a(n) represent the number of n-move routes of a fairy chess piece starting in the center square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a white queen on the eight side and corner squares but on the central square the queen explodes with fury and turns into a red queen.
On a 3 X 3 chessboard there are 2^9 = 512 ways to explode with fury on the center square (off the center square the piece behaves like a normal queen). The red queen is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the center square the 512 red queens lead to 17 red queen sequences, see the overview of red queen sequences and the crossreferences.
The sequence above corresponds to just one red queen vector, i.e., A[5] = [111 111 111] vector. The other squares lead for this vector to A090018.
This sequence belongs to a family of sequences with g.f. (1+k*x)/(1 - 6*x - k*x^2). The members of this family that are red queen sequences are A180028 (k=3; this sequence), A180029 (k=2), A015451 (k=1), A000400 (k=0), A001653 (k=-1), A180034 (k=-2), A084120 (k=-3), A154626 (k=-4) and A000012 (k=-5). Other members of this family are A123362 (k=5), 6*A030192(k=-6).
Inverse binomial transform of A107903.

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.

Crossrefs

Cf. A180140 (berserker sequences)
Cf. A180032 (Corner and side squares).
Cf. Red queen sequences center square [decimal value A[5]]: A180028 [511], A180029 [255], A180031 [495], A015451 [127], A152240 [239], A000400 [63], A057088 [47], A001653 [31], A122690 [15], A180034 [23], A180036 [7], A084120 [19], A180038 [3], A154626 [17], A015449 [1], A000012 [16], A000007 [0].

Programs

  • Magma
    I:=[1,9]; [n le 2 select I[n] else 6*Self(n-1)+3*Self(n-2): n in [1..20]]; // Vincenzo Librandi, Nov 15 2011
  • Maple
    nmax:=19; m:=5; A[1]:=[0,1,1,1,1,0,1,0,1]: A[2]:=[1,0,1,1,1,1,0,1,0]: A[3]:=[1,1,0,0,1,1,1,0,1]: A[4]:=[1,1,0,0,1,1,1,1,0]: A[5]:=[1,1,1,1,1,1,1,1,1]: A[6]:=[0,1,1,1,1,0,0,1,1]: A[7]:=[1,0,1,1,1,0,0,1,1]: A[8]:=[0,1,0,1,1,1,1,0,1]: A[9]:=[1,0,1,0,1,1,1,1,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[{6,3},{1,9},50] (* Vincenzo Librandi, Nov 15 2011 *)

Formula

G.f.: (1+3*x)/(1 - 6*x - 3*x^2).
a(n) = 6*a(n-1) + 3*a(n-2) with a(0) = 1 and a(1) = 9.
a(n) = ((1-A)*A^(-n-1) + (1-B)*B^(-n-1))/4 with A=(-1+2*sqrt(3)/3) and B=(-1-2*sqrt(3)/3).
Lim_{k->infinity} a(n+k)/a(k) = (-1)^(n-1)*A108411(n+1)/(A041017(n-1)*sqrt(12) - A041016(n-1)) for n >= 1.

A111575 Powers of 3 repeated four times.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 3, 3, 9, 9, 9, 9, 27, 27, 27, 27, 81, 81, 81, 81, 243, 243, 243, 243, 729, 729, 729, 729, 2187, 2187, 2187, 2187, 6561, 6561, 6561, 6561, 19683, 19683, 19683, 19683, 59049, 59049, 59049, 59049, 177147, 177147, 177147, 177147, 531441
Offset: 0

Views

Author

Jeremy Gardiner, Nov 17 2005

Keywords

Comments

Generating sequence for the number of 0's and 1's (run lengths) in the parity of A006072, A111065 and A118594.

Examples

			a(10) = 3^floor(10/4) = 3^2 = 9.
		

Crossrefs

Programs

Formula

a(n) = 3^floor(n/4).
O.g.f.: -(1+x)*(1+x^2)/(-1+3*x^4). - R. J. Mathar, Jan 08 2008

A127975 Repeat 3^n three times.

Original entry on oeis.org

1, 1, 1, 3, 3, 3, 9, 9, 9, 27, 27, 27, 81, 81, 81, 243, 243, 243, 729, 729, 729, 2187, 2187, 2187, 6561, 6561, 6561, 19683, 19683, 19683, 59049, 59049, 59049, 177147, 177147, 177147, 531441, 531441, 531441, 1594323, 1594323, 1594323, 4782969, 4782969, 4782969
Offset: 0

Views

Author

Paul Barry, Feb 09 2007

Keywords

Comments

a(n) is the number of functions f:[n+1]->[3] with f(1)=1 and with f(x)=f(y) whenever y=ceiling(x/3). - Dennis P. Walsh, Sep 06 2018

Examples

			a(6)=9 since there are exactly 9 functions f:[7]->[3], denoted by <f(1),f(2),...,f(7)>, with f(1)=1 and with f(x)=f(y) whenever y=ceiling(x/3). The nine functions are <1,1,1,1,1,1,1>, <1,1,1,1,1,1,2>, <1,1,1,1,1,1,3>, <1,1,1,2,2,2,1>, <1,1,1,2,2,2,2>, <1,1,1,2,2,2,3>, <1,1,1,3,3,3,1>, <1,1,1,3,3,3,2>, and <1,1,1,3,3,3,3>. - _Dennis P. Walsh_, Sep 06 2018
		

Crossrefs

Programs

Formula

G.f.: (1+x+x^2)/(1-3*x^3).

Extensions

Edited and corrected by R. J. Mathar, Jun 14 2008

A382683 Expansion of (1-x^2) / (1-x-3*x^2+x^3).

Original entry on oeis.org

1, 1, 3, 5, 13, 25, 59, 121, 273, 577, 1275, 2733, 5981, 12905, 28115, 60849, 132289, 286721, 622739, 1350613, 2932109, 6361209, 13806923, 29958441, 65018001, 141086401, 306181963, 664423165, 1441882653, 3128970185, 6790194979, 14735222881, 31976837633
Offset: 0

Views

Author

Sean A. Irvine, Jun 02 2025

Keywords

Comments

The number of walks of length n in the 4-vertex graph {{0,1}, {1,2}, {1,3}, {2,3}} starting at vertex 0 (see Example).
Also, a(n+1) is the number of such walks in the same graph starting at vertex 1.

Examples

			Consider walks starting at 0 in the following graph:
      2
     /|
  0-1 |
     \|
      3
The 5 walks of length 3 are 0-1-0-1, 0-1-2-1, 0-1-2-3, 0-1-3-1, and 0-1-3-2.
		

Crossrefs

Cf. A087640 (walks starting at 2).
Cf. A000079 (missing edge {0,1}), A108411 (missing edge {2,3}), A026581 (adding edge {0,2}), A000244 (K4).

Programs

  • Maple
    a:= n-> (<<0|1|0>, <0|0|1>, <-1|3|1>>^n. <<1,1,3>>)[1,1]:
    seq(a(n), n=0..32);  # Alois P. Heinz, Jun 04 2025
  • Mathematica
    LinearRecurrence[{1,3,-1},{1,1,3},33] (* or *) CoefficientList[Series[ (1-x^2) / (1-x-3*x^2+x^3),{x,0,32}],x] (* James C. McMahon, Jun 02 2025 *)

Formula

a(n) = A052973(n) + A052973(n-1). a(n) = A087640(n+1) - A087640(n). - R. J. Mathar, Jun 03 2025

A128019 Expansion of (1 - 3x)/(1 + 3*x^2).

Original entry on oeis.org

1, -3, -3, 9, 9, -27, -27, 81, 81, -243, -243, 729, 729, -2187, -2187, 6561, 6561, -19683, -19683, 59049, 59049, -177147, -177147, 531441, 531441, -1594323, -1594323, 4782969, 4782969, -14348907, -14348907, 43046721, 43046721, -129140163, -129140163, 387420489, 387420489
Offset: 0

Views

Author

Paul Barry, Feb 11 2007

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 - 3x)/(1 + 3*x^2),{x,0,40}],x] (* Stefano Spezia, Dec 31 2022 *)
    LinearRecurrence[{0,-3},{1,-3},40] (* Harvey P. Dale, Jun 09 2025 *)

Formula

a(n) = 3^floor((n+1)/2)*(-1)^C(n+1,2).
Binomial transform is A128018.
E.g.f.: cos(sqrt(3)*x) - sqrt(3)*sin(sqrt(3)*x). - Stefano Spezia, Dec 31 2022

A129529 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2} that have k inversions (n >= 0, k >= 0).

Original entry on oeis.org

1, 3, 6, 3, 10, 8, 8, 1, 15, 15, 21, 18, 9, 3, 21, 24, 39, 45, 48, 30, 24, 9, 3, 28, 35, 62, 82, 107, 108, 101, 81, 62, 37, 17, 8, 1, 36, 48, 90, 129, 186, 222, 264, 252, 255, 219, 183, 126, 90, 48, 27, 9, 3, 45, 63, 123, 186, 285, 372, 492, 561, 624, 648, 651, 597, 537, 435, 336, 249, 165, 99, 54, 27, 9, 3
Offset: 0

Views

Author

Emeric Deutsch, Apr 22 2007

Keywords

Comments

Row n has 1 + floor(n^2/3) terms.
Row sums are equal to 3^n = A000244(n).
Alternating row sums are 3^(ceiling(n/2)) = A108411(n+1).
This sequence is mentioned in the Andrews-Savage-Wilf paper. - Omar E. Pol, Jan 30 2012

Examples

			T(3,2) = 8 because we have 100, 110, 120, 200, 201, 211, 220 and 221.
Triangle starts:
   1;
   3;
   6,  3;
  10,  8,  8,  1;
  15, 15, 21, 18,  9,  3;
  21, 24, 39, 45, 48, 30, 24,  9,  3;
  ...
		

References

  • M. Bona, Combinatorics of Permutations, Chapman & Hall/CRC, Boca Raton, FL, 2004, pp. 57-61.
  • G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976.

Crossrefs

Programs

  • Maple
    for n from 0 to 40 do br[n]:=sum(q^i,i=0..n-1) od: for n from 0 to 40 do f[n]:=simplify(product(br[j],j=1..n)) od: mbr:=(n,a,b,c)->simplify(f[n]/f[a]/f[b]/f[c]): for n from 0 to 9 do G[n]:=sort(simplify(sum(sum(mbr(n,a,b,n-a-b),b=0..n-a),a=0..n))) od: for n from 0 to 9 do seq(coeff(G[n],q,j),j=0..floor(n^2/3)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, l) option remember; `if`(n=0, 1, add(expand(b(n-1, `if`(j<3,
          subsop(j=l[j]+1, l), l)))*x^([0, l[1], l[1]+l[2]][j]), j=1..3))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$2])):
    seq(T(n), n=0..10);  # Alois P. Heinz, Feb 12 2025
  • Mathematica
    b[n_, l_] := b[n, l] =
       If[n == 0, 1, Sum[Expand[b[n-1, If[j < 3, ReplacePart[l, j -> l[[j]]+1], l]]]*x^({0, l[[1]], l[[1]]+l[[2]]}[[j]]), {j, 1, 3}]];
    T[n_] := With[{p = b[n, {0, 0}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 13 2025, after Alois P. Heinz *)

Formula

T(n,0) = (n+1)*(n+2)/2 = A000217(n+1).
Sum_{k>=0} k*T(n,k) = 3^(n-1)*n*(n-1)/2 = A129530(n).
Generating polynomial of row n is Sum_{i=0..n} Sum_{j=0..n-i} binomial[n; i,j,n-i-j], where binomial[n;a,b,c] (a+b+c=n) is a q-multinomial coefficient.
Sum_{k=0..floor(n^2/3)} (-1)^k * T(n,k) = A056449(n). - Alois P. Heinz, Feb 12 2025

A152842 Triangle T(n,k), 0 <= k <= n, read by rows, given by [1,0,-1,0,0,0,0,0,0,...] DELTA [3,-2,-1,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 3, 1, 4, 3, 1, 7, 15, 9, 1, 8, 22, 24, 9, 1, 11, 46, 90, 81, 27, 1, 12, 57, 136, 171, 108, 27, 1, 15, 93, 307, 579, 621, 351, 81, 1, 16, 108, 400, 886, 1200, 972, 432, 81, 1, 19, 156, 724, 2086, 3858, 4572, 3348, 1377, 243, 1, 20, 175, 880, 2810, 5944, 8430, 7920
Offset: 0

Views

Author

Philippe Deléham, Dec 14 2008

Keywords

Examples

			The triangle T(n,k) begins:
n\k  0   1    2     3     4      5      6      7      8      9     10    11   12
0:   1
1:   1   3
2:   1   4    3
3:   1   7   15     9
4:   1   8   22    24     9
5:   1  11   46    90    81     27
6:   1  12   57   136   171    108     27
7:   1  15   93   307   579    621    351     81
8:   1  16  108   400   886   1200    972    432     81
9:   1  19  156   724  2086   3858   4572   3348   1377    243
10:  1  20  175   880  2810   5944   8430   7920   4725   1620    243
11:  1  23  235  1405  5450  14374  26262  33210  28485  15795   5103   729
12:  1  24  258  1640  6855  19824  40636  59472  61695  44280  20898  5832  729
... reformatted and extended. - _Franck Maminirina Ramaharo_, Feb 28 2018
		

Crossrefs

Programs

  • Haskell
    a152842 n k = a152842_tabl !! n !! k
    a152842_row n = a152842_tabl !! n
    a152842_tabl = map fst $ iterate f ([1], 3) where
       f (xs, z) = (zipWith (+) ([0] ++ map (* z) xs) (xs ++ [0]), 4 - z)
    -- Reinhard Zumkeller, May 01 2014

Formula

T(n,k) = T(n-1,k) + (2-(-1)^n)*T(n-1,k-1).
Sum_{k=0..n} T(n,k) = A094015(n).
T(n,n) = A108411(n+1).
T(2n,n) = A069835(n).
G.f.: (1+x+x*y)/(1-x^2-4*x^2*y-3*x^2*y^2). - Philippe Deléham , Nov 09 2013
T(n,k) = T(n-2,k) + 4*T(n-2,k-1) + 3*T(n-2,k-2), T(0,0) = T(1,0) = 1, T(1,1) = 3, T(n,k) = 0 if k < 0 or if k > n. - Philippe Deléham, Nov 09 2013

A167993 Expansion of x^2/((3*x-1)*(3*x^2-1)).

Original entry on oeis.org

0, 0, 1, 3, 12, 36, 117, 351, 1080, 3240, 9801, 29403, 88452, 265356, 796797, 2390391, 7173360, 21520080, 64566801, 193700403, 581120892, 1743362676, 5230147077, 15690441231, 47071500840, 141214502520, 423644039001, 1270932117003, 3812797945332, 11438393835996
Offset: 0

Views

Author

Paul Curtz, Nov 16 2009

Keywords

Comments

The terms satisfy a(n) = 3*a(n-1) +3*a(n-2) -9*a(n-3), so they follow the pattern a(n) = p*a(n-1) +q*a(n-2) -p*q*a(n-3) with p=q=3. This could be called the principal sequence for that recurrence because we have set all but one of the initial terms to zero. [p=q=1 leads to the principal sequence A004526. p=q=2 leads essentially to A032085. The common feature is that the denominator of the generating function does not have a root at x=1, so the sequences of higher order successive differences have the same recurrence as the original sequence. See A135094, A010036, A006516.]

Crossrefs

Cf. A138587, A107767 (partial sums).

Programs

  • Mathematica
    CoefficientList[Series[x^2/((3*x - 1)*(3*x^2 - 1)), {x, 0, 50}], x] (* G. C. Greubel, Jul 03 2016 *)
    LinearRecurrence[{3,3,-9},{0,0,1},30] (* Harvey P. Dale, Nov 05 2017 *)
  • PARI
    Vec(x^2/((3*x-1)*(3*x^2-1))+O(x^99)) \\ Charles R Greathouse IV, Jun 29 2011

Formula

a(2*n+1) = 3*a(2*n).
a(2*n) = A122006(2*n)/2.
a(n) = 3*a(n-1) + 3*a(n-4) - 9*a(n-3).
a(n+1) - a(n) = A122006(n).
a(n) = (3^n - A108411(n+1))/6.
G.f.: x^2/((3*x-1)*(3*x^2-1)).
From Colin Barker, Sep 23 2016: (Start)
a(n) = 3^(n-1)/2-3^(n/2-1)/2 for n even.
a(n) = 3^(n-1)/2-3^(n/2-1/2)/2 for n odd.
(End)

Extensions

Formulae corrected by Johannes W. Meijer, Jun 28 2011

A202390 Triangle T(n,k), read by rows, given by (1, 0, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (1, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 6, 8, 3, 1, 10, 21, 17, 5, 1, 15, 45, 58, 35, 8, 1, 21, 85, 154, 144, 68, 13, 1, 28, 147, 350, 452, 330, 129, 21, 1, 36, 238, 714, 1195, 1198, 719, 239, 34, 1, 45, 366, 1344, 2799, 3611, 2959, 1506, 436, 55
Offset: 0

Views

Author

Philippe Deléham, Dec 18 2011

Keywords

Comments

T(n,n) = Fibonacci(n+1) = A000045(n+1).
A202390 is jointly generated with A208340 as an array of coefficients of polynomials v(n,x): initially, u(1,x)=v(1,x)=1; for n>1, u(n,x)=u(n-1,x)+x*v(n-1)x and v(n,x)=(x+1)*u(n-1,x)+(x+1)v(n-1,x). The alternating row sums of A202390, and also A208340, are 0 except for the first one. See the Mathematica section. - Clark Kimberling, Feb 27 2012

Examples

			Triangle begins:
  1
  1, 1
  1, 3, 2
  1, 6, 8, 3
  1, 10, 21, 17, 5
  1, 15, 45, 58, 35, 8
  1, 21, 85, 154, 144, 68, 13
  1, 28, 147, 350, 452, 330, 129, 21
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 13;
    u[n_, x_] := u[n - 1, x] + x*v[n - 1, x];
    v[n_, x_] := (x + 1)*u[n - 1, x] + (x + 1)*v[n - 1, x];
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]  (* A202390 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]  (* A208340 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (*row sums*)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (*alt. row sums*)

Formula

T(n,k) = 2*T(n-1,k) + T(n-1,k-1) + T(n-2,k-2) - T(n-2,k) with T(0,0) = T(1,0) = T(1,1) = 1 and T(n,k) = 0 if k<0 or if n
G.f.: (1-x)/(1-(2+y)*x+(1-y^2)*x^2).
Sum_{k, 0<=k<=n} T(n,k)*x^k = (-1)^n*A108411(n), A000007(n), A000012(n), A025192(n), A122558(n) for x = -2, -1, 0, 1, 2 respectively.

A162557 a(n) = ((3+sqrt(3))*(4+sqrt(3))^n+(3-sqrt(3))*(4-sqrt(3))^n)/6.

Original entry on oeis.org

1, 5, 27, 151, 857, 4893, 28003, 160415, 919281, 5268853, 30200171, 173106279, 992248009, 5687602445, 32601595443, 186873931759, 1071170713313, 6140004593637, 35194817476027, 201738480090935, 1156375213539129, 6628401467130877, 37994333961038339, 217785452615605311
Offset: 0

Author

Al Hakanson (hawkuu(AT)gmail.com), Jul 06 2009

Keywords

Comments

Binomial transform of A086405.
Inverse binomial transform of A162558.
4th binomial transform of A108411.
2nd binomial transform of A079935. [R. J. Mathar, Jul 17 2009]
From J. Conrad, Aug 29 2016: (Start)
Partial sum of A136777.
Backward difference of Sum_{k=0..n} A027907(n+1,2k+2)*3^k.
(End)
String length in substitution system {0 -> 1001001, 1 -> 11011} at step n from initial string "1" (1 -> 11011 -> 110111101110010011101111011 -> ...). - Ilya Gutkovskiy, Aug 30 2016

Crossrefs

Cf. A108411 (powers of 3 repeated), A086405, A162558.
Cf. A162558. [R. J. Mathar, Jul 17 2009]

Programs

  • Magma
    Z:=PolynomialRing(Integers()); N:=NumberField(x^2-3); S:=[ ((3+r)*(4+r)^n+(3-r)*(4-r)^n)/6: n in [0..20] ]; [ Integers()!S[j]: j in [1..#S] ]; // Klaus Brockhaus, Jul 13 2009
    
  • Magma
    I:=[1,5]; [n le 2 select I[n]  else 8*Self(n-1)-13*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 30 2016
  • Maple
    seq(simplify(((3+sqrt(3))*(4+sqrt(3))^n+(3-sqrt(3))*(4-sqrt(3))^n)*1/6), n = 0..20); # Emeric Deutsch, Jul 14 2009
  • Mathematica
    Table[FullSimplify[((3 + #) (4 + #)^n + (3 - #) (4 - #)^n)/6 &@ Sqrt@ 3], {n, 0, 23}] (* Michael De Vlieger, Aug 30 2016 *)
    LinearRecurrence[{8,-13},{1,5},30] (* Harvey P. Dale, Oct 23 2020 *)

Formula

a(n) = 8*a(n-1)-13*a(n-2) for n > 1; a(0) = 1, a(1) = 5.
G.f.: (1-3*x)/(1-8*x+13*x^2).

Extensions

Edited, corrected and extended beyond a(5) by Klaus Brockhaus, Emeric Deutsch and R. J. Mathar, Jul 07 2009
More terms from Vincenzo Librandi, Aug 30 2016
Previous Showing 11-20 of 36 results. Next