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.

A298804 Triangle T(n,k) (1 <= k <= n) read by rows: A046936 with rows reversed and offset changed to 1.

Original entry on oeis.org

0, 1, 1, 3, 2, 1, 9, 6, 4, 3, 31, 22, 16, 12, 9, 121, 90, 68, 52, 40, 31, 523, 402, 312, 244, 192, 152, 121
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2018, following a suggestion from Don Knuth, Jan 29 2018

Keywords

Comments

This is another version of Moser's version (A046936) of Aitken's array (A011971).
Although offset 0 is better for A011971 and A046936, for this version offset 1 is more appropriate.
Comments from Don Knuth, Jan 29 2018 (Start):
a(n,k) is the number of set partitions (i.e. equivalence classes) in which (i) 1 is not equivalent to 2, ..., nor k; and (ii) the last part, when parts are ordered by their smallest element, has size 1; (iii) that last part isn't simply "1". (Equivalently, n>1.)
It's not difficult to prove this characterization of a(k,n). For example, if we know that there are 22 partitions of {1,2,3,4,5} with 1 inequivalent to 2, and 6 partitions of {1,2,3,4} with
1 inequivalent to 2, then there are 6 partitions of {1,2,3,4,5} with 1 inequivalent to 2 and 1 equivalent to 3. Hence there are 16 with 1 equivalent to neither 2 nor 3.
The same property, but leaving out conditions (ii) and (iii), characterizes Pierce's triangular array A123346. (End)

Examples

			Triangle begins:
0,
1, 1,
3, 2, 1,
9, 6, 4, 3,
31, 22, 16, 12, 9,
121, 90, 68, 52, 40, 31
523, 402, 312, 244, 192, 152, 121
...
		

Crossrefs

A040027 The Gould numbers.

Original entry on oeis.org

1, 1, 3, 9, 31, 121, 523, 2469, 12611, 69161, 404663, 2512769, 16485691, 113842301, 824723643, 6249805129, 49416246911, 406754704841, 3478340425563, 30845565317189, 283187362333331, 2687568043654521, 26329932233283223, 265946395403810289, 2766211109503317451
Offset: 0

Views

Author

Keywords

Comments

Number of permutations beginning with 21 and avoiding 1-23. - Ralf Stephan, Apr 25 2004
Originally defined as main diagonal of an array of binomial recurrence coefficients (see Gould and Quaintance). Also second-from-right diagonal of triangle A121207.
Starting (1, 3, 9, 31, 121, ...) = row sums of triangle A153868. - Gary W. Adamson, Jan 03 2009
Equals eigensequence of triangle A074909 (reflected). - Gary W. Adamson, Apr 10 2009
The divergent series g(x=1,m) = 1^m*1! - 2^m*2! + 3^m*3! - 4^m*4! + ..., m=>-1, is related to the sequence given above. For m=-1 this series dates back to Euler. We discovered that g(x=1,m) = (-1)^m * (A040027(m) - A000110(m+1) * A073003) with A073003 Gompertz's constant and A000110 the Bell numbers, see A163940; A040027(m = -1) = 0. - Johannes W. Meijer, Oct 16 2009
Compare the o.g.f. to the o.g.f. B(x) of the Bell numbers, where B(x) = 1 + x*B(x/(1-x))/(1-x). - Paul D. Hanna, Mar 23 2012
a(n) is the number of set partitions of {1,2,...,n+1} in which the last block is a singleton: the blocks are arranged in order of their least element. An example is given below. - Peter Bala, Dec 17 2014

Examples

			a(3) = 9: Arranging the blocks of the 15 set partitions of {1,2,3,4} in order of their least element we find 9 set partitions for which the last block is a singleton, namely, 123|4, 124|3, 134|2, 1|24|3, 1|23|4, 12|3|4, 13|2|4, 14|2|3, and 1|2|3|4. - _Peter Bala_, Dec 17 2014
		

Crossrefs

Left-hand border of triangle A046936. Cf. also A011971, A014619, A298804.
Cf. A153868. - Gary W. Adamson, Jan 03 2009
Cf. A074909. - Gary W. Adamson, Apr 10 2009
Row sums of A163940. - Johannes W. Meijer, Oct 16 2009
Cf. A108458 (row sums), A124496 (column 1).

