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.

A184703 T(n,k) is the number of strings of numbers x(i=1..n) in 0..k with sum i*x(i) equal to k*n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 2, 3, 2, 1, 3, 6, 7, 3, 1, 3, 9, 14, 12, 4, 1, 4, 12, 28, 34, 21, 5, 1, 4, 17, 46, 78, 74, 35, 6, 1, 5, 22, 74, 156, 207, 154, 58, 8, 1, 5, 27, 107, 282, 476, 504, 304, 91, 10, 1, 6, 34, 154, 471, 985, 1349, 1169, 580, 142, 12, 1, 6, 41, 208, 744, 1842, 3142, 3571, 2574, 1066, 215, 15
Offset: 1

Views

Author

R. H. Hardin, Jan 20 2011

Keywords

Comments

T(n,k) is the number of integer lattice points in k*P_n, where P_n is the polytope in R^n defined by the constraints 0 <= x_i <= 1 and Sum_{i=1..n} i x_i = n. Thus for each n, T(n,k) is an Ehrhart quasi-polynomial. - Robert Israel, Dec 21 2022

Examples

			Table starts:
   1   1    1    1     1     1      1      1       1       1       1       1
   1   2    2    3     3     4      4      5       5       6       6       7
   2   3    6    9    12    17     22     27      34      41      48      57
   2   7   14   28    46    74    107    154     208     278     357     456
   3  12   34   78   156   282    471    744    1119    1623    2279    3118
   4  21   74  207   476   985   1842   3226    5325    8414   12766   18789
   5  35  154  504  1349  3142   6575  12688   22923   39266   64315  101460
   6  58  304 1169  3571  9353  21713  46037   90595  167917  295811  499442
   8  91  580 2574  8939 26146  67105 155645  332729  665317 1257898 2268061
  10 142 1066 5439 21310 69331 195760 495251 1146377 2467215 4994696 9599863
Some solutions for n=5, k=4:
  4   4   2   0   1   2   1   0   2   4   0   0   4   0   2   2
  1   2   3   1   2   0   2   0   1   1   0   0   0   2   2   1
  2   1   4   0   1   2   2   1   4   0   4   0   4   0   2   2
  2   1   0   2   3   3   1   3   1   1   2   0   1   4   2   0
  0   1   0   2   0   0   1   1   0   2   0   4   0   0   0   2
		

Crossrefs

Column 1 is A000009.
Row 3 is A008810(n+1).

Programs

  • Maple
    S:= proc(n,k,s) option remember; local j;
      if n = 1 then
        if s <= k then return 1 else return 0 fi
      fi;
      add(procname(n-1,k,s-j*n), j=0..min(s/n,k))
    end proc:
    [seq(seq(S(n,m-n,(m-n)*n),n=1..m-1),m=1..20)]; # Robert Israel, Dec 21 2022
  • Mathematica
    S[n_, k_, s_] := S[n, k, s] = Module[{}, If[n == 1, If[s <= k, Return@1, Return@0]]; Sum[S[n - 1, k, s - j*n], {j, 0, Min[s/n, k]}]];
    Table[Table[S[n, m - n, (m - n)*n], {n, 1, m - 1}], {m, 1, 20}] // Flatten (* Jean-François Alcover, Aug 21 2023, after Robert Israel *)