The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A160825 a(1) = 1. For n >=2, a(n) = the smallest integer > a(n-1) such that both a(n) and a(n)-a(n-1) have the same number of (non-leading) 0's when they are represented in binary. 2

%I

%S 1,6,7,13,22,26,44,52,88,104,176,208,352,416,704,832,1408,1664,2816,

%T 3328,5632,6656,11264,13312,22528,26624,45056,53248,90112,106496,

%U 180224,212992,360448,425984,720896,851968,1441792,1703936,2883584,3407872,5767168

%N a(1) = 1. For n >=2, a(n) = the smallest integer > a(n-1) such that both a(n) and a(n)-a(n-1) have the same number of (non-leading) 0's when they are represented in binary.

%C For n >= 2, a(n) - a(n-1) = A160824(n).

%C It is easy to see that: If a(n) = 2^m - 2^k with k>0, then a(n+1) = 2^m - 2^(k-1); in all other cases 2^k|a(n) implies 2^k|a(n+1). From this one concludes that a(n) = 11*2^k implies a(n+1) = 13*2^k and a(n) = 13*2^k implies a(n+1) = 11*2^(k+1). - _Hagen von Eitzen_, Jun 01 2009

%H Colin Barker, <a href="/A160825/b160825.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(2*n) = 13*2^(n-2) and a(2*n+1) = 11*2^(n-1) if n >= 2. - _Hagen von Eitzen_, Jun 01 2009

%F From _Colin Barker_, Dec 29 2016: (Start)

%F a(n) = 2*a(n-2) for n>5.

%F G.f.: x*(1 + 6*x + 5*x^2 + x^3 + 8*x^4) / (1 - 2*x^2).

%F (End)

%t Join[{1, 6, 7}, LinearRecurrence[{0, 2}, {13, 22}, 38]] (* _Jean-François Alcover_, Sep 22 2017 *)

%o (PARI) zeros(n) = if(n<2,0,zeros(floor(n/2))+1-(n%2))

%o n=1;L=1;while(n<=100, print1(L,","); step = bitand(L,-L); if(step>1 && bitand(L+step,L+step-1)==0, step/=2); ofs=step; while(zeros(ofs)!=zeros(L+ofs), ofs += step);n+=1;L+=ofs;) \\ _Hagen von Eitzen_, Jun 01 2009

%o (PARI) Vec(x*(1 + 6*x + 5*x^2 + x^3 + 8*x^4) / (1 - 2*x^2) + O(x^50)) \\ _Colin Barker_, Dec 29 2016

%Y Cf. A160824.

%K nonn,base,easy

%O 1,2

%A _Leroy Quet_, May 27 2009

%E More terms from _Hagen von Eitzen_, Jun 01 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 31 06:22 EDT 2020. Contains 334747 sequences. (Running on oeis4.)