login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A284799 Write in base k, complement, reverse. Case k = 4. 2
3, 2, 1, 0, 14, 10, 6, 2, 13, 9, 5, 1, 12, 8, 4, 0, 62, 46, 30, 14, 58, 42, 26, 10, 54, 38, 22, 6, 50, 34, 18, 2, 61, 45, 29, 13, 57, 41, 25, 9, 53, 37, 21, 5, 49, 33, 17, 1, 60, 44, 28, 12, 56, 40, 24, 8, 52, 36, 20, 4, 48, 32, 16, 0, 254, 190, 126, 62, 238, 174 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
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
Sequence in context: A085771 A253286 A344499 * A111106 A370419 A321964
KEYWORD
nonn,base,easy,look
AUTHOR
Paolo P. Lava, Apr 03 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)