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 A104895 #32 Jun 15 2021 01:30:46 %S A104895 0,-1,-2,1,-4,3,2,-3,-8,7,6,-7,4,-5,-6,5,-16,15,14,-15,12,-13,-14,13, %T A104895 8,-9,-10,9,-12,11,10,-11,-32,31,30,-31,28,-29,-30,29,24,-25,-26,25, %U A104895 -28,27,26,-27,16,-17,-18,17,-20,19,18,-19,-24,23,22,-23,20,-21,-22,21,-64,63,62,-63,60,-61,-62,61,56,-57,-58,57,-60,59 %N A104895 a(0)=0; thereafter a(2n) = -2*a(n), a(2n+1) = 2*a(n) - 1. %C A104895 Columns of table in A104894 written in base 10. %C A104895 Conjecture: the positions where 0, 1, 2, 3, ... appear are given by A048724; the positions where -1, -2, -3, ... appear are given by A065621. %H A104895 N. J. A. Sloane, <a href="/A104895/b104895.txt">Table of n, a(n) for n = 0..20000</a> %F A104895 a(0) = 0 and for k>=0, 0<= j <2^k, a(2^k + j) = a(j) + 2^k if a(j)<0, a(2^k + j) = a(j) - 2^k if a(j)>=0. %F A104895 Sum_{0 <= n <= 2^k - 1} a(n) = - 2^(k-1). %F A104895 Sum_{0 <= n <= 2^k - 1} |a(n)| = 4^(k-1). %F A104895 a(n) = -A065620(n). - _M. F. Hasler_, Apr 16 2018 %p A104895 f:=proc(n) option remember; if n=0 then RETURN(0); fi; if n mod 2 = 0 then RETURN(2*f(n/2)); else RETURN(-2*f((n-1)/2)-1); fi; end; %t A104895 a[0] = 0; %t A104895 a[n_]:= a[n]= If[EvenQ[n], 2 a[n/2], -2 a[(n-1)/2] - 1]; %t A104895 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Aug 03 2018 *) %o A104895 (Haskell) %o A104895 import Data.List (transpose) %o A104895 a104895 n = a104895_list !! n %o A104895 a104895_list = 0 : concat (transpose [map (negate . (+ 1)) zs, tail zs]) %o A104895 where zs = map (* 2) a104895_list %o A104895 -- _Reinhard Zumkeller_, Mar 26 2014 %o A104895 (Sage) %o A104895 def a(n): %o A104895 if (n==0): return 0 %o A104895 elif (mod(n,2)==0): return 2*a(n/2) %o A104895 else: return -2*a((n-1)/2) - 1 %o A104895 [a(n) for n in (0..100)] # _G. C. Greubel_, Jun 15 2021 %Y A104895 Cf. A048724, A065621, A104894. %Y A104895 The negative of entry A065620. %K A104895 sign,look,nice %O A104895 0,3 %A A104895 _Philippe Deléham_, Apr 24 2005 %E A104895 Corrected by _N. J. A. Sloane_, Nov 05 2005 %E A104895 Edited by _N. J. A. Sloane_, Apr 25 2018