A245344 Sum of digits of n written in fractional base 7/3.
0, 1, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 11, 12, 5, 6, 7, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 7, 8, 9, 10, 11, 12, 13, 10, 11, 12, 13, 14, 15, 16, 5, 6, 7, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 11, 12, 13, 14, 15, 16, 17
Offset: 0
Examples
In base 7/3 the number 7 is represented by 30 and so a(7) = 3 + 0 = 3.
Links
Programs
-
Maple
a:= proc(n) `if`(n<1, 0, irem(n, 7, 'q')+a(3*q)) end: seq(a(n), n=0..69); # Alois P. Heinz, May 14 2021
-
Mathematica
a[n_] := a[n] = If[n == 0, 0, a[3 * Floor[n/7]] + Mod[n, 7]]; Array[a, 100, 0] (* Amiram Eldar, Aug 02 2025 *)
-
PARI
a(n) = if(n == 0, 0, a(n\7 * 3) + n % 7); \\ Amiram Eldar, Aug 02 2025
-
Sage
# uses [basepqsum from A245355] [basepqsum(7,3,y) for y in [0..200]]
Formula
Extensions
Definition corrected by Georg Fischer, May 14 2021
Comments