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.

A235602 a(n) = n/wt(n) if wt(n) divides n, otherwise a(n) = n, where wt(n) is the binary weight of n (A000120).

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 6, 13, 14, 15, 16, 17, 9, 19, 10, 7, 22, 23, 12, 25, 26, 27, 28, 29, 30, 31, 32, 33, 17, 35, 18, 37, 38, 39, 20, 41, 14, 43, 44, 45, 46, 47, 24, 49, 50, 51, 52, 53, 54, 11, 56, 57, 58, 59, 15, 61, 62, 63, 64, 65, 33, 67, 34, 23, 70, 71, 36, 73, 74, 75, 76, 77, 78, 79, 40, 27, 82
Offset: 1

Views

Author

N. J. A. Sloane, Jan 18 2014

Keywords

Crossrefs

Programs

  • Mathematica
    bw[n_]:=Module[{w=DigitCount[n,2,1]},If[Divisible[n,w],n/w,n]]; Array[ bw,90] (* Harvey P. Dale, Nov 06 2016 *)
  • PARI
    a(n) = my(s=hammingweight(n)); if (n % s, n, n/s); \\ Michel Marcus, Jul 15 2021

Formula

From Amiram Eldar, Aug 04 2025: (Start)
a(n) = n if and only if n is in A065878 or A000079.
a(n) < n if and only if n is in A049445 but not in A000079. (End)