[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a173523 -id:a173523
     Sort: relevance | references | number | modified | created      Format: long | short | data
Sum of digits of (n written in base 3).
+10
114
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, 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, 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
OFFSET
0,3
COMMENTS
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
LINKS
F. T. Adams-Watters and F. Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS, Vol. 12 (2009), Article 09.5.6.
F. M. Dekking, The Thue-Morse Sequence in Base 3/2, J. Int. Seq., Vol. 26 (2023), Article 23.2.3.
A. V. Kitaev and A. Vartanian, Algebroid Solutions of the Degenerate Third Painlevé Equation for Vanishing Formal Monodromy Parameter, arXiv:2304.05671 [math.CA], 2023. See pp. 11, 13.
Jan-Christoph Puchta and Jürgen Spilker, Altes und Neues zur Quersumme, Math. Semesterber, Vol. 49 (2002), pp. 209-226; preprint.
Jeffrey O. Shallit, Problem 6450, Advanced Problems, The American Mathematical Monthly, Vol. 91, No. 1 (1984), pp. 59-60; Two series, solution to Problem 6450, ibid., Vol. 92, No. 7 (1985), pp. 513-514.
Vladimir Shevelev, Compact integers and factorials, Acta Arith., Vol. 126, No. 3 (2007), pp. 195-236 (cf. p.205).
Eric Weisstein's World of Mathematics, Digit Sum.
FORMULA
From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(3n) = a(n), a(3n + 1) = a(n) + 1, a(3n + 2) = a(n) + 2.
a(n) = n - 2*Sum_{k>0} floor(n/3^k) = n - 2*A054861(n). (End)
a(n) = A062756(n) + 2*A081603(n). - Reinhard Zumkeller, Mar 23 2003
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
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
First differences of A094345. - Vladeta Jovovic, Nov 08 2005
a(A062318(n)) = n and a(m) < n for m < A062318(n). - Reinhard Zumkeller, Feb 26 2008
a(n) = A138530(n,3) for n > 2. - Reinhard Zumkeller, Mar 26 2008
a(n) <= 2*log_3(n+1). - Vladimir Shevelev, Jun 01 2011
a(n) = Sum_{k>=0} A030341(n, k). - Philippe Deléham, Oct 21 2011
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
a(n) = A056239(A006047(n)). - Antti Karttunen, Jun 03 2017
a(n) = A000120(A289813(n)) + 2*A000120(A289814(n)). - Antti Karttunen, Jul 20 2017
a(0) = 0; a(n) = a(n - 3^floor(log_3(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 3*log(3)/2 (Shallit, 1984). - Amiram Eldar, Jun 03 2021
EXAMPLE
a(20) = 2 + 0 + 2 = 4 because 20 is written as 202 base 3.
From Omar E. Pol, Feb 20 2010: (Start)
This can be written as a triangle with row lengths A025192 (see the example in the entry A000120):
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,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,...
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]
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 + ...
MAPLE
seq(convert(convert(n, base, 3), `+`), n=0..100); # Robert Israel, Jul 02 2015
MATHEMATICA
Table[Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* or *)
Nest[Join[#, # + 1, # + 2] &, {0}, 6] (* Robert G. Wilson v, Jul 27 2006 and modified Jul 27 2014 *)
PROG
(PARI) {a(n) = if( n<1, 0, a(n\3) + n%3)}; /* Michael Somos, Mar 06 2004 */
(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
(Haskell)
a053735 = sum . a030341_row
-- Reinhard Zumkeller, Feb 21 2013, Feb 19 2012
(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
(Magma) [&+Intseq(n, 3):n in [0..104]]; // Marius A. Burtea, Jan 17 2019
(MATLAB) m=1; for u=0:104; sol(m)=sum(dec2base(u, 3)-'0'); m=m+1; end
sol; % Marius A. Burtea, Jan 17 2019
CROSSREFS
Cf. A065363, A007089, A173523. See A134451 for iterations.
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.
Related base-3 sequences: A006047, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1), A286585, A286632, A289813, A289814.
KEYWORD
base,nonn,easy
AUTHOR
Henry Bottomley, Mar 28 2000
STATUS
approved
a(n) = 1 + A053824(n-1), where A053824 = sum of digits in base 5.
+10
8
1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 8, 9, 10, 11, 12
OFFSET
1,2
COMMENTS
Also: a(n) = A053824(5^k+n-1) in the limit k->infinity, where k plays the role of a row index in A053824. (See the comment by M. F. Hasler for the proof.)
This means: if A053824 is regarded as a triangle then the rows converge to this sequence.
See conjecture in the entry A000120, and the case of base 2 in A063787.
From R. J. Mathar, Dec 09 2010: (Start)
In base b=5, A053824 starts counting up from 1 each time the index wraps around a power of b: A053824(b^k)=1.
Obvious recurrences are A053824(m*b^k+i) = m+A053824(i), 1 <= m < b-1, 0 <= i < b^(k-1).
So A053824 can be decomposed into a triangle T(k,n) = A053824(b^k+n-1), assuming that column indices start at n=1; row lengths are (b-1)*b^k.
There is a self-similarity in these sequences; a sawtooth structure of periodicity b is added algebraically on top of a sawtooth structure of periodicity b^2, on top of a periodicity b^3 etc. This leads to some "fake" finitely periodic substructures in the early parts of each row of T(.,.): often, but not always, a(n+b)=1+a(n). Often, but not always, a(n+b^2)=1+a(n) etc.
The common part of the rows T(.,.) grows with the power of b as shown in the recurrence above, and defines a(n) in the limit of large row indices k. (End)
The two definitions agree because the first 5^r terms in each row correspond to numbers 5^r, 5^r+1,...,5^r+(5^r-1), which are written in base 5 as a leading 1 plus the digits of 0,...,5^r-1. - M. F. Hasler, Dec 09 2010
From Omar E. Pol, Dec 10 2010: (Start)
In the scatter plots of these sequences, the basic structure is an element with b^2 points, where b is the associated base. (Scatter plots are created with the "graph" button of a sequence.) Sketches of these structures look as follows, the horizontal axis a squeezed version of the index n, b consecutive points packed vertically, and the vertical axis a(n):
........................................................
................................................ * .....
............................................... ** .....
..................................... * ...... *** .....
.................................... ** ..... **** .....
.......................... * ...... *** .... ***** .....
......................... ** ..... **** ... ****** .....
............... * ...... *** .... ***** ... ***** ......
.............. ** ..... **** .... **** .... **** .......
.... * ...... *** ..... *** ..... *** ..... *** ........
... ** ...... ** ...... ** ...... ** ...... ** .........
... * ....... * ....... * ....... * ....... * ..........
........................................................
... b=2 ..... b=3 ..... b=4 ..... b=5 ..... b=6 ........
........................................................
............................................. * ........
............................................ ** ........
........................... * ............. *** ........
.......................... ** ............ **** ........
........... *............ *** ........... ***** ........
.......... ** .......... **** .......... ****** ........
......... ***.......... ***** ......... ******* ........
........ **** ........ ****** ........ ******** ........
....... ***** ....... ******* ....... ********* ........
...... ****** ...... ******** ....... ******** .........
..... ******* ...... ******* ........ ******* ..........
..... ****** ....... ****** ......... ****** ...........
..... ***** ........ ***** .......... ***** ............
..... **** ......... **** ........... **** .............
..... *** .......... *** ............ *** ..............
..... ** ........... ** ............. ** ...............
..... * ............ * .............. * ................
........................................................
..... b=7 .......... b=8 ............ b=9 ..............
... A053828 ...... A053829 ........ A053830 ............
... A173527 ...... A173528 ........ A173529 ............(End)
FORMULA
a(n) = A053824(5^k + n - 1) where k >= ceiling(log_5(n/4)). - R. J. Mathar, Dec 09 2010
MAPLE
A053825 := proc(n) add(d, d=convert(n, base, 5)) ; end proc:
A173525 := proc(n) local b, k; b := 5 ; if n < b then n; else k := n/(b-1); k := ceil(log(k)/log(b)) ; A053825(b^k+n-1) ; end if; end proc:
seq(A173525(n), n=1..100) ;
MATHEMATICA
Total[IntegerDigits[#, 5]]+1&/@Range[0, 100] (* Harvey P. Dale, Jun 14 2015 *)
PROG
(PARI) A173525(n)={ my(s=1); n--; until(!n\=5, s+=n%5); s } \\ M. F. Hasler, Dec 09 2010
(PARI) A173525(n)={ my(s=1+(n=divrem(n-1, 5))[2]); while((n=divrem(n[1], 5))[1], s+=n[2]); s+n[2] } \\ M. F. Hasler, Dec 09 2010
(Haskell)
a173525 = (+ 1) . a053824 . (subtract 1) -- Reinhard Zumkeller, Jan 31 2014
KEYWORD
nonn,base,look
AUTHOR
Omar E. Pol, Feb 20 2010
EXTENSIONS
More terms from Vincenzo Librandi, Aug 02 2010
STATUS
approved
a(n) = A053737(4^k+n-1) in the limit k->infinity, where k plays the role of a row index in A053737.
+10
7
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, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10, 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, 4, 5, 6, 7
OFFSET
1,2
COMMENTS
It appears that if A053737 is written as a triangle then the rows are initial segments of the present sequence; see the conjecture in A000120.
The comments in A173525 (base b=5 there) apply here with base b=4. The base b=3 is considered in A173523.
FORMULA
a(n) = A053737(4^k+n-1) where k >= ceiling(log_4(n/3)). [R. J. Mathar, Dec 09 2010]
Conjecture: Fixed point of the morphism 1->{1,2,3,...,b}, 2->{2,3,4,...,b+1}, j->{j,j+1,...,j+b-1} for b=4. [Joerg Arndt, Dec 08 2010]
MAPLE
A053737 := proc(n) add(d, d=convert(n, base, 4)) ; end proc:
A173524 := proc(n) local b; b := 4 ; if n < b then n; else k := n/(b-1); k := ceil(log(k)/log(b)) ; A053737(b^k+n-1) ; end if; end proc:
seq(A173524(n), n=1..100) ; # R. J. Mathar, Dec 09 2010
KEYWORD
nonn
AUTHOR
Omar E. Pol, Feb 20 2010
STATUS
approved
a(n) = 1 + sum of digits of n-1 written in base 8.
+10
7
1, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11, 12, 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14, 8, 9, 10, 11, 12, 13, 14, 15, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 10, 11
OFFSET
1,2
COMMENTS
If A053829 is written as a triangle then the rows converge to this sequence; see the conjecture in A000120.
The sequence is the base b=8 case in a family of 8 sequences for base b=2 (A063787) and bases 3 to 9 (A173523 to A173529). Common aspects (recurrences etc.) of these are documented in A173525.
FORMULA
a(n) = A053829(n-1)+1.
PROG
(Magma) a053829:=func< n | &+Intseq(n, 8) >; a173528:=func< n | a053829(n-1)+1 >; [ a173528(n): n in [1..90] ]; // Klaus Brockhaus, Dec 07 2010
(Sage) A173528 = lambda n: 1+sum((n-1).digits(base=8)) # D. S. McNeil, Dec 07 2010
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Omar E. Pol, Feb 20 2010
EXTENSIONS
More terms from Vincenzo Librandi, Feb 21 2010
Definition and formula added by M. F. Hasler, Dec 06 2010
STATUS
approved
a(n) = 1 + A053830(n-1), where A053830 is the sum of the digits of its argument in base 9.
+10
7
1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 9, 10, 11, 12, 13, 14, 15, 16, 17, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4
OFFSET
1,2
COMMENTS
If A053830 is regarded as a triangle then the rows converge to this sequence.
This is the case b=9 of a non-periodic sequence, with key formulas and definitions provided with b=5 in A173525. Case b=2 is in A063787, and cases b=3 to 8 are in A173523 to A173528.
FORMULA
a(n) = A053830(9^k + n - 1) where k >= ceiling(log_9(n/8)). - R. J. Mathar, Dec 09 2010
MATHEMATICA
Table[1 + Plus@@IntegerDigits[n - 1, 9], {n, 90}] (* Vincenzo Librandi, Jul 01 2019 *)
KEYWORD
nonn,base
AUTHOR
Omar E. Pol, Feb 23 2010
STATUS
approved
a(n) = 1 + A053827(n-1), where A053827 is the sum-of-digits function in base 6.
+10
6
1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 12, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 7, 8, 9, 10
OFFSET
1,2
COMMENTS
If A053827 is regarded as a triangle then the rows converge to this sequence, i.e., a(n) = A053827(6^k+n-1) in the limit k->infinity, where k plays the role of a row index in A053827.
See conjecture in the entry A000120.
This sequence is the base b=6 case equivalent to A063787 (b=2), A173523 (b=3), A173524 (b=4), A173525 (b=5). Generic comments concerning the various bases are in A173525.
LINKS
FORMULA
a(n) = A053827(6^k+n-1) where k >= ceiling(log_6(n/5)). - R. J. Mathar, Dec 09 2010
Conjecture: Fixed point of the morphism 1->{1,2,3,...,b}, 2->{2,3,4,...,b+1},
j->{j,j+1,...,j+b-1} for b=6. - Joerg Arndt, Dec 08 2010
MATHEMATICA
Table[1 + Total[IntegerDigits[n-1, 6]], {n, 1, 110}] (* G. C. Greubel, Jul 02 2019 *)
PROG
(PARI) A053827(n)= if(n<1, 0, if(n%6, a(n-1)+1, a(n/6)));
vector(110, n, 1+A053827(n-1)) \\ G. C. Greubel, Jul 02 2019
KEYWORD
nonn,base
AUTHOR
Omar E. Pol, Feb 20 2010
EXTENSIONS
More terms from Vincenzo Librandi, Aug 02 2010
STATUS
approved
a(n) = 1 + A053828(n-1), where A053828 is the sum of digits in base 7.
+10
6
1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 7, 8, 9, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 7, 8, 9, 10, 11, 12, 13, 8, 9, 10, 11, 12, 13, 14, 3, 4
OFFSET
1,2
COMMENTS
If A053828 is regarded as a triangle then the rows converge to this sequence, i.e., a(n) = A053828(7^k+n-1) in the limit k->infinity, where k plays the role of a row index in A053828.
See conjecture in the entry A000120.
This is the case for base b=7 for the sum of digits. A063787 and A173523 to A173526 deal with the bases 2 to 6. A173525 contains generic remarks concerning these 8 sequences which look in equivalent ways at their sum of digits as a sequence with triangular structure.
FORMULA
a(n) = A053828(7^k+n-1) where k >= ceiling(log_7(n/6)). [R. J. Mathar, Dec 09 2010]
Conjecture: Fixed point of the morphism 1->{1,2,3,...b}, 2->{2,3,4...,b+1}, j->{j,j+1,...,j+b-1} for b=7. [Joerg Arndt, Dec 08 2010]
MAPLE
A053828 := proc(n) add(d, d=convert(n, base, 7)) ; end proc:
A173527 := proc(n) local b; b := 7 ; if n < b then n; else k := n/(b-1); k := ceil(log(k)/log(b)) ; A053828(b^k+n-1) ; end if; end proc:
seq(A173527(n), n=1..100) ; # R. J. Mathar, Dec 09 2010
MATHEMATICA
Table[Total[IntegerDigits[n-1, 7]]+1, {n, 110}] (* Harvey P. Dale, Apr 01 2018 *)
KEYWORD
nonn,base
AUTHOR
Omar E. Pol, Feb 20 2010
EXTENSIONS
More terms from Vincenzo Librandi, Feb 21 2010
STATUS
approved

Search completed in 0.008 seconds