%I A089600
%S A089600 0,1,2,11,12,21,102,111,112,121,202,211,1012,1021,1102,1111,1112,1121,
%T A089600 1202,1211,2012,2021,2102,2111,10112,10121,10202,10211,11012,11021,
%U A089600 11102,11111,11112,11121,11202,11211,12012,12021,12102,12111,20112
%N A089600 Another lazy binary representation of n: similar to A089591 except that
the single carry is performed before the increment instead of after.
%F A089600 Let b(n) = A089591(n). Then a(0) = b(0) = 0; b(n) = if n is odd then
b((n-1)/2):1 else a(n/2):0; a(n) = if n is odd then a((n-1)/2):1
else b(n/2-1):2.
%p A089600 A089591 := proc(n) option remember ; local nhalf ; if n <= 1 then RETURN(n)
; else nhalf := floor(n/2) ; if n mod 2 = 1 then RETURN(10*A089591(nhalf)
+1) ; else RETURN(10*(A089591(nhalf-1)+1)) ; fi ; fi ; end: A089600
:= proc(n) option remember ; local nhalf ; nhalf := floor(n/2) ;
if n <= 1 then RETURN(n) ; else if n mod 2 = 1 then RETURN(10*A089600(nhalf)
+1) ; else RETURN(10*A089591(nhalf-1)+2) ; fi ; fi ; end: for n from
0 to 200 do printf("%d, ",A089600(n)) ; od ; - R. J. Mathar (mathar(AT)strw.leidenuniv.nl),
Mar 11 2007
%Y A089600 Sequence in context: A053880 A063112 A038113 this_sequence A114034 A136970
A136967
%Y A089600 Adjacent sequences: A089597 A089598 A089599 this_sequence A089601 A089602
A089603
%K A089600 nonn,easy
%O A089600 0,3
%A A089600 Jeff Erickson (jeffe(AT)cs.uiuc.edu), Dec 31 2003
%E A089600 More terms from R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Mar 11 2007
|