Displaying 1-7 of 7 results found.
page
1
Sum of digits of (n written in base 9).
+10
27
0, 1, 2, 3, 4, 5, 6, 7, 8, 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, 1, 2, 3, 4, 5, 6, 7, 8, 9
COMMENTS
Also the fixed point of the morphism 0->{0,1,2,3,4,5,6,7,8}, 1->{1,2,3,4,5,6,7,8,9}, 2->{2,3,4,5,6,7,8,9,10}, etc. - Robert G. Wilson v, Jul 27 2006
LINKS
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.
Eric Weisstein's World of Mathematics, Digit Sum.
FORMULA
a(0) = 0, a(9n+i) = a(n) + i for 0 <= i <= 8;
a(n) = n - 8*Sum_{k>=1} floor(n/9^k) = n - 8* A054898(n). (End)
a(0) = 0; a(n) = a(n - 9^floor(log_9(n))) + 1. - Ilya Gutkovskiy, Aug 24 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 9*log(9)/8 (Shallit, 1984). - Amiram Eldar, Jun 03 2021
EXAMPLE
a(20) = 2+2 = 4 because 20 is written as 22 base 9.
It appears that this can be written as a triangle (see the conjecture in the entry A000120):
0;
1,2,3,4,5,6,7,8;
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,...
where the rows converge to A173529. (End)
MATHEMATICA
Table[Plus @@ IntegerDigits[n, 9], {n, 0, 100}] (* or *)
Nest[ Flatten[ #1 /. a_Integer -> Table[a + i, {i, 0, 8}]] &, {0}, 3] (* Robert G. Wilson v, Jul 27 2006 *)
PROG
(PARI) a(n)=if(n<1, 0, if(n%9, a(n-1)+1, a(n/9)))
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
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.
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
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 ..............
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:
MATHEMATICA
Total[IntegerDigits[#, 5]]+1&/@Range[0, 100] (* Harvey P. Dale, Jun 14 2015 *)
PROG
(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)
1+ A053735(n-1), where A053735 is the sum-of-digits function in base 3.
+10
7
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, 3, 4, 5, 4, 5, 6, 5, 6, 7, 4, 5, 6, 5, 6, 7, 6, 7, 8, 5, 6, 7, 6, 7, 8, 7, 8, 9, 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, 3, 4, 5, 4, 5, 6, 5, 6, 7, 4, 5, 6
COMMENTS
A053735 can be obtained as 0 followed by the first 2 terms of this sequence, followed by the first 6 terms, followed by the first 18 terms, ..., followed by the first 2*3^n terms, etc.
Similar observations are possible for: A063787 (base-2 case), and generic comments have been gathered in A173525 (base-5 case).
Fixed point of morphism 1->123, 2->234, 3->345 etc. (start with 1).
EXAMPLE
If written as a triangle, begins:
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,...
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
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
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:
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
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.
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
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
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.
FORMULA
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)));
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
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
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:
MATHEMATICA
Table[Total[IntegerDigits[n-1, 7]]+1, {n, 110}] (* Harvey P. Dale, Apr 01 2018 *)
Search completed in 0.011 seconds
|