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 A059942 #9 Apr 03 2014 03:46:12 %S A059942 1,1,3,2,2,3,7,4,5,4,4,5,4,7,15,8,9,8,9,10,9,8,8,9,10,9,8,9,8,15,31, %T A059942 16,17,16,19,16,17,16,17,18,21,16,17,18,17,16,16,17,18,17,16,21,18,17, %U A059942 16,17,16,19,16,17,16,31,63,32,33,32,35,32,33,32,35,36,33,32,35,32,33,32 %N A059942 A059941 translated from binary to decimal. %H A059942 Reinhard Zumkeller, <a href="/A059942/b059942.txt">Table of n, a(n) for n = 1..10000</a> %F A059942 a(n) =A059943(n)/2 %e A059942 a(35)=19 since A059941(35)=10011. %t A059942 a[n_] := (id = Drop[ IntegerDigits[n+1, 2], 1]+1; an = {}; Do[ PrependTo[an, If[Take[id, k] == Take[id, -k], 1, 0]], {k, 1, Length[id]}]; FromDigits[an, 2]); Table[a[n], {n, 1, 78}](* _Jean-François Alcover_, Nov 21 2011 *) %o A059942 (Haskell) %o A059942 import Data.List (inits, tails) %o A059942 a059942 n = a059942_list !! (n-1) %o A059942 a059942_list = map (foldr (\d v -> v * 2 + d) 0) $ f a030341_tabf where %o A059942 f (xs:xss) %o A059942 | 0 `elem` xs = f xss %o A059942 | otherwise = map fromEnum (zipWith (==) %o A059942 (tail $ inits xs) (reverse $ init $ tails xs)) : f xss %o A059942 -- _Reinhard Zumkeller_, Apr 03 2014 %K A059942 base,nonn %O A059942 1,3 %A A059942 _Henry Bottomley_, Feb 14 2001 %E A059942 Offset fixed by _Reinhard Zumkeller_, Apr 03 2014