login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053735 Sum of digits of (n written in base 3). 111

%I #129 Apr 14 2023 14:14:19

%S 0,1,2,1,2,3,2,3,4,1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,1,2,3,2,3,4,3,

%T 4,5,2,3,4,3,4,5,4,5,6,3,4,5,4,5,6,5,6,7,2,3,4,3,4,5,4,5,6,3,4,5,4,5,

%U 6,5,6,7,4,5,6,5,6,7,6,7,8,1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,3,4,5,4,5,6

%N Sum of digits of (n written in base 3).

%C Also the fixed point of the morphism 0->{0,1,2}, 1->{1,2,3}, 2->{2,3,4}, etc. - _Robert G. Wilson v_, Jul 27 2006

%H T. D. Noe, <a href="/A053735/b053735.txt">Table of n, a(n) for n = 0..10000</a>

%H F. T. Adams-Watters and F. Ruskey, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/Ruskey2/ruskey14.html">Generating Functions for the Digital Sum and Other Digit Counting Sequences</a>, JIS, Vol. 12 (2009), Article 09.5.6.

%H F. M. Dekking, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL26/Dekking/dek25.html">The Thue-Morse Sequence in Base 3/2</a>, J. Int. Seq., Vol. 26 (2023), Article 23.2.3.

%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>.

%H A. V. Kitaev and A. Vartanian, <a href="https://arxiv.org/abs/2304.05671">Algebroid Solutions of the Degenerate Third Painlevé Equation for Vanishing Formal Monodromy Parameter</a>, arXiv:2304.05671 [math.CA], 2023. See pp. 11, 13.

%H Jan-Christoph Puchta and Jürgen Spilker, <a href="http://dx.doi.org/10.1007/s00591-002-0048-4">Altes und Neues zur Quersumme</a>, Math. Semesterber, Vol. 49 (2002), pp. 209-226; <a href="http://www.math.uni-rostock.de/~schlage-puchta/papers/Quersumme.pdf">preprint</a>.

%H Jeffrey O. Shallit, <a href="http://www.jstor.org/stable/2322179">Problem 6450</a>, Advanced Problems, The American Mathematical Monthly, Vol. 91, No. 1 (1984), pp. 59-60; <a href="http://www.jstor.org/stable/2322523">Two series, solution to Problem 6450</a>, ibid., Vol. 92, No. 7 (1985), pp. 513-514.

%H Vladimir Shevelev, <a href="http://dx.doi.org/10.4064/aa126-3-1">Compact integers and factorials</a>, Acta Arith., Vol. 126, No. 3 (2007), pp. 195-236 (cf. p.205).

%H Robert Walker, <a href="http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences">Self Similar Sloth Canon Number Sequences</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DigitSum.html">Digit Sum</a>.

%F From _Benoit Cloitre_, Dec 19 2002: (Start)

%F a(0) = 0, a(3n) = a(n), a(3n + 1) = a(n) + 1, a(3n + 2) = a(n) + 2.

%F a(n) = n - 2*Sum_{k>0} floor(n/3^k) = n - 2*A054861(n). (End)

%F a(n) = A062756(n) + 2*A081603(n). - _Reinhard Zumkeller_, Mar 23 2003

%F G.f.: (Sum_{k >= 0} (x^(3^k) + 2*x^(2*3^k))/(1 + x^(3^k) + x^(2*3^k)))/(1 - x). - _Michael Somos_, Mar 06 2004, corrected by _Franklin T. Adams-Watters_, Nov 03 2005

%F In general, the sum of digits of (n written in base b) has generating function (Sum_{k>=0} (Sum_{0 <= i < b} i*x^(i*b^k))/(Sum_{i=0..b-1} x^(i*b^k)))/(1-x). - _Franklin T. Adams-Watters_, Nov 03 2005

%F First differences of A094345. - _Vladeta Jovovic_, Nov 08 2005

%F a(A062318(n)) = n and a(m) < n for m < A062318(n). - _Reinhard Zumkeller_, Feb 26 2008

