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.
%I A107750 #28 Jul 24 2017 07:55:57 %S A107750 0,1,2,3,4,5,7,8,9,11,12,13,15,16,17,19,20,21,23,24,25,27,28,29,31,32, %T A107750 33,35,36,37,39,40,41,43,44,45,47,48,49,51,52,53,55,56,57,59,60,61,63, %U A107750 64,65,67,68,69,71,72,73,75,76,77,79,80,81,83,84,85,87,88,89,91,92,93 %N A107750 If n=0 then 0, else smallest number greater than its predecessor and having either more or fewer zeros in its binary representation. %C A107750 Essentially the complement of A016825 with respect to the nonnegative integers (except for 2). A023416(a(n+1)) <> A023416(a(n)). %H A107750 Reinhard Zumkeller, <a href="/A107750/b107750.txt">Table of n, a(n) for n = 0..10000</a> %H A107750 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A107750 a(n+1) = a(n) + A107751(n). %F A107750 For k >= 0, 0 <= i <= 3*2^k: %F A107750 a(6*2^k + i) = a(3*2^k + i) + 4*2^k, %F A107750 a(9*2^k + i) = a(3*2^k + i) + 8*2^k. %F A107750 a(n) = n - sign(floor(n/3)) + floor( (1/2)*sum_{i=1..n} ( ceiling((i+2)/3) - floor((i+2)/3) ) ). - _Wesley Ivan Hurt_, Jun 16 2014 %F A107750 Conjectures from _Colin Barker_, Jul 24 2017: (Start) %F A107750 G.f.: x*(1+x)*(1+x^2-x^3+x^4) / ((1-x)^2*(1+x+x^2)). %F A107750 a(n) = a(n-1) + a(n-3) - a(n-4) for n>3. %F A107750 (End) %t A107750 Table[n - Sign[Floor[n/3]] + Floor[(1/2) Sum[Ceiling[(i + 2)/3] - Floor[(i + 2)/3], {i, n}]], {n, 0, 50}] (* _Wesley Ivan Hurt_, Jun 16 2014 *) %o A107750 (Haskell) %o A107750 a107750 n = a107750_list !! n %o A107750 a107750_list = 0 : f 0 where %o A107750 f x = y : f y where %o A107750 y = head [z | z <- [x + 1 ..], a023416 z /= a023416 x] %o A107750 -- _Reinhard Zumkeller_, Jul 07 2014 %Y A107750 Cf. A107686, A007088, A023416. %K A107750 nonn %O A107750 0,3 %A A107750 _Reinhard Zumkeller_, May 23 2005