Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #9 Feb 17 2015 20:29:17
%S 0,1,2,11,12,21,102,111,112,121,202,211,1012,1021,1102,1111,1112,1121,
%T 1202,1211,2012,2021,2102,2111,10112,10121,10202,10211,11012,11021,
%U 11102,11111,11112,11121,11202,11211,12012,12021,12102,12111,20112
%N Another lazy binary representation of n: similar to A089591 except that the single carry is performed before the increment instead of after.
%F 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 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_, Mar 11 2007
%K nonn,easy,base
%O 0,3
%A _Jeff Erickson_, Dec 31 2003
%E More terms from _R. J. Mathar_, Mar 11 2007