Programs

  • Haskell
    a040027 n = head $ a046936_row (n + 1)  -- Reinhard Zumkeller, Jan 01 2014
    
  • Maple
    A040027 := proc(n)
        option remember;
        if n = 0 then
            1;
        else
            add(binomial(n,k-1)*procname(n-k),k=1..n) ;
        end if;
    end proc: # Johannes W. Meijer, Oct 16 2009
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = Sum[Binomial[n, k + 1]*a[k], {k, 0, n - 1}]; Table[a[n], {n, 0, 22}]  (* Jean-François Alcover, Jul 02 2013 *)
    Rest[CoefficientList[Assuming[Element[x, Reals], Series[E^E^x*(ExpIntegralEi[-E^x] - ExpIntegralEi[-1]), {x, 0, 20}]], x] * Range[0, 20]!] (* Vaclav Kotesovec, Feb 28 2014 *)
  • PARI
    {a(n)=local(A=1+x);for(i=1,n,A=1+x*subst(A,x,x/(1-x+x*O(x^n)))/(1-x)^2);polcoeff(A,n)} /* Paul D. Hanna, Mar 23 2012 */
    
  • Python
    # The function Gould_diag is defined in A121207.
    A040027_list = lambda size: Gould_diag(2, size)
    print(A040027_list(24)) # Peter Luschny, Apr 24 2016

Formula

a(n) = b(n-2), n>1, b(n) = Sum_{k = 1..n} binomial(n, k-1)*b(n-k), b(0) = 1. - Vladeta Jovovic, Apr 28 2001
E.g.f. satisfies A'(x) = exp(x)*A(x)+1. - N. J. A. Sloane
With offset 0, e.g.f.: x + exp(exp(x)) * Integral_{t=0..x} t*exp(-exp(t)+t) dt (fits the recurrence up to n=215). - Ralf Stephan, Apr 25 2004
Recurrence: a(0)=1, a(1)=1, for n > 1, a(n) = n + Sum_{j=1..n-1} binomial(n, j+1)*a(j). - Jon Perry, Apr 26 2005
O.g.f. satisfies: A(x) = 1 + x*A( x/(1-x) ) / (1-x)^2. - Paul D. Hanna, Mar 23 2012
From Peter Bala, Dec 17 2014: (Start)
Starting from A(x) = 1 + O(x) (big Oh notation) we can get a series expansion for the o.g.f. by repeatedly applying the above functional equation of Hanna: A(x) = 1 + O(x) = 1 + x/(1-x)^2 + O(x^2) = 1 + x/(1-x)^2 + x^2/((1-x)*(1-2*x)^2) + O(x^3) = ... = 1 + x/(1-x)^2 + x^2/((1-x)*(1-2*x)^2) + x^3/((1-x)*(1-2*x)*(1-3*x)^2) + x^4/((1-x)*(1-2*x)*(1-3*x)*(1-4*x)^2) + ....
a(n) = Sum_{k = 0..n} ( Sum_{j = k..n} Stirling2(j,k)*k^(n-j) ).
Row sums of A108458. First column of A124496. (End)
Conjecture: a(n) = Sum_{k = 0..n} A058006(k)*A048993(n+1, k+1) - Velin Yanev, Aug 31 2021

Extensions

Entry revised by N. J. A. Sloane, Dec 11 2006
Gould reference updated by Johannes W. Meijer, Aug 02 2009
Don Knuth, Jan 29 2018, suggested that this sequence should be named after H. W. Gould. - N. J. A. Sloane, Jan 30 2018

A121207 Triangle read by rows. The definition is by diagonals. The r-th diagonal from the right, for r >= 0, is given by b(0) = b(1) = 1; b(n+1) = Sum_{k=0..n} binomial(n+2,k+r)*a(k).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 3, 5, 1, 1, 4, 9, 15, 1, 1, 5, 14, 31, 52, 1, 1, 6, 20, 54, 121, 203, 1, 1, 7, 27, 85, 233, 523, 877, 1, 1, 8, 35, 125, 400, 1101, 2469, 4140, 1, 1, 9, 44, 175, 635, 2046, 5625, 12611, 21147, 1, 1, 10, 54, 236, 952, 3488, 11226, 30846, 69161, 115975
Offset: 0

Views

Author

N. J. A. Sloane, based on email from R. J. Mathar, Dec 11 2006

Keywords

Comments

From Paul D. Hanna, Dec 12 2006: (Start)
Consider the row reversal, which is A124496 with an additional left column (A000110 = Bell numbers). The matrix inverse of this triangle is very simple:
1;
-1, 1;
-1, -1, 1;
-1, -2, -1, 1;
-1, -3, -3, -1, 1;
-1, -4, -6, -4, -1, 1;
-1, -5, -10, -10, -5, -1, 1;
-1, -6, -15, -20, -15, -6, -1, 1;
-1, -7, -21, -35, -35, -21, -7, -1, 1;
-1, -8, -28, -56, -70, -56, -28, -8, -1, 1; ...
This gives the recurrence and explains why the Bell numbers appear. (End)
Triangle A160185 = reversal then deletes right border of 1's. - Gary W. Adamson, May 03 2009

