OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
a(9) = 25 because 9 in base 3 is 100, its complement in base 3 is 122 and the digit reverse is 221 that is 25 in base 10.
MAPLE
P:=proc(q, h) local a, b, k, n; print(h-1); for n from 1 to q do a:=convert(n, base, h); b:=0;
for k from 1 to nops(a) do a[k]:=h-1-a[k]; b:=h*b+a[k]; od; print(b); od; end: P(10^2, 3);
MATHEMATICA
Table[FromDigits[Reverse[2-IntegerDigits[n, 3]], 3], {n, 0, 70}] (* Harvey P. Dale, Sep 08 2019 *)
PROG
(Python)
from gmpy2 import digits
def A284797(n): return -int((s:=digits(n, 3)[::-1]), 3)-1+3**len(s) # Chai Wah Wu, Feb 04 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Apr 03 2017
STATUS
approved