%I M0900 #65 Dec 07 2022 09:46:35
%S 0,1,2,3,10,11,12,13,20,21,22,23,30,31,32,33,100,101,102,103,110,111,
%T 112,113,120,121,122,123,130,131,132,133,200,201,202,203,210,211,212,
%U 213,220,221,222,223,230,231,232,233,300,301,302,303,310,311,312,313,320,321,322,323,330,331,332,333
%N Numbers in base 4.
%C Nonnegative integers with no decimal digit > 3. Thus nonnegative integers in base 10 whose tripling (trebling) by normal addition or multiplication requires no carry operation. - _Rick L. Shepherd_, Jun 25 2009
%C Interpreted in base 10: a(x)+a(y) = a(z) => x+y = z. The converse is not true in general. - _Karol Bacik_, Sep 27 2012
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Nathaniel Johnston, <a href="/A007090/b007090.txt">Table of n, a(n) for n = 0..10000</a>
%H R. G. Wilson, V, <a href="/A007088/a007088.pdf">Letter to N. J. A. Sloane, Sep. 1992</a>
%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%F a(n) = Sum_{d(i)*10^i: i=0, 1, ..., m}, where Sum_{d(i)*4^i: i=0, 1, ..., m} is the base 4 representation of n.
%F a(0) = 0, a(n) = 10*a(n/4) if n==0 (mod 4), a(n) = a(n-1)+1 otherwise. - _Benoit Cloitre_, Dec 22 2002
%p A007090 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,4): return op(convert(l,base,10,10^nops(l))): end: seq(A007090(n),n=0..54); # _Nathaniel Johnston_, May 06 2011
%t Table[ FromDigits[ IntegerDigits[n, 4]], {n, 0, 60}]
%o (PARI) a(n)=if(n<1,0,if(n%4,a(n-1)+1,10*a(n/4)))
%o (PARI) A007090(n)=sum(i=1,#n=digits(n,4),n[i]*10^(#n-i)) \\ _M. F. Hasler_, Jul 25 2015 (Corrected by _Jinyuan Wang_, Oct 02 2019)
%o (PARI) apply( A007090(n)=fromdigits(digits(n,4)), [0..66]) \\ _M. F. Hasler_, Nov 18 2019
%o (Haskell)
%o a007090 0 = 0
%o a007090 n = 10 * a007090 n' + m where (n', m) = divMod n 4
%o -- _Reinhard Zumkeller_, Apr 08 2013, Aug 11 2011
%Y Cf. A007608, A000042, A007088 (base 2), A007089 (base 3), A007091 (base 5), A007092 (base 6), A007093 (base 7), A007094 (base 8), A007095 (base 9), A193890, A107715.
%K nonn,easy,base
%O 0,3
%A _N. J. A. Sloane_, _Robert G. Wilson v_
|