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.

A214247 Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 4, 4, 1, 1, 1, 1, 1, 2, 5, 2, 1, 1, 1, 1, 1, 3, 3, 5, 4, 1, 1, 1, 1, 1, 1, 2, 2, 7, 3, 1, 1, 1, 1, 1, 1, 3, 3, 6, 10, 4, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 9, 2
Offset: 0

Views

Author

Alois P. Heinz, Jul 08 2012

Keywords

Examples

			A(5,0) = 2: [5], [1,1,1,1,1].
A(5,1) = 4: [5], [3,2], [2,3], [2,1,2].
A(5,2) = 2: [5], [1,3,1].
A(5,3) = 3: [5], [4,1], [1,4].
Square array A(n,k) begins:
  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  2,  1,  1,  1,  1,  1,  1,  1,  1, ...
  2,  3,  1,  1,  1,  1,  1,  1,  1, ...
  3,  2,  3,  1,  1,  1,  1,  1,  1, ...
  2,  4,  2,  3,  1,  1,  1,  1,  1, ...
  4,  5,  3,  2,  3,  1,  1,  1,  1, ...
  2,  5,  2,  3,  2,  3,  1,  1,  1, ...
  4,  7,  6,  1,  3,  2,  3,  1,  1, ...
		

Crossrefs

Columns k=0-2 give: A000005, A173258, A214254.
Rows n=0, 1 and main diagonal give: A000012.

Programs

  • Maple
    b:= proc(n, i, k) option remember;
          `if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j, k), j={-k, k})))
        end:
    A:= (n, k)-> `if`(n=0, 1, add(b(n, j, k), j=1..n)):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j, k], { j, Union[{-k, k}]}]]]; a[n_, k_] := If[n == 0, 1, Sum[b[n, j, k], {j, 1, n}]]; Table[Table[a[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)
  • PARI
    tri(k) = {(k*(k+1)/2)}
    ra(n) = {(sqrt(1+8*n)-1)/2}
    C(q,n) = {c = if(n<=1, return(1)); return(sum(i=0, n-1, C(q, i) * C(q, n-1-i) * q^((i+1)*(n-1 -i))));}
    Cw_q(i,k) = {return(q^(((k+2)*i)+1) * polrecip(C(q^(2*k),i)))}
    A_qt(k,N) = {1 + sum(i=0,N/(k+1), t^((2*i)+1) * Cw_q(i,k) * (sum(j=0,ra(N+2)+1, prod(u=1,j, sum(v=0,(N-(tri(u)*k))/(k+2), t^((2*v)+1) * q^(((2*v)+1)*u*k) * Cw_q(v,k)))))^2)}
    A_q(k,N) = {my(q='q+O('q^N), Aqt = A_qt(k,N), Aq = 1); for(i=1,poldegree(Aqt,t), Aq += polcoef(Aqt,i,t)/(1-q^i)); Aq}
    A214247_array(maxrow,maxcolumn) = {my(m=concat([1],vector(maxrow,n,numdiv(n)))~); for(k=1,maxcolumn, m = matconcat([m,Vec(A_q(k,maxrow))~])); m}
    A214247_array(10,10) \\ John Tyler Rascoe, Oct 15 2024

Formula

G.f. for column k > 0: A(k,q) is A(k,q,t) = Sum_{n,m>=0} (q^n)*(t^m) under the transform (q^n)*(t^m) -> (q^n)/(1-q^m) for all m > 0 where A(k,q,t) = 1 + Sum_{i>=0} ( t^((2*i)+1) * Cw(i,k,q) * (Sum_{j>=0} (Product_{u=1..j} (Sum_{v>=0} t^((2*v)+1) * q^(((2*v)+1)*k*u) * Cw(v,k,q))))^2 ), Cw(i,k,q) = q^(((k+2)*i)+1) * Ca(i,q^(2*k)), and Ca(i,q) is the i-th Carlitz-Riordan q-Catalan number (i-th row polynomial of A227543). - John Tyler Rascoe, Sep 13 2024

A370929 Number of compositions of n with parts (p_1, ..., p_i) such that the set of adjacent differences is a subset of {-k,k} for some k > 0 and the number of parts equals ceiling(p_1/k).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 3, 5, 5, 7, 5, 9, 7, 7, 10, 11, 9, 13, 9, 13, 17, 11, 14, 19, 15, 13, 20, 19, 18, 23, 19, 20, 26, 21, 20, 32, 22, 25, 27, 33, 25, 37, 21, 34, 36, 35, 24, 50, 26, 40, 37, 44, 32, 51, 31, 48, 46, 49, 34, 65, 40, 45, 54, 56, 48, 63, 42, 58
Offset: 0

Views

Author

John Tyler Rascoe, Mar 06 2024

Keywords

Examples

			The compositions for n = 6 and n = 8 are:
6: [6], [5,1], [4,2], [3,2,1].
8: [8], [7,1], [6,2], [3,2,3], [3,5].
		

Crossrefs

Compositions such that no adjacent parts are equal is A003242.
Compositions such that the set of adjacent differences is a subset of {-1,1} is A173258 and {-2,2} is A214254.
The array A214247 counts compositions such that the set of adjacent differences is a subset of {-k,k}.

Programs

  • PARI
    { my(N=75, x='x+O('x^N));
    my(gf= 1 + sum(p=1, N, sum(k=1, p, x^(p*ceil(p/k)) * prod(j=1, ceil(p/k)-1, (x^(-j*k) + x^(j*k))))));
    Vec(gf) }

Formula

G.f.: 1 + Sum_{p>0} Sum_{k=1..p} x^(p*i) * Product_{j=1..i-1} (x^(-j*k) + x^(j*k)), where i = ceiling(p/k).
Showing 1-2 of 2 results.