login
Number of distinct entries in a slice of A046816.
2

%I #29 Dec 30 2021 00:42:31

%S 1,1,2,3,4,5,7,8,9,12,13,16,19,21,24,25,30,32,37,40,43,46,51,56,59,64,

%T 67,75,79,83,91,93,102,108,111,119,125,131,139,147,154,160,167,175,

%U 183,189,199,206,214,225,233,243,250,261,268,279,289,298,309,317

%N Number of distinct entries in a slice of A046816.

%C Conjectured asymptotic: a(n) ~ (n^2 + 6*n - 12)/12. - _Vladimir Reshetnikov_, Dec 28 2021

%H Alois P. Heinz, <a href="/A086753/b086753.txt">Table of n, a(n) for n = 0..800</a>

%e The slice for n=4 is

%e 1

%e 4 4

%e 6 12 6

%e 4 12 12 4

%e 1 4 6 4 1

%e with distinct entries 1,4,6,12, so a(4) = 4.

%p p:= proc(i, j, k) option remember;

%p if i<0 or j<0 or k<0 or i>k or j>i then 0

%p elif {i, j, k}={0} then 1

%p else p(i, j, k-1) +p(i-1, j, k-1) +p(i-1, j-1, k-1)

%p fi

%p end:

%p a:= n-> nops({seq(seq(p(i, j, n), j=0..i), i=0..n)}):

%p seq(a(n), n=0..50); # _Alois P. Heinz_, Aug 14 2012

%p #

%p seq(nops({coeffs(expand((x+y+z)^n))}), n = 0 .. 100); # _César Eliud Lozada_, Jul 02 2015

%p #

%p seq(nops({seq(seq(n!/(i!*j!*(n-i-j)!),j=i..(n-i)/2),i=0..n/3)}), n=0..100); # _Robert Israel_, Jul 02 2015

%t Table[Length @ Union @ Flatten @ Table[Table[n!/(i!*j!*(n-i-j)!), {j, i, (n-i)/2}], {i, 0, n/3}], {n, 0, 100}] (* _Jean-François Alcover_, Mar 19 2019, after _Robert Israel_ *)

%o (PARI) { pt=vector(40,i,matrix(i,i)); pt[1][1,1]=1; pt[2][1,1]=1; pt[2][2,1]=1; pt[2][2,2]=1; pt[3][1,1]=1; pt[3][2,1]=2; pt[3][2,2]=2; pt[3][3,1]=1; pt[3][3,2]=2; pt[3][3,3]=1; for (i=4,40, for (j=2,i-1, pt[i][j,1]=pt[i-1][j-1,1]+pt[i-1][j,1]; pt[i][j,j]=pt[i][j,1]; pt[i][i,j]=pt[i][j,1] ); pt[i][1,1]=1; pt[i][i,1]=1; pt[i][i,i]=1; for(j=3,i-1, for (k=2,j-1, pt[i][j,k]=pt[i-1][j,k]+pt[i-1][j-1,k]+pt[i-1][j-1,k-1]))); pt } { makept(x)=local(xl,v,vc,uc); xl=length(x); v=vector(xl*(xl+1)/2); vc=0; for (i=1,xl, for (j=1,i,v[vc++ ]=x[i,j])); v=vecsort(v); uc=1; for (i=2,length(v),if (v[i]!=v[i-1],uc++)); print1(","uc) } for (i=1,40,makept(pt([i]))

%Y Cf. A046816.

%K nonn

%O 0,3

%A _Jon Perry_, Jul 31 2003

%E More terms from _Alois P. Heinz_, Aug 14 2012