login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107429 Number of complete compositions of n. 48

%I #48 Nov 03 2023 10:11:46

%S 1,1,3,4,8,18,33,65,127,264,515,1037,2052,4103,8217,16408,32811,65590,

%T 131127,262112,524409,1048474,2097319,4194250,8389414,16778024,

%U 33557921,67116113,134235473,268471790,536948820,1073893571,2147779943,4295515305,8590928746

%N Number of complete compositions of n.

%C A composition is complete if it is gap-free and contains a 1. - _Geoffrey Critzer_, Apr 13 2014

%H Alois P. Heinz, <a href="/A107429/b107429.txt">Table of n, a(n) for n = 1..1000</a> (first 70 terms from Daniel Reimhult)

%H Alois P. Heinz, <a href="/A107429/a107429.jpg">Plot of (a(n)-2^(n-2))/2^(n-2) for n = 40..1000</a>

%H P. Hitczenko and A. Knopfmacher, <a href="http://dx.doi.org/10.1016/j.disc.2005.02.008">Gap-free compositions and gap-free samples of geometric random variables</a>, Discrete Math., 294 (2005), 225-239.

%F a(n) ~ 2^(n-2). - _Vaclav Kotesovec_, Sep 05 2014

%e a(5)=8 because we have: 2+2+1, 2+1+2, 1+2+2, 2+1+1+1, 1+2+1+1, 1+1+2+1, 1+1+1+2, 1+1+1+1+1. - _Geoffrey Critzer_, Apr 13 2014

%p b:= proc(n, i, t) option remember; `if`(n=0, `if`(i=0, t!, 0),

%p `if`(i<1 or n<i, 0, add(b(n-i*j, i-1, t+j)/j!, j=1..n/i)))

%p end:

%p a:= n-> add(b(n, i, 0), i=1..n):

%p seq(a(n), n=1..40); # _Alois P. Heinz_, Apr 14 2014

%t Table[Length[Select[Level[Map[Permutations,IntegerPartitions[n]],{2}],MemberQ[#,1]&&Length[Union[#]]==Max[#]-Min[#]+1&]],{n,1,20}] (* _Geoffrey Critzer_, Apr 13 2014 *)

%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[i == 0, t!, 0], If[i < 1 || n < i, 0, Sum[b[n - i*j, i - 1, t + j]/j!, {j, 1, n/i}]]];

%t a[n_] := Sum[b[n, i, 0], {i, 1, n}];

%t Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Aug 30 2016, after _Alois P. Heinz_ *)

%Y Cf. A107428, A034296, A188575, A251729.

%K nonn

%O 1,3

%A _N. J. A. Sloane_, May 26 2005

%E More terms from _Vladeta Jovovic_, May 26 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)