login
The number of subsets of the numbers {1,2,3...,n} consisting of at most 3 elements and at most two of those are even.
0

%I #21 Mar 28 2024 09:01:37

%S 1,2,4,8,15,26,41,63,89,126,166,222,279,358,435,541,641,778,904,1076,

%T 1231,1442,1629,1883,2105,2406,2666,3018,3319,3726,4071,4537,4929,

%U 5458,5900,6496,6991,7658,8209,8951,9561,10382,11054,11958,12695,13686,14491

%N The number of subsets of the numbers {1,2,3...,n} consisting of at most 3 elements and at most two of those are even.

%C This sequence has first six terms same as Cake numbers (A000125) after that it is different. The difference can be explained by duplicated tetrahedral numbers.

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3,-3,3,1,-1).

%F a(n) = {(14*n^3+15*n^2+49*n+111)-(3*n^2-15*n+15)(-1)^n}/96.

%F G.f.: ( 1+x-x^2+x^3+4*x^4+2*x^5-x^6 ) / ( (1+x)^3*(x-1)^4 ). - _R. J. Mathar_, Jan 19 2012

%F a(0)=1, a(1)=2, a(2)=4, a(3)=8, a(4)=15, a(5)=26, a(6)=41, a(n)=a(n-1)+ 3*a(n-2)-3*a(n-3)-3*a(n-4)+3*a(n-5)+a(n-6)-a(n-7). - _Harvey P. Dale_, Apr 17 2012

%e a(7) = ((14*7^3+15*7^2+49*7+111)-(3*7^2-15*7+15)(-1)^7)/96 = 63.

%p seq(binomial(n, 3)+binomial(n, 2)+binomial(n, 1)+binomial(n, 0)- binomial(floor(n/2), 3) , n=0..29);

%t Table[Total[Table[Binomial[n,i],{i,0,3}]]-Binomial[Floor[n/2],3],{n,0,60}] (* or *) LinearRecurrence[{1,3,-3,-3,3,1,-1},{1,2,4,8,15,26,41},60] (* _Harvey P. Dale_, Apr 17 2012 *)

%Y Cf. A000125, A058187.

%K nonn,easy

%O 0,2

%A _Darshana Patel_, Jan 16 2012

%E More terms from _Harvey P. Dale_, Apr 17 2012