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.
%I A169810 #22 May 07 2023 10:01:59 %S A169810 0,0,6,10,20,28,34,54,72,88,110,114,156,164,202,238,272,304,342,378, %T A169810 388,428,498,518,600,616,702,706,780,852,922,990,1056,1120,1190,1258, %U A169810 1332,1404,1410,1494,1640,1720,1742,1810,1980,1988,2154,2190,2352,2384,2550,2586 %N A169810 a(n) = n XOR n^2. %C A169810 XOR the binary representations of n and n^2. %H A169810 N. J. A. Sloane, <a href="/A169810/b169810.txt">Table of n, a(n) for n = 0..10000</a> %e A169810 a(5) = 28: %e A169810 ..101 <- 5 %e A169810 11001 <- 25 %e A169810 ----- <- XOR %e A169810 11100 -> 28 %p A169810 f:=proc(n) local i,t0,t1,t2,ts,tl,n1,n2; %p A169810 t1:=convert(n,base,2); t2:=convert(n^2,base,2); n1:=nops(t1); n2:=nops(t2); %p A169810 if n1 < n2 then ts:= t1; tl:=t2; else ts:=t2; tl:=t1; fi; %p A169810 t0:=[]; for i from 1 to nops(ts) do t0:=[op(t0), (ts[i] + tl[i]) mod 2 ]; od: %p A169810 for i from nops(ts)+1 to nops(tl) do t0:=[op(t0), tl[i]]; od: %p A169810 add(2^(i-1)*t0[i], i=1..nops(t0)); end; %p A169810 # second Maple program: %p A169810 a:= n-> Bits[Xor](n, n^2): %p A169810 seq(a(n), n=0..100); # _Alois P. Heinz_, Mar 29 2018 %t A169810 a[n_]:=BitXor[n, n^2]; Array[a, 60, 0] (* _Robert G. Wilson v_, Jun 09 2010 *) %o A169810 (Haskell) %o A169810 import Data.Bits (xor) %o A169810 a169810 n = n ^ 2 `xor` n :: Integer %o A169810 -- _Reinhard Zumkeller_, Dec 27 2012 %o A169810 (PARI) A169810(n)=bitxor(n^2,n) \\ _M. F. Hasler_, May 07 2023 %o A169810 (Python) A169810=lambda n:n**2^n # _M. F. Hasler_, May 07 2023 %Y A169810 Suggested by A174375. Cf. A070883, A169811-A169814. %Y A169810 Cf. A007745 (OR), A213541 (AND), A002378. %K A169810 nonn,base %O A169810 0,3 %A A169810 _N. J. A. Sloane_, May 28 2010