This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A053735 #130 Feb 16 2025 08:32:42 %S A053735 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 A053735 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 A053735 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 A053735 Sum of digits of (n written in base 3). %C A053735 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 A053735 T. D. Noe, <a href="/A053735/b053735.txt">Table of n, a(n) for n = 0..10000</a> %H A053735 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 A053735 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 A053735 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>. %H A053735 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 A053735 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 A053735 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 A053735 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 A053735 Robert Walker, <a href="http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences">Self Similar Sloth Canon Number Sequences</a>. %H A053735 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DigitSum.html">Digit Sum</a>. %F A053735 From _Benoit Cloitre_, Dec 19 2002: (Start) %F A053735 a(0) = 0, a(3n) = a(n), a(3n + 1) = a(n) + 1, a(3n + 2) = a(n) + 2. %F A053735 a(n) = n - 2*Sum_{k>0} floor(n/3^k) = n - 2*A054861(n). (End) %F A053735 a(n) = A062756(n) + 2*A081603(n). - _Reinhard Zumkeller_, Mar 23 2003 %F A053735 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 A053735 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 A053735 First differences of A094345. - _Vladeta Jovovic_, Nov 08 2005 %F A053735 a(A062318(n)) = n and a(m) < n for m < A062318(n). - _Reinhard Zumkeller_, Feb 26 2008 %F A053735 a(n) = A138530(n,3) for n > 2. - _Reinhard Zumkeller_, Mar 26 2008 %F A053735 a(n) <= 2*log_3(n+1). - _Vladimir Shevelev_, Jun 01 2011 %F A053735 a(n) = Sum_{k>=0} A030341(n, k). - _Philippe Deléham_, Oct 21 2011 %F A053735 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 A053735 a(n) = A056239(A006047(n)). - _Antti Karttunen_, Jun 03 2017 %F A053735 a(n) = A000120(A289813(n)) + 2*A000120(A289814(n)). - _Antti Karttunen_, Jul 20 2017 %F A053735 a(0) = 0; a(n) = a(n - 3^floor(log_3(n))) + 1. - _Ilya Gutkovskiy_, Aug 23 2019 %F A053735 Sum_{n>=1} a(n)/(n*(n+1)) = 3*log(3)/2 (Shallit, 1984). - _Amiram Eldar_, Jun 03 2021 %e A053735 a(20) = 2 + 0 + 2 = 4 because 20 is written as 202 base 3. %e A053735 From _Omar E. Pol_, Feb 20 2010: (Start) %e A053735 This can be written as a triangle with row lengths A025192 (see the example in the entry A000120): %e A053735 0, %e A053735 1,2, %e A053735 1,2,3,2,3,4, %e A053735 1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6, %e A053735 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 A053735 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 A053735 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 A053735 seq(convert(convert(n,base,3),`+`),n=0..100); # _Robert Israel_, Jul 02 2015 %t A053735 Table[Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* or *) %t A053735 Nest[Join[#, # + 1, # + 2] &, {0}, 6] (* _Robert G. Wilson v_, Jul 27 2006 and modified Jul 27 2014 *) %o A053735 (PARI) {a(n) = if( n<1, 0, a(n\3) + n%3)}; /* _Michael Somos_, Mar 06 2004 */ %o A053735 (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 A053735 (Haskell) %o A053735 a053735 = sum . a030341_row %o A053735 -- _Reinhard Zumkeller_, Feb 21 2013, Feb 19 2012 %o A053735 (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 A053735 (Magma) [&+Intseq(n,3):n in [0..104]]; // _Marius A. Burtea_, Jan 17 2019 %o A053735 (MATLAB) m=1; for u=0:104; sol(m)=sum(dec2base(u,3)-'0'); m=m+1;end %o A053735 sol; % _Marius A. Burtea_, Jan 17 2019 %Y A053735 Cf. A065363, A007089, A173523. See A134451 for iterations. %Y A053735 Cf. A003137, A138530. %Y A053735 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 A053735 Related base-3 sequences: A006047, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1), A286585, A286632, A289813, A289814. %K A053735 base,nonn,easy %O A053735 0,3 %A A053735 _Henry Bottomley_, Mar 28 2000