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

A143461 Square array A(n,k) of numbers of length n quaternary words with at least k 0-digits between any other digits (n,k >= 0), read by antidiagonals.

Original entry on oeis.org

1, 1, 4, 1, 4, 16, 1, 4, 7, 64, 1, 4, 7, 19, 256, 1, 4, 7, 10, 40, 1024, 1, 4, 7, 10, 22, 97, 4096, 1, 4, 7, 10, 13, 43, 217, 16384, 1, 4, 7, 10, 13, 25, 73, 508, 65536, 1, 4, 7, 10, 13, 16, 46, 139, 1159, 262144, 1, 4, 7, 10, 13, 16, 28, 76, 268, 2683, 1048576, 1, 4, 7, 10, 13, 16, 19, 49, 115, 487, 6160, 4194304
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Examples

			A (3,1) = 19, because 19 quaternary words of length 3 have at least 1 0-digit between any other digits: 000, 001, 002, 003, 010, 020, 030, 100, 101, 102, 103, 200, 201, 202, 203, 300, 301, 301, 303.
Square array A(n,k) begins:
       1,   1,   1,  1,  1,  1,  1,  1,  ...
       4,   4,   4,  4,  4,  4,  4,  4,  ...
      16,   7,   7,  7,  7,  7,  7,  7,  ...
      64,  19,  10, 10, 10, 10, 10, 10,  ...
     256,  40,  22, 13, 13, 13, 13, 13,  ...
    1024,  97,  43, 25, 16, 16, 16, 16,  ...
    4096, 217,  73, 46, 28, 19, 19, 19,  ...
   16384, 508, 139, 76, 49, 31, 22, 22,  ...
		

Crossrefs

Columns k=0-9 give: A000302, A006130(n+1), A084386(n+2), A143454, A143455, A143456, A143457, A143458, A143459, A143460.
Main diagonal gives A016777.

Programs

  • Maple
    A:= proc(n, k) option remember; if k=0 then 4^n elif n<=k+1 then 3*n+1 else A(n-1, k) +3*A(n-k-1, k) fi end: seq(seq(A(n, d-n), n=0..d), d=0..13);
  • Mathematica
    a[n_, 0] := 4^n; a[n_, k_] /; n <= k+1 := 3*n+1; a[n_, k_] := a[n, k] = a[n-1, k] + 3*a[n-k-1, k]; Table[a[n-k, k], {n, 0, 13}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Jan 15 2014, after Maple *)

Formula

G.f. of column k: 1/(x^k*(1-x-3*x^(k+1))).
A(n,k) = 4^n if k=0, else A(n,k) = 3*n+1 if n<=k+1, else A(n,k) = A(n-1,k) + 3*A(n-k-1,k).

A318774 Coefficients in expansion of 1/(1 - x - 3*x^4).

Original entry on oeis.org

1, 1, 1, 1, 4, 7, 10, 13, 25, 46, 76, 115, 190, 328, 556, 901, 1471, 2455, 4123, 6826, 11239, 18604, 30973, 51451, 85168, 140980, 233899, 388252, 643756, 1066696, 1768393, 2933149, 4864417, 8064505, 13369684, 22169131, 36762382, 60955897, 101064949, 167572342, 277859488, 460727179, 763922026, 1266639052
Offset: 0

Views

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The coefficients in the expansion of 1/(1 - x - 3*x^4) are given by the sequence generated by the row sums in triangle A318772.
Coefficients in expansion of 1/(1 - x - 3*x^4) are given by the sum of numbers along "third Layer" skew diagonals pointing top-right in triangle A013610 ((1+3x)^n) and by the sum of numbers along "third Layer" skew diagonals pointing top-left in triangle A027465 ((3+x)^n), see links.

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Essentially a duplicate of A143454.

