%I #33 Feb 09 2023 14:20:11
%S 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,
%T 5,5,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,
%U 11,11,11,12,12,12,12,12,12,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16
%N a(n) = Sum_{k>0} floor(n/6^k).
%C Different from the highest power of 6 dividing n! (cf. A054861). - _Hieronymus Fischer_, Aug 14 2007
%C Partial sums of A122841. - _Hieronymus Fischer_, Jun 06 2012
%H Hieronymus Fischer, <a href="/A054895/b054895.txt">Table of n, a(n) for n = 0..10000</a>
%F a(n) = floor(n/6) + floor(n/36) + floor(n/216) + floor(n/1296) + ...
%F a(n) = (n - A053827(n))/5.
%F From _Hieronymus Fischer_, Aug 14 2007: (Start)
%F a(n) = a(floor(n/6)) + floor(n/6).
%F a(6*n) = n + a(n).
%F a(n*6^m) = n*(6^m-1)/5 + a(n).
%F a(k*6^m) = k*(6^m-1)/5, for 0 <= k < 6, m >= 0.
%F Asymptotic behavior:
%F a(n) = (n/5) + O(log(n)).
%F a(n+1) - a(n) = O(log(n)); this follows from the inequalities below.
%F a(n) <= (n-1)/5; equality holds for powers of 6.
%F a(n) >= ((n-5)/5) - floor(log_6(n)); equality holds for n=6^m-1, m>0.
%F lim inf (n/5 - a(n)) = 1/5, for n-->oo.
%F lim sup (n/5 - log_6(n) - a(n)) = 0, for n-->oo.
%F lim sup (a(n+1) - a(n) - log_6(n)) = 0, for n-->oo.
%F G.f.: (1/(1-x))*Sum_{k > 0} x^(6^k)/(1-x^(6^k)). (End)
%e a(10^0) = 0.
%e a(10^1) = 1.
%e a(10^2) = 18.
%e a(10^3) = 197.
%e a(10^4) = 1997.
%e a(10^5) = 19996.
%e a(10^6) = 199995.
%e a(10^7) = 1999995.
%e a(10^8) = 19999994.
%e a(10^9) = 199999993.
%t Table[t=0; p=6; While[s=Floor[n/p]; t=t+s; s>0, p *= 6]; t, {n,0,100}]
%o (Haskell)
%o a054895 n = a054895_list !! n
%o a054895_list = scanl (+) 0 a122841_list
%o -- _Reinhard Zumkeller_, Nov 10 2013
%o (Magma)
%o function A054895(n)
%o if n eq 0 then return n;
%o else return A054895(Floor(n/6)) + Floor(n/6);
%o end if; return A054895;
%o end function;
%o [A054895(n): n in [0..100]]; // _G. C. Greubel_, Feb 09 2023
%o (SageMath)
%o def A054895(n):
%o if (n==0): return 0
%o else: return A054895(n//6) + (n//6)
%o [A054895(n) for n in range(104)] # _G. C. Greubel_, Feb 09 2023
%Y Cf. A011371 and A054861 for analogs involving powers of 2 and 3.
%Y Cf. A053827, A054861, A054899, A067080, A098844, A122841, A132030.
%K nonn
%O 0,13
%A _Henry Bottomley_, May 23 2000
%E An incorrect formula was deleted by _N. J. A. Sloane_, Nov 18 2008
%E Examples added by _Hieronymus Fischer_, Jun 06 2012
|