A276328 Digit sum when n is expressed in greedy A001563-base (A276326).
0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10, 8, 9, 5, 6, 7, 8, 6, 7, 1
Offset: 0
Examples
For n=1, the largest term of A001563 <= 1 is A001563(1) = 1, thus a(1) = 1. For n=2, the largest term of A001563 <= 2 is A001563(1) = 1, thus a(2) = 1 + a(2-1) = 2. For n=18, the largest term of A001563 <= 18 is A001563(3) = 18, thus a(18) = 1. For n=20, the largest term of A001563 <= 20 is A001563(3) = 18, thus a(20) = 1 + a(20-18) = 3. For n=36, the largest term of A001563 <= 36 is A001563(3) = 18, thus a(36) = 1 + a(18) = 2.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..4320
Crossrefs
Programs
-
Mathematica
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]]; {0}~Join~Table[Total@ f@ n, {n, 120}] (* Michael De Vlieger, Aug 31 2016 *)
Comments