OFFSET
0,3
COMMENTS
The base 6/5 expansion is unique and thus the sum of digits function is well-defined.
LINKS
EXAMPLE
In base 6/5 the number 15 is represented by 543 and so a(15) = 5 + 4 + 3 = 12.
MAPLE
a:= proc(n) `if`(n<1, 0, irem(n, 6, 'q')+a(5*q)) end:
seq(a(n), n=0..100); # Alois P. Heinz, Aug 19 2019
MATHEMATICA
a[n_]:= a[n] = If[n==0, 0, a[5*Floor[n/6]] + Mod[n, 6]]; Table[a[n], {n, 0, 70}] (* G. C. Greubel, Aug 19 2019 *)
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(6, 5, i) for i in [0..70]]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tom Edgar, Jul 18 2014
STATUS
approved