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”).
%I #45 Sep 08 2022 08:45:00
%S 0,1,2,3,4,5,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,
%T 10,5,6,7,8,9,10,11,6,7,8,9,10,11,12,1,2,3,4,5,6,7,2,3,4,5,6,7,8,3,4,
%U 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
%N Sum of digits of (n written in base 7).
%C Also the fixed point of the morphism 0->{0,1,2,3,4,5,6}, 1->{1,2,3,4,5,6,7}, 2->{2,3,4,5,6,7,8}, etc. - _Robert G. Wilson v_, Jul 27 2006
%H Indranil Ghosh, <a href="/A053828/b053828.txt">Table of n, a(n) for n = 0..10000</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 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(7n+i) = a(n) + i for 0 <= i <= 6.
%F a(n) = n - 6*(Sum_{k>0} floor(n/7^k)) = n - 6*A054896(n). (End)
%F a(n) = A138530(n,7) for n > 6. - _Reinhard Zumkeller_, Mar 26 2008
%F a(n) = Sum_{k>=0} A031007(n,k). - _Philippe Deléham_, Oct 21 2011
%F a(0) = 0; a(n) = a(n - 7^floor(log_7(n))) + 1. - _Ilya Gutkovskiy_, Aug 24 2019
%F Sum_{n>=1} a(n)/(n*(n+1)) = 7*log(7)/6 (Shallit, 1984). - _Amiram Eldar_, Jun 03 2021
%e a(20) = 2 + 6 = 8 because 20 = 26_7.
%e From _Omar E. Pol_, Feb 21 2010: (Start)
%e It appears that this can be written as a triangle (see the conjecture in the entry A000120):
%e 0,
%e 1,2,3,4,5,6,
%e 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,
%e 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,...
%e where the rows converge to A173527. (End)
%t Table[Plus @@ IntegerDigits[n, 7], {n, 0, 100}] (* or *)
%t Nest[ Flatten[ #1 /. a_Integer -> Table[a + i, {i, 0, 6}]] &, {0}, 4] (* _Robert G. Wilson v_, Jul 27 2006 *)
%o (PARI) a(n)=if(n<1,0,if(n%7,a(n-1)+1,a(n/7)))
%o (PARI) a(n) = my(d=digits(n, 7)); vecsum(d); \\ _Michel Marcus_, Jan 07 2017
%o (Magma) [&+Intseq(n, 7): n in [0..100]]; // _Vincenzo Librandi_, Jan 03 2020
%Y Cf. A000120, A007953, A231676, A231677, A231678, A231679.
%Y Cf. A173527. - _Omar E. Pol_, Feb 21 2010
%K base,nonn
%O 0,3
%A _Henry Bottomley_, Mar 28 2000