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.

A157897 Triangle read by rows, T(n,k) = T(n-1,k) + T(n-2,k-1) + T(n-3,k-3) + delta(n,0)*delta(k,0), T(n,k<0) = T(n

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 0, 1, 1, 3, 1, 2, 0, 1, 4, 3, 3, 2, 0, 1, 5, 6, 5, 6, 0, 1, 1, 6, 10, 9, 12, 3, 3, 0, 1, 7, 15, 16, 21, 12, 6, 3, 0, 1, 8, 21, 27, 35, 30, 14, 12, 0, 1, 1, 9, 28, 43, 57, 61, 35, 30, 6, 4, 0, 1, 10, 36, 65, 91, 111, 81, 65, 30, 10, 4, 0, 1, 11, 45, 94, 142, 189, 169, 135, 90, 30, 20, 0, 1
Offset: 0

Views

Author

Gary W. Adamson, Mar 08 2009

Keywords

Comments

T(n, k) is the number of tilings of an n-board that use k (1/2, 1)-fences and n-k squares. A (1/2, 1)-fence is a tile composed of two pieces of width 1/2 separated by a gap of width 1. (Result proved in paper by K. Edwards - see the links section.) - Michael A. Allen, Apr 28 2019
T(n, k) is the (n, n-k)-th entry in the (1/(1-x^3), x*(1+x)/(1-x^3)) Riordan array. - Michael A. Allen, Mar 11 2021

Examples

			First few rows of the triangle are:
  1;
  1,  0;
  1,  1,  0;
  1,  2,  0,  1;
  1,  3,  1,  2,  0;
  1,  4,  3,  3,  2,  0;
  1,  5,  6,  5,  6,  0,  1;
  1,  6, 10,  9, 12,  3,  3,  0;
  1,  7, 15, 16, 21, 12,  6,  3,  0;
  1,  8, 21, 27, 35, 30, 14, 12,  0,  1;
  ...
T(9,3) = 27 = T(8,3) + T(7,2) + T(6,0) = 16 + 10 + 1.
		

Crossrefs

Cf. A000073 (row sums), A006498, A120415.
Other triangles related to tiling using fences: A059259, A123521, A335964.

Programs

  • Magma
    function T(n,k) // T = A157897
      if k lt 0 or k gt n then return 0;
      elif k eq 0 then return 1;
      else return T(n-1, k) + T(n-2, k-1) + T(n-3, k-3);
      end if; return T;
    end function;
    [T(n,k): k in [0..n], n in [0..14]]; // G. C. Greubel, Sep 01 2022
    
  • Mathematica
    T[n_,k_]:= If[nMichael A. Allen, Apr 28 2019 *)
  • SageMath
    def T(n,k): # T = A157897
        if (k<0 or k>n): return 0
        elif (k==0): return 1
        else: return T(n-1, k) + T(n-2, k-1) + T(n-3, k-3)
    flatten([[T(n,k) for k in (0..n)] for n in (0..14)]) # G. C. Greubel, Sep 01 2022

Formula

T(n,k) = T(n-1,k) + T(n-2,k-1) + T(n-3,k-3) + delta(n,0)*delta(k,0), T(n,k<0) = T(n
Sum_{k=0..n} T(n, k) = A000073(n+2). - Reinhard Zumkeller, Jun 25 2009
From G. C. Greubel, Sep 01 2022: (Start)
T(n, k) = T(n-1, k) + T(n-2, k-1) + T(n-3, k-3), with T(n, 0) = 1.
T(n, n) = A079978(n).
T(n, n-1) = A087508(n), n >= 1.
T(n, 1) = A001477(n-1).
T(n, 2) = A161680(n-2).
Sum_{k=0..floor(n/2)} T(n-k, k) = A120415(n). (End)

Extensions

Name clarified by Michael A. Allen, Apr 28 2019
Definition improved by Michael A. Allen, Mar 11 2021

A087509 Number of k such that (k*n) == 2 (mod 3) for 0 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 7, 0, 7, 8, 0, 8, 9, 0, 9, 10, 0, 10, 11, 0, 11, 12, 0, 12, 13, 0, 13, 14, 0, 14, 15, 0, 15, 16, 0, 16, 17, 0, 17, 18, 0, 18, 19, 0, 19, 20, 0, 20, 21, 0, 21, 22, 0, 22, 23, 0, 23, 24, 0, 24, 25, 0, 25, 26, 0, 26, 27, 0, 27, 28, 0, 28
Offset: 0

Author

Paul Barry, Sep 11 2003

Keywords

Examples

			a(8) = #{1,4,7} = 3.
		

Crossrefs

Programs

  • Mathematica
    {#-1,1+#,0}[[Mod[#,3,1]]]/3&/@Range[0, 99] (* Federico Provvedi, Jun 15 2021 *)
    LinearRecurrence[{0,0,2,0,0,-1},{0,0,1,0,1,2},100] (* Harvey P. Dale, May 04 2023 *)
  • PARI
    a(n) = sum(k=0, n, (k*n % 3)==2); \\ Michel Marcus, Sep 25 2017

Formula

a(n) = Sum_{k=0..n} [(k*n) == 2 (mod 3)];
a(n) = n - 2*(floor(n/3) + 1)*(1 - cos(2*Pi*n/3))/3 - floor(n/3)*(5 + 4*cos(2*Pi*n/3))/3.
a(n) = n - A087507(n) - A087508(n).
G.f.: x^2*(x^2+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, Mar 31 2013
a(n) = 2*sin(n*Pi/3)*(sqrt(3)*cos(n*Pi) + 2*n*sin(n*Pi/3))/9. - Wesley Ivan Hurt, Sep 24 2017

A087507 #{0<=k<=n: k*n is divisible by 3}.

Original entry on oeis.org

1, 1, 1, 4, 2, 2, 7, 3, 3, 10, 4, 4, 13, 5, 5, 16, 6, 6, 19, 7, 7, 22, 8, 8, 25, 9, 9, 28, 10, 10, 31, 11, 11, 34, 12, 12, 37, 13, 13, 40, 14, 14, 43, 15, 15, 46, 16, 16, 49, 17, 17, 52, 18, 18, 55, 19, 19, 58, 20, 20, 61, 21, 21, 64, 22, 22, 67, 23, 23, 70, 24, 24, 73, 25, 25, 76
Offset: 0

Author

Paul Barry, Sep 11 2003

Keywords

Crossrefs

Cf. A016777 (trisection).

Programs

  • PARI
    Vec((2*x^3+x^2+x+1)/((x-1)^2*(x^2+x+1)^2) + O(x^100)) \\ Colin Barker, May 02 2015

Formula

a(n) = sum{k=0..n, if (mod(kn, 3)=0, 1, 0) }.
a(n) = floor(n/3)(5/3+4/3cos(2Pi*/3))+1.
a(n)+A087508(n)+A087509(n) = n.
a(n) = 2*a(n-3)-a(n-6) for n>5. - Colin Barker, May 02 2015
G.f.: (2*x^3+x^2+x+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, May 02 2015

A115265 Correlation triangle for floor((n+3)/3).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 4, 4, 4, 4, 2, 3, 4, 5, 7, 5, 4, 3, 3, 5, 6, 8, 8, 6, 5, 3, 3, 6, 7, 9, 11, 9, 7, 6, 3, 4, 6, 8, 12, 12, 12, 12, 8, 6, 4, 4, 7, 9, 13, 15, 15, 15, 13, 9, 7, 4
Offset: 0

Author

Paul Barry, Jan 18 2006

Keywords

Comments

Row sums are A115266. Diagonal sums are A115267.
T(2n,n) is A092353. T(2n,n)-T(2n,n+1)=A087508(n+1).

Examples

			Triangle begins
1;
1,1;
1,2,1;
2,2,2,2;
2,3,3,3,2;
2,4,4,4,4,2;
3,4,5,7,5,4,3;
3,5,6,8,8,6,5,3;
3,6,7,9,11,9,7,6,3;
		

Programs

  • Mathematica
    T[n_, k_] := Sum[Boole[j <= k] * Floor[(k - j + 3)/3] * Boole[j <= n-k] * Floor[(n - k - j + 3)/3], {j, 0, n}]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 15 2017 *)

Formula

G.f.: (1+x+x^2)(1+xy+x^2*y^2)/((1-x^3)^2*(1-x^3*y^3)^2*(1-x^2*y)).
T(n, k) = sum{j=0..n, [j<=k]*floor((k-j+3)/3)*[j<=n-k]*floor((n-k-j+3)/3)}.

A128615 Expansion of x/(1 + x + x^2 - x^3 - x^4 - x^5).

Original entry on oeis.org

0, 1, -1, 0, 2, -2, 0, 3, -3, 0, 4, -4, 0, 5, -5, 0, 6, -6, 0, 7, -7, 0, 8, -8, 0, 9, -9, 0, 10, -10, 0, 11, -11, 0, 12, -12, 0, 13, -13, 0, 14, -14, 0, 15, -15, 0, 16, -16, 0, 17, -17, 0, 18, -18, 0, 19, -19
Offset: 0

Author

Paul Barry, Mar 13 2007

Keywords

Comments

Partial sums are 0,1,0,0,2,0,0,3,0,0,4,...

Crossrefs

Programs

  • Magma
    [Floor((n+3)/3)*((n+1) mod 3 -1): n in [0..40]]; // G. C. Greubel, Mar 26 2024
    
  • Mathematica
    CoefficientList[Series[x/(1+x+x^2-x^3-x^4-x^5),{x,0,60}],x] (* or *) LinearRecurrence[{-1,-1,1,1,1},{0,1,-1,0,2},60] (* or *) Table[{0,n,-n},{n,20}]//Flatten (* Harvey P. Dale, Jul 15 2017 *)
    Table[Floor[(n+3)/3]*(Mod[n+1,3] -1), {n,0,40}] (* G. C. Greubel, Mar 26 2024 *)
  • SageMath
    [((n+3)//3)*((n+1)%3 -1) for n in range(41)] # G. C. Greubel, Mar 26 2024

Formula

G.f.: x/((1-x)*(1+x+x^2)^2) = x*(1-x)/(1-x^3)^2.
a(n) = (1/9)*(1 - cos(2*Pi*n/3) + sqrt(3)*(2*n + 3)*sin(2*Pi*n/3)).
a(n) = floor((n+3)/3)*A049347(n+2). - G. C. Greubel, Mar 26 2024
Showing 1-5 of 5 results.