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.

Showing 1-3 of 3 results.

A199238 n mod (number of ones in binary representation of n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 04 2011

Keywords

Comments

a(A049445(n)) = 0;
a(n) = n - A161764(n);
a(A199262(n)) = n and a(m) <> n for m < A199262(n).

Crossrefs

Programs

  • Haskell
    a199238 n = a199238_list !! (n-1)
    a199238_list = zipWith mod [1..] $ tail a000120_list
    
  • Mathematica
    Mod[#,DigitCount[#,2,1]]&/@Range[90] (* Harvey P. Dale, Nov 08 2011 *)
  • PARI
    A199238(n)=n%norml2(binary(n))  \\ M. F. Hasler, Oct 09 2012

A161765 a(n) is the smallest multiple of {the number of 1's in the binary representation of n} that is >= n.

Original entry on oeis.org

1, 2, 4, 4, 6, 6, 9, 8, 10, 10, 12, 12, 15, 15, 16, 16, 18, 18, 21, 20, 21, 24, 24, 24, 27, 27, 28, 30, 32, 32, 35, 32, 34, 34, 36, 36, 39, 39, 40, 40, 42, 42, 44, 45, 48, 48, 50, 48, 51, 51, 52, 54, 56, 56, 55, 57, 60, 60, 60, 60, 65, 65, 66, 64, 66, 66, 69, 68, 69, 72, 72, 72
Offset: 1

Views

Author

Leroy Quet, Jun 18 2009

Keywords

Examples

			11 (decimal) in binary is 1011. There are three 1's. Because 12 is the smallest multiple of 3 that is >= 11, then a(11) = 12.
		

Crossrefs

Programs

  • Maple
    a := proc (n) local n2, s, j: n2 := convert(n, base, 2): s := add(n2[i], i = 1 .. nops(n2)): for j while j*s < n do end do: j*s end proc: seq(a(n), n = 1 .. 80); # Emeric Deutsch, Jun 24 2009
  • Mathematica
    Table[d=DigitCount[n,2,1];d*Ceiling[n/d],{n,80}] (* Harvey P. Dale, Aug 23 2013 *)
  • PARI
    a(n) = my(nb = hammingweight(n)); nb*ceil(n/nb); \\ Michel Marcus, Nov 11 2018

Formula

a(n) = A000120(n)*ceiling(n/A000120(n)). - Michel Marcus, Nov 11 2018

Extensions

Extended by Emeric Deutsch, Jun 24 2009

A358139 Numbers k > 0 sorted by k/A000120(k) in increasing order. A000120 is the binary weight of k. If k/A000120(k) yields equal values, the smaller k will appear first.

Original entry on oeis.org

1, 3, 2, 7, 5, 6, 11, 15, 4, 13, 9, 14, 10, 23, 12, 31, 19, 27, 21, 29, 22, 30, 8, 25, 17, 26, 18, 28, 47, 39, 20, 63, 43, 55, 45, 46, 35, 59, 24, 61, 37, 62, 38, 51, 53, 54, 41, 42, 57, 58, 44, 60, 79, 95, 16, 49, 33, 50, 34, 52, 87, 71, 36, 127, 91, 111, 93, 56
Offset: 1

Views

Author

Thomas Scheuerle, Oct 31 2022

Keywords

Comments

A permutation of the positive integers.
This permutation satisfies a weak ordering: If b = a(c*d) and e = a(c) and f = a(d) then b > e and b > f with c,d > 1.

Crossrefs

Programs

  • PARI
    f(x) = x/hammingweight(x);
    cmpb(x, y) = my(hx=f(x), hy=f(y)); if (hx != hy, return(sign(hx-hy))); return(sign(x-y));
    lista(nn) = Vec(vecsort([1..2*nn], cmpb, 1), nn); \\ Michel Marcus, Nov 05 2022

Formula

a(2^n) = 2^(n+1) - 1.
abs(a(n)-n) < n.
Showing 1-3 of 3 results.