Examples

			Triangle begins (compare also table 9.2 in the Gould-Quaintance reference):
  1;
  1, 1;
  1, 1,  2;
  1, 1,  3,  5;
  1, 1,  4,  9,  15;
  1, 1,  5, 14,  31, 52;
  1, 1,  6, 20,  54, 121, 203;
  1, 1,  7, 27,  85, 233, 523,  877;
  1, 1,  8, 35, 125, 400,1101, 2469,  4140;
  1, 1,  9, 44, 175, 635,2046, 5625, 12611, 21147;
  1, 1, 10, 54, 236, 952,3488,11226, 30846, 69161, 115975;
  1, 1, 11, 65, 309,1366,5579,20425, 65676,180474, 404663, 678570;
  1, 1, 12, 77, 395,1893,8494,34685,126817,407787,1120666,2512769,4213597;
		

Crossrefs

Diagonals, reading from the right, are A000110, A040027, A045501, A045499, A045500.
A124496 is a very similar triangle, obtained by reversing the rows and appending a rightmost diagonal which is A000110, the Bell numbers. See also A046936, A298804, A186020, A160185.
T(2n,n) gives A297924.

Programs

  • Julia
    function Gould_diag(diag, size)
        size < 1 && return []
        size == 1 && return [1]
        L = [1, 1]
        accu = ones(BigInt, diag)
        for _ in 1:size-2
            accu = cumsum(vcat(accu[end], accu))
            L = vcat(L, accu[end])
        end
    L end # Peter Luschny, Mar 30 2022
  • Maple
    # This is the Jovovic formula with general index 'd'
    # where A040027, A045499, etc. use one explicit integer
    # Index n+1 is shifted to n from the original formula.
    Gould := proc(n, d) local k;
        if n <= 1 then return 1 else
        return add(binomial(n-1+d, k+d)*Gould(k, d), k=0..n-1);
        fi
    end:
    # row and col refer to the extrapolated super-table:
    # working up to row, not row-1, shows also the Bell numbers
    # at the end of each row.
    for row from 0 to 13 do
        for col from 0 to row do
           # 'diag' is constant for one of A040027, A045499 etc.
           diag := row - col;
           printf("%4d, ", Gould(col, diag));
        od;
        print();
    od; # R. J. Mathar
    # second Maple program:
    T:= proc(n, k) option remember; `if`(k=0, 1,
          add(T(n-j, k-j)*binomial(n-1, j-1), j=1..k))
        end:
    seq(seq(T(n, k), k=0..n), n=0..12);  # Alois P. Heinz, Jan 08 2018
  • Mathematica
    g[n_ /; n <= 1, ] := 1; g[n, d_] := g[n, d] = Sum[ Binomial[n-1+d, k+d]*g[k, d], {k, 0, n-1}]; Flatten[ Table[ diag = row-col; g[col, diag], {row, 0, 13}, {col, 0, row}]] (* Jean-François Alcover, Nov 25 2011, after R. J. Mathar *)
    T[n_, k_] := T[n, k] = If[k == 0, 1, Sum[T[n-j, k-j] Binomial[n-1, j-1], {j, 1, k}]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 26 2018, after Alois P. Heinz *)
  • Python
    # Computes the n-th diagonal of the triangle reading from the right.
    from itertools import accumulate
    def Gould_diag(diag, size):
        if size < 1: return []
        if size == 1: return [1]
        L, accu = [1,1], [1]*diag
        for _ in range(size-2):
            accu = list(accumulate([accu[-1]] + accu))
            L.append(accu[-1])
        return L # Peter Luschny, Apr 24 2016
    

A007604 a(n) = a(n-1) + a(n-1-(number of odd terms so far)).

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 12, 16, 22, 31, 40, 52, 68, 90, 121, 152, 192, 244, 312, 402, 523, 644, 796, 988, 1232, 1544, 1946, 2469, 2992, 3636, 4432, 5420, 6652, 8196, 10142, 12611, 15080, 18072, 21708, 26140, 31560, 38212, 46408, 56550, 69161, 81772, 96852
Offset: 1

Views

Author

Keywords

Comments

A003056(n) gives the number of odd terms in the first n terms of this sequence. Modulo 2, this sequence becomes A023531. - T. D. Noe, Jul 24 2007
The present definition was the original definition of this sequence. It was later changed to "Sequence formed from rows of triangle A046936", but this seems less satisfactory. - N. J. A. Sloane, Oct 26 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007604 n = a007604_list !! (n-1)
    a007604_list = concat $ map tail $ tail a046936_tabl
    -- Reinhard Zumkeller, Jan 01 2014
  • Maple
    A[1]:= 1: A[2]:= 2: o:= 1:
    for n from 3 to 100 do
      A[n]:= A[n-1] + A[n-1-o];
      if A[n]::odd then o:= o+1 fi
    od:
    seq(A[i],i=1..100); # Robert Israel, Mar 14 2023
  • Mathematica
    a[n_Integer] := a[n] = Block[{c, k}, c = 0; k = 1; While[k < n, If[ OddQ[ a[k] ], c++ ]; k++ ]; Return[a[n - 1] + a[n - 1 - c] ] ]; a[1] = 1; a[2] = 2; Table[ a[n], {n, 0, 60} ]

