login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sum of digits of n written in fractional base 6/5.
2

%I #27 Aug 08 2023 09:13:04

%S 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,

%T 17,18,19,15,16,17,18,19,20,15,16,17,18,19,20,20,21,22,23,24,25,19,20,

%U 21,22,23,24,23,24,25,26,27,28,21,22,23,24,25,26,24,25

%N Sum of digits of n written in fractional base 6/5.

%C The base 6/5 expansion is unique and thus the sum of digits function is well-defined.

%H G. C. Greubel, <a href="/A245321/b245321.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Ba#base_fractional">Index entries for sequences related to fractional bases</a>

%F a(n) = A007953(A024638(n)).

%e In base 6/5 the number 15 is represented by 543 and so a(15) = 5 + 4 + 3 = 12.

%p a:= proc(n) `if`(n<1, 0, irem(n, 6, 'q')+a(5*q)) end:

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Aug 19 2019

%t 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 *)

%o (Sage)

%o def basepqsum(p,q,n):

%o L=[n]

%o i=1

%o while L[i-1]>=p:

%o x=L[i-1]

%o L[i-1]=x.mod(p)

%o L.append(q*(x//p))

%o i+=1

%o return sum(L)

%o [basepqsum(6,5,i) for i in [0..70]]

%Y Cf. A000120, A007953, A024638, A053827, A244040.

%K nonn,base

%O 0,3

%A _Tom Edgar_, Jul 18 2014