OFFSET
0,2
COMMENTS
For n>0, a(n) = sum of n-th row of the triangle in A164874. [Reinhard Zumkeller, Aug 29 2009]
LINKS
Index entries for linear recurrences with constant coefficients, signature (6,-13,12,-4).
FORMULA
a(n) = (2n-1)*2^n+1-n.
G.f.: -x*(2*x^2+x-2) / ((x-1)^2*(2*x-1)^2). - Colin Barker, Sep 14 2014
a(0)=0, a(1)=2, a(2)=11, a(3)=38, a(n)=6*a(n-1)-13*a(n-2)+ 12*a(n-3)- 4*a(n-4). - Harvey P. Dale, May 17 2015. [This is equivalent to the g.f. -x*(2*x^2+x-2) / ((x-1)^2*(2*x-1)^2) given by Colin Barker. - N. J. A. Sloane, May 17 2015]
EXAMPLE
a(4)=109 since the binary sum 11110+11101+11011+10111 is 30+29+27+23.
MAPLE
MATHEMATICA
Table[Total[FromDigits[#, 2]&/@Rest[Permutations[PadRight[{0}, n, 1]]]], {n, 30}] (* or *) LinearRecurrence[{6, -13, 12, -4}, {0, 2, 11, 38}, 30] (* Harvey P. Dale, May 17 2015 *)
PROG
(PARI) concat(0, Vec(-x*(2*x^2+x-2)/((x-1)^2*(2*x-1)^2) + O(x^100))) \\ Colin Barker, Sep 14 2014
(Python)
def A059673(n): return ((n<<1)-1<<n)-n+1 # Chai Wah Wu, Dec 19 2024
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Henry Bottomley, Feb 05 2001
STATUS
approved