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-2 of 2 results.

A086342 Smallest number of 1's in binary expansion of any positive multiple of n.

Original entry on oeis.org

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

Views

Author

Sean A. Irvine, Sep 02 2003

Keywords

Comments

If n is a power of 2 then a(n)=1. All other positive n have a(n)>1. a(n)=2 precisely in cases where some multiple of n is a factor of 2^q+1 for some q.

Examples

			a(n)=2 for n=53, 59, 61, 67, 81, 97 and 101 because n divides 2^k+1 for k=26, 29, 30, 33, 27, 24 and 50, respectively. - _T. D. Noe_, Jul 22 2008
		

Crossrefs

Cf. A005360 (flimsy numbers), A125121 (sturdy numbers), A143069 (least multiple).

Programs

  • PARI
    a(n)=if(!n, return(0)); n>>=valuation(n,2); my(o=znorder(Mod(2, n)), v1=Set(powers(Mod(2, n), o)), v=v1, s=1); while(!setsearch(v, Mod(0, n)), v=setbinop((x, y)->x+y, v, v1); s++); s \\ Charles R Greathouse IV, Dec 07 2016

Formula

a(2^k-1) = k. - Thomas Dybdahl Ahle, May 01 2013

Extensions

More terms from Robert G. Wilson v, Feb 21 2005
Corrected by T. D. Noe, Jul 22 2008
An incorrect Mathematica program was deleted Aug 01 2008

A143073 Least number k such that the binary expansion of n*k has fewer ones than n, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 27, 0, 0, 3, 3, 0, 41, 5, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 7085, 27, 7, 0, 25, 0, 3, 3, 0, 3, 3, 0, 0, 41, 0, 5, 5, 3, 3, 0, 9, 5, 3, 0, 5, 0, 0, 0, 0, 0, 128207979, 0, 0, 0, 119, 0, 0, 7085, 0, 27, 5, 7, 7, 0, 1657009, 25, 395, 0, 0, 3, 3, 3, 0, 0
Offset: 1

Views

Author

T. D. Noe, Jul 22 2008

Keywords

Comments

a(n)=0 indicates that n is a sturdy number (A125121); that is, no multiple of n has fewer ones than the binary expansion of n. If a(n)>0, n is a flimsy number (A005360). Compare with A143069.
Showing 1-2 of 2 results.