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.

A103863 Hamming distance between n and A102370(n) (in binary).

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 1, 2, 1, 3, 3, 4, 0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 1, 3, 2, 4, 4, 5, 0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 1, 2, 1, 3, 3, 4, 0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 2, 4, 3, 5, 5, 6, 0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 1, 2, 1, 3, 3, 4, 0, 1, 1, 2, 0, 2, 2, 3, 0, 1, 1, 3, 2, 4, 4, 5, 0, 1, 1, 2, 0, 2, 2, 3, 0
Offset: 0

Views

Author

Philippe Deléham, Mar 31 2005

Keywords

Comments

The Hamming distance between two strings of the same length is the number of places where they differ. - Robert G. Wilson v, Apr 12 2005

References

  • F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier/North Holland, 1978, p. 8.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[ Log[2, n + 1] + 2]]}, While[ k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; hammingdistance[n_] := Count[ IntegerDigits[ BitXor[n, f[n] + n], 2], 1]; Table[ hammingdistance[n], {n, 0, 104}] (* Robert G. Wilson v, Apr 12 2005 *)

Formula

a(A104235(n)) = 0.

Extensions

More terms from Robert G. Wilson v, Apr 12 2005