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. 16
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; 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 (deutsch(AT)duke.poly.edu), Apr 11 2007

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

LINKS

T. D. Noe, Table of n, a(n) for n=1..1000

FORMULA

{n: A000120(n) | n}. - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Mar 03 2008

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

EXAMPLE

a(7) = 12 because 12 is written 1100 in base 2 et 1+1=2 divides 12

n=20, binary(20)= 10100, S2(20)=2, 20/2 = 10 is integer, so n=20 belongs to the sequence.

n=21, binary(21)= 10101, S2(21)=3, 21/3 = 7 is integer, n=21 belongs to the sequence.

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 (deutsch(AT)duke.poly.edu), Apr 11 2007

MATHEMATICA

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

PROG

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

(Haskell)

a049445 n = a049445_list !! (n-1)

a049445_list = map (+ 1) $ elemIndices 0 a199238_list

-- Reinhard Zumkeller, Nov 04 2011

CROSSREFS

Cf. A000120, A005349.

Sequence in context: A130261 A186384 A011860 * A002174 A002202 A049225

Adjacent sequences:  A049442 A049443 A049444 * A049446 A049447 A049448

KEYWORD

nonn,easy,nice,base

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from Michael Somos

Edited by N. J. A. Sloane (njas(AT)research.att.com), Oct 07 2005 and May 16 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 20:03 EST 2012. Contains 205852 sequences.