OFFSET
0,3
COMMENTS
Plotting the points of a(n) versus n up to a power of 2 approximates a Sierpinski gasket.
It follows from a(x + 2^k) = a(x) + 2^k (mod 2^(k+1)) that a is a bijection modulo 2^k for all k, as observed by Erling Ellingsen. Therefore, a is injective. Is it a bijection when considered as a function from Z to Z? - David Radcliffe, May 06 2023
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..8192
Fred Lunnon, Sketch of argument that sequence is a permutation of Z, SeqFan mailing list, May 30 2023.
FORMULA
a(n) = n^2 - XOR(n^2, n), where XOR is bitwise.
MATHEMATICA
Table[n^2-BitXor[n^2, n], {n, 0, 60}] (* Harvey P. Dale, Jun 30 2011 *)
PROG
(Haskell)
a174375 n = n ^ 2 - a169810 n -- Reinhard Zumkeller, Dec 27 2012
(PARI) a(n)=n^2 - bitxor(n^2, n) \\ Charles R Greathouse IV, Sep 27 2016
(Python) def a(n): return n * n - ((n * n) ^ n) # David Radcliffe, May 06 2023
CROSSREFS
KEYWORD
AUTHOR
Carl R. White, Mar 17 2010
STATUS
approved