%F a(n) = A138530(n,3) for n > 2. - _Reinhard Zumkeller_, Mar 26 2008

%F a(n) <= 2*log_3(n+1). - _Vladimir Shevelev_, Jun 01 2011

%F a(n) = Sum_{k>=0} A030341(n, k). - _Philippe Deléham_, Oct 21 2011

%F G.f. satisfies G(x) = (x+2*x^2)/(1-x^3) + (1+x+x^2)*G(x^3), and has a natural boundary at |x|=1. - _Robert Israel_, Jul 02 2015

%F a(n) = A056239(A006047(n)). - _Antti Karttunen_, Jun 03 2017

%F a(n) = A000120(A289813(n)) + 2*A000120(A289814(n)). - _Antti Karttunen_, Jul 20 2017

%F a(0) = 0; a(n) = a(n - 3^floor(log_3(n))) + 1. - _Ilya Gutkovskiy_, Aug 23 2019

%F Sum_{n>=1} a(n)/(n*(n+1)) = 3*log(3)/2 (Shallit, 1984). - _Amiram Eldar_, Jun 03 2021

%e a(20) = 2 + 0 + 2 = 4 because 20 is written as 202 base 3.

%e From _Omar E. Pol_, Feb 20 2010: (Start)

%e This can be written as a triangle with row lengths A025192 (see the example in the entry A000120):

%e 0,

%e 1,2,

%e 1,2,3,2,3,4,

%e 1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,

%e 1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,3,4,5,4,5,6,5,6,7,2,3,4,3,4,5,4,5,6,3,...

%e where the k-th row contains a(3^k+i) for 0<=i<2*3^k and converges to A173523 as k->infinity. (End) [Changed conjectures to statements in this entry. - _Franklin T. Adams-Watters_, Jul 02 2015]

%e G.f. = x + 2*x^2 + x^3 + 2*x^4 + 3*x^5 + 2*x^6 + 3*x^7 + 4*x^8 + x^9 + 2*x^10 + ...

%p seq(convert(convert(n,base,3),`+`),n=0..100); # _Robert Israel_, Jul 02 2015

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

%t Nest[Join[#, # + 1, # + 2] &, {0}, 6] (* _Robert G. Wilson v_, Jul 27 2006 and modified Jul 27 2014 *)

%o (PARI) {a(n) = if( n<1, 0, a(n\3) + n%3)}; /* _Michael Somos_, Mar 06 2004 */

%o (PARI) A053735(n)=sumdigits(n,3) \\ Requires version >= 2.7. Use sum(i=1,#n=digits(n,3),n[i]) in older versions. - _M. F. Hasler_, Mar 15 2016

%o (Haskell)

%o a053735 = sum . a030341_row

%o -- _Reinhard Zumkeller_, Feb 21 2013, Feb 19 2012

%o (Scheme) (define (A053735 n) (let loop ((n n) (s 0)) (if (zero? n) s (let ((d (mod n 3))) (loop (/ (- n d) 3) (+ s d)))))) ;; For R6RS standard. Use modulo instead of mod in older Schemes like MIT/GNU Scheme. - _Antti Karttunen_, Jun 03 2017

%o (Magma) [&+Intseq(n,3):n in [0..104]]; // _Marius A. Burtea_, Jan 17 2019

%o (MATLAB) m=1; for u=0:104; sol(m)=sum(dec2base(u,3)-'0'); m=m+1;end

%o sol; % _Marius A. Burtea_, Jan 17 2019

%Y Cf. A065363, A007089, A173523. See A134451 for iterations.

%Y Cf. A003137, A138530.

%Y Sum of digits of n written in bases 2-16: A000120, this sequence, A053737, A053824, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.

%Y Related base-3 sequences: A006047, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1), A286585, A286632, A289813, A289814.

%K base,nonn,easy

%O 0,3

%A _Henry Bottomley_, Mar 28 2000

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)