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.

A024996 Triangular array, read by rows: second differences in n,n direction of trinomial array A027907.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 2, 0, 1, 1, 1, 3, 2, 3, 1, 1, 1, 2, 5, 6, 8, 6, 5, 2, 1, 1, 3, 8, 13, 19, 20, 19, 13, 8, 3, 1, 1, 4, 12, 24, 40, 52, 58, 52, 40, 24, 12, 4, 1, 1, 5, 17, 40, 76, 116, 150, 162, 150, 116, 76, 40, 17, 5, 1, 1, 6, 23, 62, 133, 232, 342, 428, 462, 428, 342, 232, 133, 62, 23, 6
Offset: 0

Views

Author

Keywords

Comments

For n > 2, T(n,k) is the number of integer strings s(0), ..., s(n) such that s(n) = n - k, s(0) = 0, |s(i) - s(i-1)| = 1 for i = 1,2 and <= 1 for i >= 3.

Examples

			                  1
               1  0  1
            1  0  2  0  1
         1  1  3  2  3  1  1
      1  2  5  6  8  6  5  2  1
   1  3  8 13 19 20 19 13  8  3  1
		

Crossrefs

First differences in n, n direction of array A025177.
Central column is essentially A024997, other columns are A024998, A026069, A026070, A026071. Row sums are in A025579.

Programs

  • Julia
    using Nemo
    function A024996Expansion(prec)
        R, t = PolynomialRing(ZZ, "t")
        S, x = PowerSeriesRing(R, prec+1, "x")
        ser = divexact(x^2*t^3 + x^2*t + x*t - 1, x*t^2 + x*t + x - 1)
        L = zeros(ZZ, prec^2)
        for k ∈ 0:prec-1, n ∈ 0:2*k
            L[k^2+n+1] = coeff(coeff(ser, k), n)
        end
        L
    end
    A024996Expansion(8) |> println # Peter Luschny, Jun 25 2020
  • Maple
    A024996 := proc(n,k)
        option remember;
        if n < 0 or k < 0 or k > 2*n then
            0 ;
        elif n <= 2 then
            if k = 2*n or k = 0 then
                1;
            elif k = 2*n-1 or k = 1 then
                0;
            elif k =2 then
                2;
            end if;
        else
            procname(n-1,k-1)+procname(n-1,k-2)+procname(n-1,k) ;
        end if;
    end proc: # R. J. Mathar, Jun 23 2013
    seq(seq(A024996(n,k), k=0..2*n), n=0..11); # added by Georg Fischer, Jun 24 2020
  • Mathematica
    nmax = 10; CoefficientList[CoefficientList[Series[y*x + (1 - y*x)^2/(1 - x*(1 + y + y^2)), {x, 0, nmax}, {y, 0, 2*nmax}], x], y] // Flatten (* G. C. Greubel, May 22 2017; amended by Georg Fischer, Jun 24 2020 *)
  • PARI
    T(n,k)=if(n<0||k<0||k>2*n,0,if(n==0,1,if(n==1,[1,0,1][k+1],if(n==2,[1,0,2,0,1][k+1],T(n-1,k-2)+T(n-1,k-1)+T(n-1,k))))) \\ Ralf Stephan, Jan 09 2004
    nmax=8; for(n=0, nmax, for(k=0, 2*n, print1(T(n,k),","))) \\ added by _Georg Fischer, Jun 24 2020
    

Formula

T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), starting with [1], [1, 0, 1], [1, 0, 2, 0, 1].
G.f.: y*z + (1-y*z)^2 / (1-z*(1+y+y^2)). - Ralf Stephan, Jan 09 2005 [corrected by Peter Luschny, Jun 25 2020]

Extensions

Edited by Ralf Stephan, Jan 09 2004
Offset corrected by R. J. Mathar, Jun 23 2013

A025181 a(n) = number of (s(0), s(1), ..., s(n)) such that s(i) is an integer, s(0) = 0, |s(1)| = 1, |s(i) - s(i-1)| <= 1 for i >= 2, s(n) = 3. Also a(n) = T(n,n-3), where T is the array defined in A025177.

Original entry on oeis.org

1, 3, 11, 35, 111, 343, 1050, 3186, 9615, 28897, 86592, 258908, 772863, 2304225, 6863496, 20429784, 60779403, 180751617, 537386595, 1597372371, 4747537641, 14108988509, 41928203694, 124598731750, 370279082745, 1100428538391, 3270534249843
Offset: 3

Views

Author

Keywords

Crossrefs

Cf. A025568.
First differences of A014532. First differences are in A026070.

Formula

Conjecture: +(n+3)*a(n) +(-5*n-7)*a(n-1) +(3*n-7)*a(n-2) +(11*n-7)*a(n-3) +4*(-n+6)*a(n-4) +6*(-n+5)*a(n-5)=0. - R. J. Mathar, Feb 25 2015
Conjecture: -(n+3)*(n-3)*(4*n^2-12*n+17)*a(n) +(n-1)*(8*n^3-20*n^2+30*n-81)*a(n-1) +3*(n-1)*(n-2)*(4*n^2-4*n+9)*a(n-2)=0. - R. J. Mathar, Feb 25 2015

A026086 Number of (s(0), s(1), ..., s(n)) such that s(0) = 0, |s(i) - s(i-1)| = 1 for i = 1,2,3; |s(i) - s(i-1)| <= 1 for i >= 4, s(n) = 3; also a(n) = T(n,n-3), where T is the array defined in A026082.

Original entry on oeis.org

1, 6, 16, 52, 156, 475, 1429, 4293, 12853, 38413, 114621, 341639, 1017407, 3027909, 9007017, 26783331, 79622595, 236662764, 703350798, 2090179494, 6211285598, 18457764317, 54851312871, 163009822939, 484469104651, 1439956255806
Offset: 4

Views

Author

Keywords

Crossrefs

First differences of A026070.

Formula

Conjecture: (n+3)*a(n) +5*(-n-1)*a(n-1) +3*(n-5)*a(n-2) +(11*n-9)*a(n-3) +4*(-n+11)*a(n-4) +6*(-n+7)*a(n-5)=0. - R. J. Mathar, Jun 23 2013
Showing 1-3 of 3 results.