Programs

  • Magma
    [n le 4 select 1 else Self(n-1) +3*Self(n-4): n in [1..51]]; // G. C. Greubel, May 08 2021
    
  • Mathematica
    CoefficientList[Series[1/(1-x-3x^4), {x, 0, 50}], x]
    a[n_]:= a[n]= If[n<4, 1, a[n-1] + 3*a[n-4]]; Table[a[n], {n,0,50}]
    LinearRecurrence[{1,0,0,3}, {1,1,1,1}, 51]
  • PARI
    my(p=Mod('x,x^4-'x^3-3)); a(n) = vecsum(Vec(lift(p^n))); \\ Kevin Ryde, May 11 2021
  • Sage
    def a(n): return 1 if (n<4) else a(n-1) + 3*a(n-4)
    [a(n) for n in (0..50)] # G. C. Greubel, May 08 2021
    

Formula

a(n) = a(n-1) + 3*a(n-4) for n >= 0, a(n)=0 for n < 0, with a(0) = a(1) = a(2) = a(3) = 1.

A172369 Triangle read by rows: T(n,k,q) = round(c(n)/(c(k)*c(n-k))) where c are partial products of a sequence defined in comments.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 7, 28, 28, 28, 7, 1, 1, 10, 70, 280, 280, 70, 10, 1, 1, 13, 130, 910, 3640, 910, 130, 13, 1, 1, 25, 325, 3250, 22750, 22750, 3250, 325, 25, 1, 1, 46, 1150, 14950, 149500, 261625, 149500, 14950, 1150, 46, 1
Offset: 0

Views

Author

Roger L. Bagula, Feb 01 2010

Keywords

Comments

Start from A143454 and its partial products c(n) = 1, 1, 1, 1, 1, 4, 28, 280, 3640, 91000, 4186000, ... . Then T(n,k) = round(c(n)/(c(k)*c(n-k))).

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  1,    1;
  1,  1,    1,     1;
  1,  1,    1,     1,      1;
  1,  4,    4,     4,      4,      1;
  1,  7,   28,    28,     28,      7,      1;
  1, 10,   70,   280,    280,     70,     10,     1;
  1, 13,  130,   910,   3640,    910,    130,    13,    1;
  1, 25,  325,  3250,  22750,  22750,   3250,   325,   25,  1;
  1, 46, 1150, 14950, 149500, 261625, 149500, 14950, 1150, 46, 1;
		

Crossrefs

Cf. A172363 (q=1), A172368 (q=2), this sequence (q=3), A318774.

