A245321 Sum of digits of n written in fractional base 6/5.
0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 9, 10, 11, 12, 13, 14, 12, 13, 14, 15, 16, 17, 14, 15, 16, 17, 18, 19, 15, 16, 17, 18, 19, 20, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 19, 20, 21, 22, 23, 24, 23, 24, 25, 26, 27, 28, 21, 22, 23, 24, 25, 26, 24, 25
Offset: 0
Examples
In base 6/5 the number 15 is represented by 543 and so a(15) = 5 + 4 + 3 = 12.
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000 (terms 0..1000 from G. C. Greubel)
- Index entries for sequences related to fractional bases.
Programs
-
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 *)
-
PARI
a(n) = if(n == 0, 0, a(n\6 * 5) + n % 6); \\ Amiram Eldar, Jul 31 2025
-
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]]
Comments