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.

A073139 Difference between the largest and smallest number having in binary representation the same number of 0's and 1's as n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 3, 3, 3, 3, 3, 0, 0, 7, 7, 9, 7, 9, 9, 7, 7, 9, 9, 7, 9, 7, 7, 0, 0, 15, 15, 21, 15, 21, 21, 21, 15, 21, 21, 21, 21, 21, 21, 15, 15, 21, 21, 21, 21, 21, 21, 15, 21, 21, 21, 15, 21, 15, 15, 0, 0, 31, 31, 45, 31, 45, 45, 49, 31, 45, 45, 49, 45, 49, 49, 45, 31
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 16 2002

Keywords

Comments

a(n) = A073138(n) - A073137(n).

Crossrefs

Programs

  • Mathematica
    d[n_]:=Module[{idn2=IntegerDigits[n,2]},FromDigits[Sort[idn2,#1>#2&],2]- FromDigits[ RotateRight[Sort[idn2],1],2]]; Array[d,90,0] (* Harvey P. Dale, Oct 22 2011 *)