A306263 Numbers k such that, for any divisor d of k, the Hamming weight of d divides k.
1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 32, 34, 36, 40, 42, 48, 60, 64, 66, 68, 72, 80, 84, 92, 96, 108, 116, 120, 126, 128, 132, 136, 144, 156, 160, 168, 172, 180, 184, 192, 204, 212, 216, 222, 228, 232, 240, 246, 252, 256, 264, 272, 276, 284, 288, 300, 310
Offset: 1
Examples
For n = 108: - the divisors of 108 are 1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 108, - the corresponding Hamming weights are 1, 1, 2, 1, 2, 2, 2, 2, 4, 2, 4, 4, - they all divide 108, - hence 108 belongs to the sequence. For n = 98: - the divisors of 98 are 1, 2, 7, 14, 49, 98, - the correspond Hamming weights are 1, 1, 3, 3, 3, 3, - 3 does not divide 98, - hence 98 does not belong to the sequence.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[k:k in [1..310]| forall{d:d in Divisors(k)| k mod &+Intseq(d,2) eq 0}]; // Marius A. Burtea, Dec 30 2019
-
Maple
filter:= proc(n) local F; F:= map(convert,map(convert,numtheory:-divisors(n),base,2),`+`); andmap(t -> n mod t = 0, F) end proc: select(filter, [$1..1000]); # Robert Israel, Mar 05 2019
-
Mathematica
Select[Range@ 310, With[{k = #}, AllTrue[Divisors@ k, Mod[k, DigitCount[#, 2, 1]] == 0 &]] &] (* Michael De Vlieger, Mar 05 2019 *)
-
PARI
is(n) = fordiv(n,d,if (n%hammingweight(d), return (0))); return ( )
Comments