Programs

  • Mathematica
    f[n_, q_]:= f[n, q]= If[n==0, 0, If[n<4, 1, f[n-1, q] +q*f[n-4, q]]];
    c[n_, q_]:= Product[f[j, q], {j,n}];
    T[n_, k_, q_]:= Round[c[n, q]/(c[k, q]*c[n - k, q])];
    Table[T[n, k, 3], {n, 0, 12}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, May 08 2021 *)
  • Sage
    @CachedFunction
    def f(n,q): return 0 if (n==0) else 1 if (n<4) else f(n-1, q) + q*f(n-4, q)
    def c(n,q): return product( f(j,q) for j in (1..n) )
    def T(n,k,q): return round(c(n, q)/(c(k, q)*c(n-k, q)))
    flatten([[T(n,k,3) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 08 2021

Formula

T(n, k, q) = round( c(n,q)/(c(k,q)*c(n-k,q)) ), where c(n, q) = Product_{j=1..n} f(j, q), f(n, q) = f(n-1, q) + q*f(n-4, q), f(0, q) = 0, f(1, q) = f(2, q) = f(3, q) = 1, and q = 3. - G. C. Greubel, May 08 2021

Extensions

Definition corrected to give integral terms, G. C. Greubel, May 08 2021

A193516 T(n,k) = number of ways to place any number of 4X1 tiles of k distinguishable colors into an nX1 grid.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 4, 5, 4, 1, 1, 1, 5, 7, 7, 5, 1, 1, 1, 6, 9, 10, 9, 7, 1, 1, 1, 7, 11, 13, 13, 15, 10, 1, 1, 1, 8, 13, 16, 17, 25, 25, 14, 1, 1, 1, 9, 15, 19, 21, 37, 46, 39, 19, 1, 1, 1, 10, 17, 22, 25, 51, 73, 76, 57, 26, 1, 1, 1, 11, 19, 25, 29, 67, 106, 125
Offset: 1

Views

Author

R. H. Hardin, with proof and formula from Robert Israel in the Sequence Fans Mailing List, Jul 29 2011

Keywords

Comments

Table starts:
..1...1...1...1....1....1....1....1....1....1....1.....1.....1.....1.....1
..1...1...1...1....1....1....1....1....1....1....1.....1.....1.....1.....1
..1...1...1...1....1....1....1....1....1....1....1.....1.....1.....1.....1
..2...3...4...5....6....7....8....9...10...11...12....13....14....15....16
..3...5...7...9...11...13...15...17...19...21...23....25....27....29....31
..4...7..10..13...16...19...22...25...28...31...34....37....40....43....46
..5...9..13..17...21...25...29...33...37...41...45....49....53....57....61
..7..15..25..37...51...67...85..105..127..151..177...205...235...267...301
.10..25..46..73..106..145..190..241..298..361..430...505...586...673...766
.14..39..76.125..186..259..344..441..550..671..804...949..1106..1275..1456
.19..57.115.193..291..409..547..705..883.1081.1299..1537..1795..2073..2371
.26..87.190.341..546..811.1142.1545.2026.2591.3246..3997..4850..5811..6886
.36.137.328.633.1076.1681.2472.3473.4708.6201.7976.10057.12468.15233.18376

Examples

			Some solutions for n=9 k=3; colors=1, 2, 3; empty=0
..0....3....0....0....3....3....0....0....0....0....2....2....0....0....1....2
..1....3....0....2....3....3....3....0....0....0....2....2....1....0....1....2
..1....3....0....2....3....3....3....2....0....0....2....2....1....0....1....2
..1....3....3....2....3....3....3....2....1....0....2....2....1....0....1....2
..1....0....3....2....0....3....3....2....1....0....2....0....1....0....0....0
..2....3....3....2....0....3....3....2....1....3....2....2....0....0....0....3
..2....3....3....2....0....3....3....0....1....3....2....2....0....0....0....3
..2....3....0....2....0....3....3....0....0....3....2....2....0....0....0....3
..2....3....0....2....0....0....3....0....0....3....0....2....0....0....0....3
		

Crossrefs

Column 1 is A003269(n+1),
Column 2 is A052942,
Column 3 is A143454(n-3),
Row 8 is A082111,
Row 9 is A100536(n+1),
Row 10 is A051866(n+1).

Programs

  • Maple
    T:= proc(n, k) option remember;
          `if`(n<0, 0,
          `if`(n<4 or k=0, 1, k*T(n-4, k) +T(n-1, k)))
        end:
    seq(seq(T(n, d+1-n), n=1..d), d=1..13); # Alois P. Heinz, Jul 29 2011
  • Mathematica
    T[n_, k_] := T[n, k] = If[n < 0, 0, If[n < 4 || k == 0, 1, k*T[n-4, k]+T[n-1, k]]]; Table[Table[T[n, d+1-n], {n, 1, d}], {d, 1, 13}] // Flatten (* Jean-François Alcover, Mar 04 2014, after Alois P. Heinz *)

Formula

With z X 1 tiles of k colors on an n X 1 grid (with n >= z), either there is a tile (of any of the k colors) on the first spot, followed by any configuration on the remaining (n-z) X 1 grid, or the first spot is vacant, followed by any configuration on the remaining (n-1) X 1. So T(n,k) = T(n-1,k) + k*T(n-z,k), with T(n,k) = 1 for n=0,1,...,z-1. The solution is T(n,k) = sum_r r^(-n-1)/(1 + z k r^(z-1)) where the sum is over the roots of the polynomial k x^z + x - 1.
T(n,k) = sum {s=0..[n/4]} (binomial(n-3*s,s)*k^s).
For z X 1 tiles, T(n,k,z) = sum{s=0..[n/z]} (binomial(n-(z-1)*s,s)*k^s). - R. H. Hardin, Jul 31 2011
Showing 1-4 of 4 results.