OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
a(a(n))=n unless n == 3 (mod 4). - Robert Israel, Apr 01 2020
EXAMPLE
a(16) = 62 because 16 in base 4 is 100, its complement in base 4 is 233 and the digit reverse is 332 that is 64 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, 4);
MATHEMATICA
With[{k = 4}, Array[FromDigits[Reverse[k - IntegerDigits[#, k] - 1], k] &, 70, 0]] (* Michael De Vlieger, Feb 04 2022 *)
PROG
(Python)
from gmpy2 import digits
def A284799(n): return -int((s:=digits(n, 4)[::-1]), 4)-1+4**len(s) # Chai Wah Wu, Feb 04 2022
CROSSREFS
KEYWORD
AUTHOR
Paolo P. Lava, Apr 03 2017
STATUS
approved