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

A305161 Number A(n,k) of compositions of n into exactly n nonnegative parts <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 3, 1, 0, 1, 1, 3, 7, 1, 0, 1, 1, 3, 10, 19, 1, 0, 1, 1, 3, 10, 31, 51, 1, 0, 1, 1, 3, 10, 35, 101, 141, 1, 0, 1, 1, 3, 10, 35, 121, 336, 393, 1, 0, 1, 1, 3, 10, 35, 126, 426, 1128, 1107, 1, 0, 1, 1, 3, 10, 35, 126, 456, 1520, 3823, 3139, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 17 2018

Keywords

Examples

			A(3,1) = 1: 111.
A(3,2) = 7: 012, 021, 102, 111, 120, 201, 210.
A(3,3) = 10: 003, 012, 021, 030, 102, 111, 120, 201, 210, 300.
A(4,2) = 19: 0022, 0112, 0121, 0202, 0211, 0220, 1012, 1021, 1102, 1111, 1120, 1201, 1210, 2002, 2011, 2020, 2101, 2110, 2200.
A(4,3) = 31: 0013, 0022, 0031, 0103, 0112, 0121, 0130, 0202, 0211, 0220, 0301, 0310, 1003, 1012, 1021, 1030, 1102, 1111, 1120, 1201, 1210, 1300, 2002, 2011, 2020, 2101, 2110, 2200, 3001, 3010, 3100.
Square array A(n,k) begins:
  1, 1,    1,    1,    1,    1,    1,    1,    1, ...
  0, 1,    1,    1,    1,    1,    1,    1,    1, ...
  0, 1,    3,    3,    3,    3,    3,    3,    3, ...
  0, 1,    7,   10,   10,   10,   10,   10,   10, ...
  0, 1,   19,   31,   35,   35,   35,   35,   35, ...
  0, 1,   51,  101,  121,  126,  126,  126,  126, ...
  0, 1,  141,  336,  426,  456,  462,  462,  462, ...
  0, 1,  393, 1128, 1520, 1667, 1709, 1716, 1716, ...
  0, 1, 1107, 3823, 5475, 6147, 6371, 6427, 6435, ...
		

Crossrefs

Rows n=0-1 give: A000012, A057427.
Main diagonal gives A088218 or A001700(n-1) for n>0.
A(n+1,n) gives A048775.
Cf. A180281.

Programs

  • Maple
    A:= (n, k)-> coeff(series(((x^(k+1)-1)/(x-1))^n, x, n+1), x, n):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
    # second Maple program:
    b:= proc(n, i, k) option remember; `if`(n=0, 1,
          `if`(i=0, 0, add(b(n-j, i-1, k), j=0..min(n, k))))
        end:
    A:= (n, k)-> b(n$2, k):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i == 0, 0, Sum[b[n - j, i - 1, k], {j, 0, Min[n, k]}]]];
    A[n_, k_] := b[n, n, k];
    Table[A[n, d - n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, May 05 2019, after Alois P. Heinz *)

Formula

A(n,k) = [x^n] ((x^(k+1)-1)/(x-1))^n.
A(n,k) - A(n,k-1) = A180281(n,k) for n,k > 0.
A(n,k) = A(n,n) for all k >= n.

A130835 Sum of all numbers having n or fewer digits and having the sum of their digits equal to n.

Original entry on oeis.org

1, 33, 1110, 38885, 1399986, 51333282, 1906666476, 71499999285, 2701111108410, 102631111100848, 3917722222183045, 150126888888738762, 5771538888888311735, 222499777777775552780, 8598259999999991401740, 332968856666666633369781, 12918171566666666537484951
Offset: 1

Views

Author

J. M. Bergot, Jul 18 2007

Keywords

Examples

			Take n = 3. The numbers to be summed are 111, 3, 30, 300, 210, 201, 120, 102, 21 and 12, which add to 1110.
		

Crossrefs

Programs

  • Maple
    A007953 := proc(n) add(i,i=convert(n,base,10)) ; end: A130835 := proc(n) local a,i; a := 0 ; for i from 1 to 10^n-1 do if A007953(i) = n then a := a+i ; fi ; od ; RETURN(a) ; end: seq(A130835(n),n=1..4) ; # R. J. Mathar, Aug 01 2007
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i=0, 0, add(b(n-j, i-1), j=0..min(n, 9))))
        end:
    a:= n-> b(n, n)*(10^n-1)/9:
    seq(a(n), n=1..20); # Alois P. Heinz, Nov 02 2009

Formula

a(n) = (10^n-1)/9 * [x^n] ((x^10-1)/(x-1))^n. - Alois P. Heinz, Feb 07 2012
a(n) = A000042(n) * A167403(n) = A002275(n) * A167403(n). - Alois P. Heinz, Aug 16 2018

Extensions

a(4)-a(6) from R. J. Mathar, Aug 01 2007
a(7)-a(12) from Donovan Johnson, Jul 02 2009
More terms from Alois P. Heinz, Nov 02 2009
Showing 1-2 of 2 results.