OFFSET
0,3
COMMENTS
The base 8/5 expansion is unique and thus the sum of digits function is well-defined.
EXAMPLE
In base 8/5 the number 20 is represented by 524 and so a(20) = 5 + 2 + 4 = 11.
PROG
(Sage)
def basepqsum(p, q, n):
L = [n]
i = 1
while L[i-1]>=p:
x=L[i-1]
L[i-1]=x.mod(p)
L.append(q*(x//p))
i+=1
return sum(L)
[basepqsum(8, 5, i) for i in [0..100]]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tom Edgar, Jul 18 2014
STATUS
approved