login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A284807
Write in base k, complement, reverse. Case k = 8.
2
7, 6, 5, 4, 3, 2, 1, 0, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 59, 51, 43, 35, 27, 19, 11, 3, 58, 50, 42, 34, 26, 18, 10, 2, 57, 49, 41, 33, 25, 17, 9, 1, 56, 48, 40, 32, 24, 16, 8, 0, 510, 446, 382, 318, 254
OFFSET
0,1
LINKS
EXAMPLE
a(16) = 61 because 16 in base 8 is 20, its complement in base 8 is 57 and the digit reverse is 75 that is 61 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, 8);
MATHEMATICA
With[{k = 8}, Array[FromDigits[Reverse[k - IntegerDigits[#, k] - 1], k] &, 69, 0]] (* Michael De Vlieger, Feb 04 2022 *)
PROG
(Python)
def A284807(n): return -int((s:=oct(n)[-1:1:-1]), 8)-1+8**len(s) # Chai Wah Wu, Feb 04 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Apr 03 2017
EXTENSIONS
Offset corrected by Chai Wah Wu, Feb 04 2022
STATUS
approved