Extensions

Entry revised by N. J. A. Sloane, Oct 26 2014

A155118 Array T(n,k) read by antidiagonals: the k-th term of the n-th iterated differences of A140429.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 3, 4, 6, 9, 5, 8, 12, 18, 27, 11, 16, 24, 36, 54, 81, 21, 32, 48, 72, 108, 162, 243, 43, 64, 96, 144, 216, 324, 486, 729, 85, 128, 192, 288, 432, 648, 972, 1458, 2187, 171, 256, 384, 576, 864, 1296, 1944, 2916, 4374, 6561, 341, 512, 768, 1152, 1728, 2592, 3888, 5832, 8748, 13122, 19683
Offset: 0

Views

Author

Paul Curtz, Jan 20 2009

Keywords

Comments

Deleting column k=0 and reading by antidiagonals yields A036561.
Deleting column k=0 and reading the antidiagonals downwards yields A175840.

Examples

			The array starts in row n=0 with columns k>=0 as:
   0   1    3    9    27    81    243    729    2187  ... A140429;
   1   2    6   18    54   162    486   1458    4374  ... A025192;
   1   4   12   36   108   324    972   2916    8748  ... A003946;
   3   8   24   72   216   648   1944   5832   17496  ... A080923;
   5  16   48  144   432  1296   3888  11664   34992  ... A257970;
  11  32   96  288   864  2592   7776  23328   69984  ...
  21  64  192  576  1728  5184  15552  46656  139968  ...
Antidiagonal triangle begins as:
   0;
   1,   1;
   1,   2,   3;
   3,   4,   6,   9;
   5,   8,  12,  18,  27;
  11,  16,  24,  36,  54,  81;
  21,  32,  48,  72, 108, 162, 243;
  43,  64,  96, 144, 216, 324, 486, 729;
  85, 128, 192, 288, 432, 648, 972, 1458, 2187; - _G. C. Greubel_, Mar 25 2021
		

Crossrefs

Programs

  • Magma
    t:= func< n,k | k eq 0 select (2^(n-k) -(-1)^(n-k))/3 else 2^(n-k)*3^(k-1) >;
    [t(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 25 2021
    
  • Maple
    T:=proc(n,k)if(k>0)then return 2^n*3^(k-1):else return (2^n - (-1)^n)/3:fi:end:
    for d from 0 to 8 do for m from 0 to d do print(T(d-m,m)):od:od: # Nathaniel Johnston, Apr 13 2011
  • Mathematica
    t[n_, k_]:= If[k==0, (2^(n-k) -(-1)^(n-k))/3, 2^(n-k)*3^(k-1)];
    Table[t[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 25 2021 *)
  • Sage
    def A155118(n,k): return (2^(n-k) -(-1)^(n-k))/3 if k==0 else 2^(n-k)*3^(k-1)
    flatten([[A155118(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 25 2021

Formula

For the square array:
T(n,k) = 2^n*3^(k-1), k>0.
T(n,k) = T(n-1,k+1) - T(n-1,k), n>0.
Rows:
T(0,k) = A140429(k) = A000244(k-1).
T(1,k) = A025192(k).
T(2,k) = A003946(k).
T(3,k) = A080923(k+1).
T(4,k) = A257970(k+3).
Columns:
T(n,0) = A001045(n) (Jacobsthal numbers J_{n}).
T(n,1) = A000079(n).
T(n,2) = A007283(n).
T(n,3) = A005010(n).
T(n,4) = A175806(n).
T(0,k) - T(k+1,0) = 4*A094705(k-2).
From G. C. Greubel, Mar 25 2021: (Start)
For the antidiagonal triangle:
t(n, k) = T(n-k, k).
t(n, k) = (2^(n-k) - (-1)^(n-k))/3 (J_{n-k}) if k = 0 else 2^(n-k)*3^(k-1).
Sum_{k=0..n} t(n, k) = 3^n - J_{n+1}, where J_{n} = A001045(n).
Sum_{k=0..n} t(n, k) = A004054(n-1) for n >= 1. (End)

Extensions

a(22) - a(57) from Nathaniel Johnston, Apr 13 2011
Showing 1-5 of 5 results.