login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A049445 Numbers n with property that the number of 1's in binary expansion of n (see A000120) divides n. 19
1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 21, 24, 32, 34, 36, 40, 42, 48, 55, 60, 64, 66, 68, 69, 72, 80, 81, 84, 92, 96, 108, 110, 115, 116, 120, 126, 128, 130, 132, 136, 138, 144, 155, 156, 160, 162, 168, 172, 180, 184, 185, 192, 204, 205, 212, 216, 220, 222, 228 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

If instead of base 2 we take base 10, then we have the so-called Harshad or Niven numbers (i.e., positive integers divisible by the sum of their digits; A005349). - Emeric Deutsch, Apr 11 2007

A199238(a(n)) = 0. - Reinhard Zumkeller, Nov 04 2011

LINKS

Indranil Ghosh, Table of n, a(n) for n = 1..20000 (first 1000 terms from T. D. Noe)

Paul Dalenberg, Tom Edgar, Consecutive factorial base Niven numbers, Fibonacci Quart. (2018) Vol. 56, No. 2, 163-166.

FORMULA

{n: A000120(n) | n}. - R. J. Mathar, Mar 03 2008

a(n) seems to be asymptotic to c*n*log(n) where 0.7 < c < 0.8. - Benoit Cloitre, Jan 22 2003

Heuristically, c should be 1/(2*log(2)), since a random d-bit number should have probability approximately 2/d of being in the sequence. - Robert Israel, Aug 22 2014

A049445 = { n: A199238(n)=0 }. - M. F. Hasler, Oct 09 2012

EXAMPLE

20 is in the sequence because 20 is written 10100 in binary and 1 + 1 = 2, which divides 20.

21 is in the sequence because 21 is written 10101 in binary and 1 + 1 + 1 = 3, which divides 21.

22 is not in the sequence because 22 is written 10110 in binary 1 + 1 + 1 = 3, which does not divide 22.

MAPLE

a:=proc(n) local n2: n2:=convert(n, base, 2): if n mod add(n2[i], i=1..nops(n2)) = 0 then n else fi end: seq(a(n), n=1..300); # Emeric Deutsch, Apr 11 2007

MATHEMATICA

binHarshadQ[n_] := Divisible[n, Count[IntegerDigits[n, 2], 1]]; Select[Range[228], binHarshadQ] (* Jean-Fran├žois Alcover, Dec 01 2011 *)

Select[Range[300], Divisible[#, DigitCount[#, 2, 1]]&] (* Harvey P. Dale, Mar 20 2016 *)

PROG

(PARI) for(n=1, 1000, b=binary(n):l=length(b); if(n%sum(i=1, l, component(b, i))==0, print1(n, ", ")))

(PARI) is_A049445(n)={n%norml2(binary(n))==0} \\ M. F. Hasler, Oct 09 2012

(PARI) isok(n) = ! (n % hammingweight(n)); \\ Michel Marcus, Feb 10 2016

(Haskell)

a049445 n = a049445_list !! (n-1)

a049445_list = map (+ 1) $ elemIndices 0 a199238_list

-- Reinhard Zumkeller, Nov 04 2011

(Python)

A049445 = [n for n in range(1, 10**5) if not n % sum([int(d) for d in bin(n)[2:]])] # Chai Wah Wu, Aug 22 2014

CROSSREFS

Cf. A000120, A005349, A199238.

Sequence in context: A186384 A011860 A259278 * A002174 A002202 A049225

Adjacent sequences:  A049442 A049443 A049444 * A049446 A049447 A049448

KEYWORD

nonn,easy,nice,base

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from Michael Somos

Edited by N. J. A. Sloane, Oct 07 2005 and May 16 2008

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 14:28 EDT 2019. Contains 325222 sequences. (Running on oeis4.)