OFFSET
0,2
COMMENTS
Binomial transform of 1 followed by the odd numbers (2n-1+2*0^n, or abs(A060747)). Binomial transform is A084643. - Paul Barry, Jun 09 2003
Total number of bits of all binary numbers less than 2^n (see example).
Total number of zero bits of all binary numbers less than 2^(n+1). - Olivier Gérard, Feb 25 2014.
Number of permutations of length n>0 avoiding the partially ordered pattern (POP) {1>2, 4>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first element is larger than the second element, and the fourth element is larger than the third element. - Sergey Kitaev, Dec 08 2020
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Alice L. L. Gao, Sergey Kitaev, On partially ordered patterns of length 4 and 5 in permutations, arXiv:1903.08946 [math.CO], 2019.
Alice L. L. Gao, Sergey Kitaev, On partially ordered patterns of length 4 and 5 in permutations, The Electronic Journal of Combinatorics 26(3) (2019), P3.26.
Index entries for linear recurrences with constant coefficients, signature (5,-8,4).
FORMULA
a(n) - 1 = Sum_{i=0..n-1} (n-i) * 2^(n-i-1) = n*2^(n-1) + (n-1)*2^(n-2) + (n-2)*2^(n-3) + ... + 1*(2^0). - Matthew Erbst (matt(AT)erbst.org), Apr 19 2006
a(n) = 2 * A002064(n-1), n >= 1. - Omar E. Pol, Sep 30 2012
a(n) = a(n-1) + (2^n - 2^(n-1)) * n = a(n-1) + n*2^(n-1). - Olivier Gérard, Feb 25 2014
G.f.: -(4*x^2-3*x+1) / ((x-1)*(2*x-1)^2). - Colin Barker, Jun 29 2014
EXAMPLE
a(1)=2 : 0 1
a(2)=6 : 0 1 10 11
a(3)=18 : 0 1 10 11 100 101 110 111
a(4)=50 : 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111
...
MAPLE
MATHEMATICA
f[n_]:=(n-1)2^n+2; Array[f, 29, 0] (* Robert G. Wilson v, Jun 29 2014 *)
LinearRecurrence[{5, -8, 4}, {1, 2, 6}, 30] (* Harvey P. Dale, Jan 23 2015 *)
PROG
(Magma) [(n-1)*2^n + 2: n in [0..30]]; // Vincenzo Librandi, Sep 25 2011
(PARI) a(n) = (n-1)*2^n + 2; \\ Joerg Arndt, Feb 25 2014
(PARI) Vec(-(4*x^2-3*x+1)/((x-1)*(2*x-1)^2) + O(x^100)) \\ Colin Barker, Jun 29 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Better description from John W. Layman, May 04 1999
STATUS
approved