login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053737 Sum of digits of (n written in base 4). 41
0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 3, 4, 5, 6, 4, 5, 6, 7, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Also the fixed point of the morphism 0->{0,1,2,3}, 1->{1,2,3,4}, 2->{2,3,4,5}, etc. - Robert G. Wilson v, Jul 27 2006

a(n) = A138530(n,4) for n > 3. - Reinhard Zumkeller, Mar 26 2008

LINKS

Donovan Johnson, Table of n, a(n) for n = 0..10000

F. T. Adams-Waters, F. Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS 12 (2009) 09.5.6

S. Butler and R. L. Graham, Shuffling with ordered cards, arXiv 1003:4422 [math.CO], 2010.

Robert Walker, Self Similar Sloth Canon Number Sequences

Eric Weisstein's World of Mathematics, Digit Sum

FORMULA

From Benoit Cloitre, Dec 19 2002: (Start)

a(0) = 0, a(4n+i) = a(n)+i, 0 <= i <= 3.

a(n) = n - 3*Sum_{k>0} floor(n/4^k) = n - 3*A054893(n). (End)

G.f.: (Sum_{k>=0} (x^(4^k) + 2*x^(2*4^k) + 3*x^(3*4^k))/(1 + x^(4^k) + x^(2*4^k) + x^(3*4^k))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005

a(n) = Sum_{k>=0} A030386(n,k). - Philippe Deléham, Oct 21 2011

a(n) = A007953(A007090(n)). - Reinhard Zumkeller, Mar 19 2015

a(0) = 0; a(n) = a(n - 4^floor(log_4(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019

EXAMPLE

a(20) = 1+1+0 = 2 because 20 is written as 110 base 4.

From Omar E. Pol, Feb 21 2010: (Start)

This can be written as a triangle (cf. A000120):

0,

1,2,3,

1,2,3,4,2,3,4,5,3,4,5,6,

1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,5,6,7,5,6,7,8,6,7,8,9,

1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,...

where the rows converge to A173524.

(End)

MAPLE

A053737 := proc(n)

    add(d, d=convert(n, base, 4)) ;

end proc: # R. J. Mathar, Oct 31 2012

MATHEMATICA

Table[Plus @@ IntegerDigits[n, 4], {n, 0, 100}] (* or *)

Nest[ Flatten[ #1 /. a_Integer -> {a, a+1, a+2, a+3}] &, {0}, 4] (* Robert G. Wilson v, Jul 27 2006 *)

PROG

(PARI) a(n)=if(n<1, 0, if(n%4, a(n-1)+1, a(n/4)))

(PARI) a(n) = sumdigits(n, 4); \\ Michel Marcus, Aug 24 2019

(Haskell)

a053737 n = if n == 0 then 0 else a053737 m + r where (m, r) = divMod n 4

-- Reinhard Zumkeller, Mar 19 2015

(MAGMA) [&+Intseq(n, 4):n in [0..104]]; // Marius A. Burtea, Jan 17 2019

(MATLAB) for u=0:104; sol(u+1)=sum(dec2base(u, 4)-'0'); end

sol % Marius A. Burtea, Jan 17 2019

CROSSREFS

Cf. A000120, A007953, A053735, A231664-A231667.

Cf. A173524. - Omar E. Pol, Feb 21 2010

Related base-4 sequences:  A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1).

Cf. A007090, A239690.

Sequence in context: A007720 A129968 A027615 * A033924 A276328 A276332

Adjacent sequences:  A053734 A053735 A053736 * A053738 A053739 A053740

KEYWORD

base,nonn,easy

AUTHOR

Henry Bottomley, Mar 28 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 23 06:58 EDT 2019. Contains 328335 sequences. (Running on oeis4.)