A045623 Number of 1's in all compositions of n+1.
1, 2, 5, 12, 28, 64, 144, 320, 704, 1536, 3328, 7168, 15360, 32768, 69632, 147456, 311296, 655360, 1376256, 2883584, 6029312, 12582912, 26214400, 54525952, 113246208, 234881024, 486539264, 1006632960, 2080374784, 4294967296, 8858370048, 18253611008, 37580963840
Offset: 0
Examples
E.g. a(2)=5 because in the compositions of 3, namely 3,2+1,1+2,1+1+1, we have five 1's altogether. There are a(3)=12 compositions of 3 into 2 sorts of parts where all parts of the first sort precede all parts of the second sort. Here p:s stands for "part p of sort s": 01: [ 1:0 1:0 1:0 ] 02: [ 1:0 1:0 1:1 ] 03: [ 1:0 1:1 1:1 ] 04: [ 1:0 2:0 ] 05: [ 1:0 2:1 ] 06: [ 1:1 1:1 1:1 ] 07: [ 1:1 2:1 ] 08: [ 2:0 1:0 ] 09: [ 2:0 1:1 ] 10: [ 2:1 1:1 ] 11: [ 3:0 ] 12: [ 3:1 ] - _Joerg Arndt_, Apr 28 2013 For the compositions of 6, the total number of runs of parts of size 2 is a(6-2) - a(6-2*2) = 28 - 5 = 23, enumerated as follows (with the runs of 2 enclosed in []): 4,[2]; [2],4; [2],3,1; [2],1,3; 3,[2],1; 1,[2],3; 3,1,[2]; 1,3,[2]; [2,2,2]; [2,2],1,1; 1,[2,2],1; 1,1,[2,2]; [2],1,[2],1; 1,[2],1,[2]; [2],1,1,[2]; [2],1,1,1,1; 1,[2],1,1,1; 1,1,[2],1,1; 1,1,1,[2],1; and 1,1,1,1[2]. - _Gregory L. Simay_, Feb 17 2018 There are a(3)=12 triwords of length 3: (0,0,0), (0,0,2), (0,2,0), (0,2,2), (1,0,0), (1,0,2), (1,1,0), (1,1,1), (1,1,2), (1,2,0), (1,2,1), (1,2,2). - _Henri Mühle_, Mar 08 2021
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Marco Abrate, Stefano Barbero, Umberto Cerruti and Nadir Murru, Colored compositions, Invert operator and elegant compositions with the "black tie", Discrete Math., Vol. 335 (2014), pp. 1-7. MR3248794.
- Marco Abrate, Stefano Barbero, Umberto Cerruti and Nadir Murru, Colored compositions, Invert operator and elegant compositions with the "black tie", arXiv:1409.6454 [math.NT], 2014.
- Ron M. Adin and Yuval Roichman, Matrices, Characters and Descents, arXiv:1301.1675 [math.CO], 2013-2014; see p.10.
- Félix Balado and Guénolé C. M. Silvestre, Runs of Ones in Binary Strings, arXiv:2302.11532 [math.CO], 2023. See pp. 6-7.
- Freddy Cachazo and Nick Early, Planar Kinematics: Cyclic Fixed Points, Mirror Superpotential, k-Dimensional Catalan Numbers, and Root Polytopes, arXiv:2010.09708 [math.CO], 2020.
- Camille Combe, A geometric and combinatorial exploration of Hochschild lattices, arXiv:2007.00048 [math.CO], 2020.
- Éva Czabarka, Rigoberto Flórez, Leandro Junes and José L. Ramírez, Enumerations of peaks and valleys on non-decreasing Dyck paths, Discrete Math., Vol. 341, No. 10 (2018), pp. 2789-2807. See p. 2798.
- Michael Dairyko, Lara Pudwell, Samantha Tyner and Casey Wynn, Non-contiguous pattern avoidance in binary trees. Electron. J. Combin., Vol. 19, No. 3 (2012), Paper 22, 21 pp. MR2967227. - From _N. J. A. Sloane_, Feb 01 2013
- Robert Davis and Greg Simay, Further Combinatorics and Applications of Two-Toned Tilings, arXiv:2001.11089 [math.CO], 2020.
- Frank Ellermann, Illustration of binomial transforms.
- Nickolas Hein and Jia Huang, Variations of the Catalan numbers from some nonassociative binary operations, arXiv:1807.04623 [math.CO], 2018.
- V. E. Hoggatt, Jr., Letters to N. J. A. Sloane, 1974-1975.
- Milan Janjic, Two Enumerative Functions.
- Milan Janjic and Boris Petkovic, A Counting Function, arXiv 1301.4550 [math.CO], 2013.
- Milan Janjic and Boris Petkovic, A Counting Function Generalizing Binomial Coefficients and Some Other Classes of Integers, J. Int. Seq., Vol. 17 (2014), Article 14.3.5.
- Sergey Kitaev, Jeffrey Remmel and Mark Tiefenbruck, Quadrant Marked Mesh Patterns in 132-Avoiding Permutations II, arXiv:1302.2274 [math.CO], 2013.
- Sergey Kitaev, Jeffrey Remmel and Mark Tiefenbruck, Quadrant Marked Mesh Patterns in 132-Avoiding Permutations II, Electronic Journal of Combinatorial Number Theory, Vol. 15 (2015), Article A16.
- Henri Mühle Hochschild lattices and shuffle lattices, arXiv:2008.13247 [math.CO], 2020.
- Koushik Sinha and Bhabani P. Sinha, On the distribution of runs of ones in binary strings, Computers & Mathematics with Applications, Vol. 58, No. 9 (2009), pp. 1816-1829.
- Lin Weng and Don Zagier, Higher-rank zeta functions and SLn-zeta functions for curves, PNAS 117 (12), 2020.
- Index entries for linear recurrences with constant coefficients, signature (4,-4).
Programs
-
GAP
a:=[2,5];; for n in [3..40] do a[n]:=4*a[n-1]-4*a[n-2]; od; Concatenation([1],a); # Muniru A Asiru, Oct 16 2018
-
Haskell
a045623 n = a045623_list !! n a045623_list = tail $ f a011782_list [] where f (u:us) vs = sum (zipWith (*) vs $ reverse ws) : f us ws where ws = u : vs -- Reinhard Zumkeller, Jul 21 2013
-
Maple
seq(ceil(1/4*2^n*(n+3)),n=0..50);
-
Mathematica
Table[If[n==0, 1, 2^(n-2)(n+3)], {n, 0, 29}] (* Robert G. Wilson v, Jun 27 2005 *) CoefficientList[Series[(1 -2x +x^2)/(1-2x)^2, {x, 0, 30}], x] (* or *) LinearRecurrence[{4, -4}, {1, 2, 5}, 31] (* Robert G. Wilson v, Feb 18 2018 *)
-
Maxima
a(n):=sum(((2*m+2)*n-2*m^2+1)*binomial(2*n+2,2*m+1),m,0,n)/((4*n+2)*2^n); /* Vladimir Kruchinin, Nov 01 2020 */
-
PARI
a(n)=if(n<1,n==0,(n+3)*2^(n-2))
Formula
Sum_{k = 0..n} (k+2)*binomial(n,k) gives the sequence but with a different offset: 2, 5, 12, 28, 64, 144, 320, 704, 1536, ... - N. J. A. Sloane, Jan 30 2008 - formula corrected by Robert G. Wilson v, Feb 26 2018
Binomial transform of 1,1,2,2,3,3,... . - Paul Barry, Mar 06 2003
a(0)=1, a(n) = (n+3)*2^(n-2), n >= 1.
a(n+1) = 2*a(n) + 2^(n-1), n>0.
G.f.: (1-x)^2/(1-2*x)^2. - Detlef Pauly (dettodet(AT)yahoo.de), Mar 03 2003
G.f.: 1/(1-x-x^2-x^3-...)^2. - Jon Perry, Jul 04 2004
a(n) = Sum_{0 <= j <= k <= n} binomial(n, j+k). - Benoit Cloitre, Oct 14 2004
a(n) = Sum_{k=0..n} C(n, k)*floor((k+2)/2). - Paul Barry, Mar 06 2003
a(n+1) - 2*a(n) = A131577(n). - Paul Curtz, May 18 2008
G.f.: 1/(1-x) + Q(0)*x/(1-x)^3, where Q(k)= 1 + (k+1)*x/(1 - x - x*(1-x)/(x + (k+1)*(1-x)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 25 2013
a(n) = Sum_{k=0..n} (k+1)*C(n-1,n-k). - Peter Luschny, Apr 20 2015
a(n) = Sum_{m=0..n}((2*m+2)*n-2*m^2+1)*C(2*n+2,2*m+1)/((4*n+2)*2^n). - Vladimir Kruchinin, Nov 01 2020
E.g.f.: (1 + exp(2*x)*(3 + 2*x))/4. - Stefano Spezia, Dec 19 2021
From Amiram Eldar, Jan 05 2022: (Start)
Sum_{n>=0} 1/a(n) = 32*log(2) - 61/3.
Sum_{n>=0} (-1)^n/a(n) = 32*log(3/2) - 37/3. (End)
Comments