cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059673 Sum of binary numbers with n 1's and one (non-leading) 0.

This page as a plain text file.
%I A059673 #28 Dec 20 2024 02:44:44
%S A059673 0,2,11,38,109,284,699,1658,3833,8696,19447,42998,94197,204788,442355,
%T A059673 950258,2031601,4325360,9175023,19398638,40894445,85983212,180355051,
%U A059673 377487338,788529129,1644167144,3422552039,7113539558,14763950053
%N A059673 Sum of binary numbers with n 1's and one (non-leading) 0.
%C A059673 For n>0, a(n) = sum of n-th row of the triangle in A164874. [_Reinhard Zumkeller_, Aug 29 2009]
%H A059673 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (6,-13,12,-4).
%F A059673 a(n) = (2n-1)*2^n+1-n.
%F A059673 G.f.: -x*(2*x^2+x-2) / ((x-1)^2*(2*x-1)^2). - _Colin Barker_, Sep 14 2014
%F A059673 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]
%e A059673 a(4)=109 since the binary sum 11110+11101+11011+10111 is 30+29+27+23.
%p A059673 A059673:=n->(2*n-1)*2^n+1-n: seq(A059673(n), n=0..50); # _Wesley Ivan Hurt_, Apr 24 2017
%t A059673 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 *)
%o A059673 (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
%o A059673 (Python)
%o A059673 def A059673(n): return ((n<<1)-1<<n)-n+1 # _Chai Wah Wu_, Dec 19 2024
%Y A059673 Cf. A030130, A164874. [From _Reinhard Zumkeller_, Aug 29 2009]
%K A059673 easy,nonn,base
%O A059673 0,2
%A A059673 _Henry Bottomley_, Feb 05 2001