login
Composite numbers such that all divisors >1 have the same number of 1's in binary representation.
2

%I #20 Jan 14 2024 12:38:08

%S 4,8,9,16,32,49,64,128,133,256,259,512,961,1024,2048,2059,2449,3713,

%T 4096,4681,4867,6169,6241,8192,8401,8773,9353,10261,10561,12307,12449,

%U 16129,16384,16459,16531,16771,18467,20491,24649,24721,24961,25217

%N Composite numbers such that all divisors >1 have the same number of 1's in binary representation.

%C A000120(d)=constant for all d with 1<d<=a(n) and d|a(n).

%C Are there terms with more than 2 distinct prime factors?

%C No terms with omega(n)>2 up to 10000000. - _Michel Marcus_, Jun 05 2013

%C From _Robert Israel_, Dec 01 2015: (Start)

%C The only term divisible by 3 is 9.

%C The terms divisible by 2 are 2^k for k > 1.

%C There are no terms divisible by 5. (End)

%H Harvey P. Dale and Robert Israel, <a href="/A089042/b089042.txt">Table of n, a(n) for n = 1..1000</a> (a(1) to a(100) from Harvey P. Dale)

%e Divisors >1 of 259: 7, 37 and 259, which have all three 1's in binary: 7->'111', 37->'100101' and 259->'100000011', therefore 259 is a term.

%p A000120:= proc(n) convert(convert(n,base,2),`+`) end proc:

%p filter:= proc(n) local t,f;

%p if isprime(n) then return false fi;

%p if n::even then return evalb(n = 2^ilog2(n)) fi;

%p if n mod 3 = 0 then return evalb(n = 9) fi;

%p t:= A000120(n);

%p for f in numtheory:-divisors(n) minus {1,n} do

%p if A000120(f) <> t then return false fi;

%p od;

%p true

%p end proc:

%p select(filter, [$4..10^5]); # _Robert Israel_, Dec 01 2015

%t dn1Q[n_]:=!PrimeQ[n]&&Length[Union[(DigitCount[#,2,1]&/@Rest[Divisors[ n]])]] == 1; Select[Range[26000],dn1Q] (* _Harvey P. Dale_, Oct 03 2013 *)

%o (PARI) isok(n) = {if (isprime(n) || n==1, return (0), my(nb = norml2(binary(n))); fordiv(n, d, if (d!=1 && norml2(binary(d)) != nb, return (0))); return (1););} \\ _Michel Marcus_, Jun 05 2013

%Y Cf. A007088, A002808.

%K nonn,base

%O 1,1

%A _Reinhard Zumkeller_, Dec 02 2003