cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A284799 Write in base k, complement, reverse. Case k = 4.

This page as a plain text file.
%I A284799 #17 Feb 05 2022 02:15:19
%S A284799 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,
%T A284799 6,50,34,18,2,61,45,29,13,57,41,25,9,53,37,21,5,49,33,17,1,60,44,28,
%U A284799 12,56,40,24,8,52,36,20,4,48,32,16,0,254,190,126,62,238,174
%N A284799 Write in base k, complement, reverse. Case k = 4.
%H A284799 Robert Israel, <a href="/A284799/b284799.txt">Table of n, a(n) for n = 0..10000</a>
%F A284799 a(a(n))=n unless n == 3 (mod 4). - _Robert Israel_, Apr 01 2020
%e A284799 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.
%p A284799 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;
%p A284799 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);
%t A284799 With[{k = 4}, Array[FromDigits[Reverse[k - IntegerDigits[#, k] - 1], k] &, 70, 0]] (* _Michael De Vlieger_, Feb 04 2022 *)
%o A284799 (Python)
%o A284799 from gmpy2 import digits
%o A284799 def A284799(n): return -int((s:=digits(n,4)[::-1]),4)-1+4**len(s) # _Chai Wah Wu_, Feb 04 2022
%Y A284799 Cf. A036044, A267193, A284800.
%K A284799 nonn,base,easy,look
%O A284799 0,1
%A A284799 _Paolo P. Lava_, Apr 03 2017