|
| |
|
|
A053737
|
|
Sum of digits of (n written in base 4).
|
|
12
| |
|
|
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; 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 (reinhard.zumkeller(AT)gmail.com), Mar 26 2008
|
|
|
REFERENCES
| S. Butler and R. L. Graham, Shuffling with ordered cards, arXiv 1003:4422.
|
|
|
LINKS
| Eric Weisstein's World of Mathematics, Digit Sum
|
|
|
FORMULA
| 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). - Benoit Cloitre, Dec 19, 2002
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)}. - From DELEHAM Philippe, Oct 21 2011.
|
|
|
EXAMPLE
| a(20)=1+1+0=2 because 20 is written as 110 base 4.
Contribution from Omar E. Pol (info(AT)polprimos.com), 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)
|
|
|
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)))
|
|
|
CROSSREFS
| Cf. A000120, A007953, A053735.
Cf. A173524. [From Omar E. Pol (info(AT)polprimos.com), Feb 21 2010]
Sequence in context: A007720 A129968 A027615 * A033924 A003315 A194107
Adjacent sequences: A053734 A053735 A053736 * A053738 A053739 A053740
|
|
|
KEYWORD
| base,nonn
|
|
|
AUTHOR
| Henry Bottomley (se16(AT)btinternet.com), Mar 28 2000
|
| |
|
|