login
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
1, 6, 7, 13, 22, 26, 44, 52, 88, 104, 176, 208, 352, 416, 704, 832, 1408, 1664, 2816, 3328, 5632, 6656, 11264, 13312, 22528, 26624, 45056, 53248, 90112, 106496, 180224, 212992, 360448, 425984, 720896, 851968, 1441792, 1703936, 2883584, 3407872, 5767168
OFFSET
1,2
COMMENTS
For n >= 2, a(n) - a(n-1) = A160824(n).
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
FORMULA
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
From Colin Barker, Dec 29 2016: (Start)
a(n) = 2*a(n-2) for n>5.
G.f.: x*(1 + 6*x + 5*x^2 + x^3 + 8*x^4) / (1 - 2*x^2).
(End)
MATHEMATICA
Join[{1, 6, 7}, LinearRecurrence[{0, 2}, {13, 22}, 38]] (* Jean-François Alcover, Sep 22 2017 *)
PROG
(PARI) zeros(n) = if(n<2, 0, zeros(floor(n/2))+1-(n%2))
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
(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
CROSSREFS
Cf. A160824.
Sequence in context: A041074 A041749 A042723 * A020689 A128844 A128850
KEYWORD
nonn,base,easy
AUTHOR
Leroy Quet, May 27 2009
EXTENSIONS
More terms from Hagen von Eitzen, Jun 01 2009
STATUS
approved