OFFSET
0,3
COMMENTS
The base 5/2 expansion is unique and thus the sum of digits function is well-defined.
LINKS
FORMULA
EXAMPLE
In base 5/2 the number 7 is represented by 22 and so a(7) = 2+2 = 4.
MAPLE
a:= proc(n) `if`(n<1, 0, irem(n, 5, 'q')+a(2*q)) end:
seq(a(n), n=0..81); # Alois P. Heinz, May 14 2021
MATHEMATICA
a[n_] := a[n] = If[n == 0, 0, a[2 * Floor[n/5]] + Mod[n, 5]]; Array[a, 100, 0] (* Amiram Eldar, Jul 30 2025 *)
PROG
(SageMath) # uses [basepqsum from A245355]
[basepqsum(5, 2, y) for y in [0..200]]
(PARI) a(n) = if(n == 0, 0, a(n\5 * 2) + n % 5); \\ Amiram Eldar, Jul 30 2025
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
James Van Alstine, Jul 18 2014
EXTENSIONS
Definition corrected by Georg Fischer, May 14 2021
STATUS
approved
