OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..6560
EXAMPLE
Since 35_10=38_9, the digits of 35 in base 9 are 3 and 8. 8>4, so it is replaced with (-1). The digits are then 3 and -1, so a(35)=3*9^1+(-1)*9^0=27-1=26.
MAPLE
a:= proc(n) option remember; `if`(n=0, 0,
9*a(iquo(n, 9))+mods(n, 9))
end:
seq(a(n), n=0..100); # Alois P. Heinz, Aug 26 2019
PROG
(PARI) f(x) = if (x > 9/2, -(9-x), x);
a(n) = subst(Pol(apply(x->f(x), digits(n, 9)), 'x), 'x, 9); \\ Michel Marcus, Aug 27 2019
CROSSREFS
KEYWORD
sign,base
AUTHOR
Jackson Haselhorst, Aug 26 2019
STATUS
approved