%I #18 Jun 30 2023 00:48:32
%S 1,5,1,6,9,4,18,8,36,16,72,32,144,64,288,128,576,256,1152,512,2304,
%T 1024,4608,2048,9216,4096,18432,8192,36864,16384,73728,32768,147456,
%U 65536,294912,131072,589824,262144,1179648,524288,2359296,1048576,4718592
%N a(1)=1, a(n) = the smallest positive integer such that both a(n) and Sum_{k=1..n} a(k) have the same number of (nonleading) 0's when they are represented in binary.
%C Sum_{k=1..n} a(k) = A160825(n).
%C Consider the related sequence {b(k)}, where b(1) = 1, b(n) = the smallest positive integer such that both b(n) and Sum_{k=1..n} b(k) have the same number of 1's when they are represented in binary. Then b(1) = 1, and b(n) = 2^(n-2), for all n >= 2. (b(n) = A011782(n-1).)
%H G. C. Greubel, <a href="/A160824/b160824.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0, 2).
%F a(2n) = 2^(n-1) and a(2n-1) = 9*2^(n-3) for n >= 3 (cf. formula for A160825). - _Hagen von Eitzen_, Jun 01 2009
%F G.f.: (-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1). - _Alexander R. Povolotsky_, Jun 08 2009
%t CoefficientList[Series[(-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1), {x, 0, 50}], x] (* _G. C. Greubel_, Feb 22 2017 *)
%o (PARI) x='x + O('x^50); Vec((-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1)) \\ _G. C. Greubel_, Feb 22 2017
%Y Cf. A160825.
%K nonn,base
%O 1,2
%A _Leroy Quet_, May 27 2009
%E Extended by _Ray Chandler_, Jun 15 2009
%E Edited by _N. J. A. Sloane_, Jul 31 2009 at the suggestion of _R. J. Mathar_